-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Svelte 5: root.svelte
file generate <svelte:component>
is deprecated in runes mode — components are dynamic by default
#12573
Comments
compilerOptions: { runes: true }
, root.svelte
file generate `
<svelte:component> is deprecated in runes mode — components are dynamic by default
`compilerOptions: { runes: true }
, root.svelte
file generate <svelte:component>
is deprecated in runes mode — components are dynamic by default
@Rich-Harris Right now, we're emitting code like As a side note, if we're going to be refactoring this generated component, maybe we should also switch away from the name |
The same message / warning is gerenrated even without opting into the runes mode with this |
The code that generates this file (https://github.com/sveltejs/kit/blob/main/packages/kit/src/core/sync/write_root.js) detects the presence of Svelte 5 and uses that, not the compiler option, to decide what to write. The generated file actually forces runes mode on at the component level with |
compilerOptions: { runes: true }
, root.svelte
file generate <svelte:component>
is deprecated in runes mode — components are dynamic by defaultroot.svelte
file generate <svelte:component>
is deprecated in runes mode — components are dynamic by default
Tbf i think the same assumptions made for |
Oh just realised that we already allow that for uppercase components...i guess it make sense to allow lowercase components too |
@Conduitry i've opened a PR to treat
do you think is worth it? That will mean a lot of conditionals in |
If we end up going with sveltejs/svelte#12821, then no, I don't think it's worth it. If we don't go with that change and we're going to need to do a bit of refactoring of this component anyway, then possibly. |
Huh, didn't realize the array notation thing already works. That skeeves me out a bit tbh, it makes it look like you can use arbitrary expressions |
Tbf i think you actually can...once something is recognized as a component it just use that thing as a function call |
It breaks down when using variables tho (surprisingly it actually worked until i wrote the code for the button since at the point |
No, you can't. It just puts the expression in verbatim without processing it. This is a bug and we should fix it |
Yeah see my following comment...by fix it i guess you mean make it work right? 😄 |
Describe the bug
When using any Svelte 5 features,
root.svelte
file generate`<svelte:component>` is deprecated in runes mode — components are dynamic by default
I'm not sure if this is a bug that SvelteKit, Svelte, or @svelte/adapter-static needs to fix. Hope you guys can transfer it to the correct one if needed.
Reproduction
Just create a new SvelteKit project and use any Svelte 5 features.
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: