-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Errors when trying to use components compiled with previous Svelte versions #586
Comments
Oh yikes, that shouldn't happen. I wonder what commit caused this. |
It looks like this happened as part of a refactoring while transitions were being added. Fixing this seems like it would have to involve adding extra code for everybody, unfortunately, whether they need this private API stability or not. The |
What's done is done. We have updated our component library to use the latest Svelte version; problem solved...mostly. (We have broken compatibility with 1.18.1 client apps, but they just need to upgrade as well.) But I think going forward that this use case needs more attention. Maybe my team is the first to develop a UI component framework with Svelte, but I'm sure that when Svelte gains more traction a lot of companies will be trying to do this. |
I suppose the lesson here is that anything that is used for inter-component communication is technically part of the public API (and thus subject to semver) even if it has an underscore prefix. Perhaps we should add some tests around this stuff. |
I've put together a proposal that attempts to address this situation a bit more fully: #604. Would welcome feedback, particularly from @therealnicksaunders as you might have insight into whether this would work in practice, having already developed a component framework. |
I have an idea: How about we just log a warning (or even an error) at runtime when a component nests another component that was compiled with a different version of Svelte? Pros:
Cons:
|
That's a possibility. It would mean adding a version string to every component, which is wasted bytes in the majority of scenarios. I'd just reiterate that with regard to...
...I think Svelte apps should be compiling Svelte components — it's not just about avoiding compatibility headaches, but about ensuring that code is shared as far as possible, since that means apps that start up quicker (because there's less code to download and parse) and run quicker (because functions are more likely to be optimised quickly). It's just hard to do that at the moment because we don't have |
There is a |
It looks like new versions of Svelte are breaking compatibility with components compiled with previous versions of Svelte. For example, I have created a component ScratchComponent that works fine in the REPL with v1.18.1 but doesn't work with v1.19.1 and also doesn't work with the latest version. Thoughts?
The text was updated successfully, but these errors were encountered: