-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Throw an error when importing svelte/internal/* #11622
Comments
warn in non-runes mode, error in runes mode 👍 The svelte compiler can only do this in .svelte and .svelte.js files, technically someone could be doing it in regular js files and reexport to fool it. There is an issue on v-p-s to do it on the resolve level sveltejs/vite-plugin-svelte#861 and iirc eslint-plugin-svelte also added a warning for this recently. |
I think we should error. |
As a side note tho might be worth checking what they were using |
* feat: error on imports to `svelte/internal/*` closes #11622 * regenerate * also error on svelte/internal
This comment was marked as off-topic.
This comment was marked as off-topic.
@JLarky please don't give people ideas. As the name says and our documentation and errors show, svelte/internal is for internal use only. You must not use it or provide guidance on how to do so. There are no guarantees whatsoever that these interfaces are stable or change at any point in time without notice. Your app or the apps of users using your library that contains this code are going to break and it will be all your fault. TL;DR: don't use svelte/internal, period. |
Describe the problem
People have reached into
svelte/internal
too much in the past. We should discourage it as much as possible and throw a compiler error when someone imports from it. People who reaaaally wanna do it can hide it by importing it from a regular JS file and reexport it.Describe the proposed solution
Error on
svelte/internal/client
andsvelte/internal/server
Importance
nice to have
The text was updated successfully, but these errors were encountered: