-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Size of bundle #266
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
Comments
Could you please elaborate what exactly in there is unnecessary? Here's my take on that statistic, but I'm keen to know if you've got another opinion on that :) The main size increase here is immer, which is fundamental to Next thing is redux - and the idea here is that you don't have to specify redux as a project dependency, but that RSK is including that by itself. Same argument goes for reselect. And that's AFAIK already tree-shakable if you're not using it. All the other dependencies make up less than 1kb - un-gzipped. Gzipped that will be much lower. |
I think that better when library includes only self code and all external deps goes as |
That wouldn't really work out on a large scale. Assume jest. If every depenency of jest were a peerDependency, and if every one of those had all their dependencies as peerDependencies, you would have to manually add ~1500 dependencies to your project. If you want control over those, that's what a lockfile is for, not your package.json. Also, these aren't peer dependencies. We want these to be at least installed when RTK is installed. |
Jest is dev tool. Users do not upload jest, when coming on website. |
I'm not sure what the "webpack" portion of that is, tbh. I don't see any mentions of Webpack in the actual The As @phryneas said, we're working on improving tree-shaking, but the point of RTK is definitely to have all these other dependencies pulled in automatically without having to specify them, and realistically we expect that folks are going to be using all of these in a real app. I'll go ahead and close this, as we've got the other issues related to tree-shaking already. |
Hello there! Could you please reduce size of the bundle? Seems like there is a lot of unnecessary things. https://bundlephobia.com/result?p=@reduxjs/[email protected]
The text was updated successfully, but these errors were encountered: