-
-
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
breaking: remove legacy package.json
files
#8490
Conversation
Instead of "both", which doesn't make sense at that point.
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
@benmccann is attempting to deploy a commit to the Svelte Team on Vercel. A member of the Team first needs to authorize it. |
package.json
filespackage.json
files
Is it safe to do this? It's not only about the node version, but also about bundlers. Do all recent versions of Rollup/Webpack/Vite and our REPL auto-detect and use the package exports correctly? |
I think this way is actually more safe. Everything handles |
Hmm. Actually, webpack 4 may not support it. So I guess there's a question of whether we want to drop support for webpack 4 or not. It looks to me that about half of webpack users are still on webpack 4. And it looks like about 16% of Svelte users are on webpack: https://npmcharts.com/compare/@sveltejs/vite-plugin-svelte,rollup-plugin-svelte,svelte-loader?log=false&interval=7. So it'd probably be about 8% of users that are on webpack 4 and would need to stay on Svelte 3 until they're able to upgrade to webpack 5. |
If they are reluctant enough to not upgrade webpack to v5 to this day, then I think they definitely won't be upgrading svelte to v4 anytime soon. 😁 I'm kinda out of the loop on what your plans are regarding svelte 4 and what it will require to refactor in user's 5-40k LoC apps. 🤷♂️ |
Thanks. There will be a few breaking changes in Svelte 4 like dropping older versions of Node, but hopefully nothing terribly bad. You can see more on https://svelte.dev/roadmap if you're interested |
Dropping Webpack 4 support sounds reasonable to me - Webpack 5 has been out for a while now, and people who are still on Webpack 4 probably won't want to update Svelte either. And updating Webpack 4 -> 5 isn't particularly difficult. |
rollup.config.mjs
Outdated
types: './index.d.ts' | ||
}, null, ' ')); | ||
|
||
fs.writeFileSync(`${dir}/index.d.ts`, `export * from '../types/runtime/${dir}/index';`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't get rid of this line because else TypeScript without moduleResolution: bundler
won't find the type definitions anymore.
package.json
filespackage.json
files
966079b
to
47e2b18
Compare
this PR is trashed. closing in favor of #8515 |
Now that we only support newer versions of Node we can simply rely on
exports
.This is a breaking change because it requires bundlers to be able to handle the
exports
field. This is the case for@rollup/plugin-node-resolve
)If you're relying on a bundler that does not know how to deal with export maps, you need to update its version to one that supports it (like webpack 4->5) or switch to another bundler.