Closed bfontaine closed 3 weeks ago
Thanks for posting the issue and for the helpful links! It seems like for <T>
, it could be beneficial to keep using the Svelte 4 syntax to be consumed in components that haven't been migrated to runes yet, but provide another component to be used in rune components. I'm thinking maybe <LegacyT>
for the old syntax and <T>
for the new syntax, to make migration to future versions easier (that will deprecate the <LegacyT>
component with the old syntax). Any thoughts on this?
I'm working on the migration to Svelte 5 now but encountered some issues with the dependency updates. Will keep everyone updated on the progress.
Good idea! Thank you for your work on this.
I've just made a small version update in 0.1.9 that only relaxed Svelte's peer dependency version so that this package can be installed on Svelte 5 projects.
The internals are unchanged for now, so the <T>
component still expects slots to be used instead of snippets. This should still work in Svelte 5 since the slots aren't deprecated yet, but that does mean that you won't be able to use snippets with this component yet. I'll make a separate release once the internal Svelte 5 migration is finished with a new <T>
component that supports snippets.
The main problem is with the extractor (svelte-i18n-lingui/extractor), because the svelte compiler no longer returns walk
utilities.
That means the extraction (eq. lingui extract
) doesn't work and ends with this error:
Error: 'svelte/compiler' no longer exports a `walk` utility — please import it directly from 'estree-walker' instead
I made a working version using estree-walker-ts
, but I don't know if this is the ideal solution
https://github.com/HenryLie/svelte-i18n-lingui/compare/main...burningtree:svelte-i18n-lingui:main
@burningtree Thanks for the heads up! Indeed, lingui extract fails after updating to Svelte 5 due to the missing export. I was trying to hack the import to keep using estree-walker, but wasn't able to find a reliable way that works both on dev and build. I think your version with estree-walker-ts
works perfectly 👍
I've made a new release and bumped the minor version, the latest release is now on v0.2.0 and uses Svelte 5 internally. It exposes both <T>
and <LegacyT>
components as mentioned above. The <LegacyT>
component will be removed from v0.3.
I'll close this issue now since the migration is complete, thanks everyone for the discussion! Feel free to open another issue if you find any problem with the latest version.
Hello, The
package.json
currently declares a peer dependency on Svelte 4, thus blocking any upgrade to Svelte 5:https://svelte-omnisite.vercel.app/docs/svelte/v5-migration-guide See also https://github.com/sveltejs/svelte/issues/13434
Also, not sure if relevant for
<T/>
: