-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useNewTransformation Feedback Thread #1352
Comments
Note for myself: We need to make the "no type definition found" or "type definition is wrong" error which we enhance for the old transformation here better for the new transformation and possibly also wrap the |
Hi, so far I've found 3 issues when using the new transformation. Data attributes
Some attributes got renamed Typing custom events from actions is a total loss // custom-events.d.ts
declare namespace svelte.JSX {
interface HTMLAttributes<T> {
'onclick-outside'?: (
event: CustomEvent & {
target: EventTarget & T;
},
) => void;
}
} svelte component
<script>
import { clickOutside } from 'somewhere';
const onClickOutside = () => {
console.log('foo')
};
</script>
<div
on:click-outside={onClickOutside}
/> This now results in errors like
|
- move "xml:.." attributes into svg attributes interface - remove quotes from attribute completions - lowercase attributes when they are case insensitive sveltejs#1352
- move "xml:.." attributes into svg attributes interface - remove quotes from attribute completions - lowercase attributes when they are case insensitive #1352
Any attribute prefixed with data- is valid sveltejs#1352
Any attribute prefixed with data- is valid #1352
Thank you @TomTomB for the valuable feedback! I adressed all issues in the latest version. |
@dummdidumm found this while using the new setting: it appears that it is not parsing multiline classnames properly? i can replicate whenever i just add an arbitrary newline in the middle of any classname, and it also goes away when i get rid of the newline. |
|
Thanks @sw-yx and @ignatiusmb ! Both issues are hopefully fixed with the latest version. |
Lightning fast as always @dummdidumm! Can confirm it's working again now. No more regressions detected in all the apps that uses the new transformation. |
Oops, might've spoken too early. To reproduce, try triggering autocompletion, or start writing HTML in markup. It works in an empty |
sveltejs#1352 This makes use of the Svelte AST that is now returned from svelte2tsx (privately, do not use this elsewhere!) by checking if the AST node at the given position is of type text. This also helped refactor some other checks into something less hacky
Could you provide a reproducible in a new issue? Can't reproduce this. |
This sounds like a bug which is fixed in the latest version which was released a few hours ago. Try updating the extension and then reload VS Code. |
Hmm.. maybe yeah, it is fixed now. I will let you know if it will come back |
So I've made an issue for some another issue appeared for me after upgrading to new transformation. |
The new transformation is now enabled by defaultYou can turn it off by setting |
it's allowed to reassign them inside the loop sveltejs#1352
it's allowed to reassign them inside the loop #1352
With "svelte.plugin.svelte.useNewTransformation" set to // app.d.ts
declare namespace svelte.JSX {
interface IntrinsicElements {
"example-element": {
name: number;
};
}
} Problem Setting useNewTransformations to Question Is this a bug or am I supposed to declare custom web components in a different manner? |
You should be able to do the following: // app.d.ts
declare namespace svelteHTML {
interface IntrinsicElements: { .. }
} That said, we probably should add backwards-compatibility for the typings. They exist for others, but not this case. |
Hi, I have this in my type Stringable = string | { toString(): string };
declare namespace svelte.JSX {
interface HTMLAttributes {
class?: Stringable;
}
interface SVGAttributes {
class?: Stringable;
}
} This is so that the "class" attribute accepts any object with that a What should I do? |
@aradalvand You seem to have the same problem I had. See #1352 (comment) Try changing |
@samuelstroschein I did that but sadly it makes no difference. I think the problem in my case is that the language server concatenates the types with an |
This comment was marked as off-topic.
This comment was marked as off-topic.
for new transformation sveltejs#1352 This adds additional types to - incorporate custom element definitions into the new transformation - override instead of merge type definitions - allow easy SVGAttributes enhancement in the new trasnformation
for new transformation #1352 This adds additional types to - incorporate custom element definitions into the new transformation - override instead of merge type definitions - allow easy SVGAttributes enhancement in the new trasnformation
Backwards compatibility should be better now, both these case should work without errors now, but you can also switch to the new |
I have Svelte for VS Code v106.1.0 and neither my old |
Could you please share a code snippet along with more details what doesn't work so we can reproduce this? |
|
We introduced a new transformation which powers the Svelte intellisense under the hood. The goal is to get rid of a tsx-style transformation and simplify transformations along the way.
Advantages for users:
Internal advantages:
You can try out the new transformation using
svelte.plugin.svelte.useNewTransformation
totrue
svelte-check
version 2.4.0 with the--use-new-transformation
flag.Please provide feedback in here about any improvements or regressions.
The text was updated successfully, but these errors were encountered: