Skip to content
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

Compiler options runes: true should only affects the user components as defined in src #11523

Open
jeannemas opened this issue May 9, 2024 · 4 comments

Comments

@jeannemas
Copy link

Describe the bug

Currently (at least, until 5.0.0-next.125), when we set runes: true inside of svelte.config.js, all the components inside our app (including the ones packaged from external libraries) are forced into runes mode.

However this has the side effect of preventing the use of slighly older libraries that might not have native runes support, one such example is sveltekit-superforms.

My question is should the compiler options runes: trues only affects user components as defined in src? If not, the docs should clearly state that it also affects the third party ones.

See the reproduction link bellow for an example.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-tqyv6t

Logs

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    svelte: ^5.0.0-next.125 => 5.0.0-next.125

Severity

blocking an upgrade

@paoloricciuti
Copy link
Contributor

You can just install svelte 5 and start using runes in your components to unlock runes mode for those components.

@Conduitry
Copy link
Member

I don't think the behavior here should change, nor should the core compiler be aware of things like 'in src' and 'in node_modules'.

The recommended way to handle this would be with https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#dynamiccompileoptions - although the code example is out of date - it no longer lives under experimental - I'll open a PR for that shortly.

@jeannemas
Copy link
Author

I don't think the behavior here should change, nor should the core compiler be aware of things like 'in src' and 'in node_modules'.

The recommended way to handle this would be with https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#dynamiccompileoptions - although the code example is out of date - it no longer lives under experimental - I'll open a PR for that shortly.

I didn't know about this config entry, I'll make sure to check it out! Thanks for your fast answer!

@Serator
Copy link

Serator commented May 11, 2024

#10359 (comment) - I have used a similar approach in SvelteKit exactly with sveltekit-superforms and, I confirm, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants