Skip to content

Can I import svelte 5 components to svelte 4? #14417

Answered by dominikg
devcsrj asked this question in Q&A
Discussion options

You must be logged in to vote

You can only use components authored with runes in applications compiled with the svelte5 compiler.
So if you want to make a component library that is compatible to svelte4 compiler, you have to stick with svelte4 syntax.

Now the svelte5 compiler understands svelte4 syntax, so you can migrate your huge kit app to use the svelte5 compiler by updating to that version even without updating all of your code. (some small adjustments might have to be made but they should be reasonable).

Once the app is compiled with svelte5, you can use svelte5 syntax component libraries too even if your application code is still using svelte4 syntax.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brunnerh
Comment options

Answer selected by devcsrj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants