Bundle size discussion #33
Comments
I'll start seeing how we can refactor from top-down. For compatibility and not-reinventing-the-wheel reasons, I'd like to probably keep these:
We can probably find a simpler implementation of I'll take a look at what else (besides lodash) can be contributing to the size that we can probably shrink down. Thanks for taking a look at this! |
I added a simple remake of mapValues that follows the current usage of it. https://github.com/chrisblossom/react-redux-form/tree/feature/bundle_size |
Other lodash modules must share the same functions that are being used with mapValues. Before:
Info: main.js 291.89 kB (~82.07 kB gzipped)
lodash: 127.35 KB (12.1%)
react-redux-form: 35.47 KB (3.38%)
mapValues feature/bundle_size
Info: main.js 291.25 kB (~81.65 kB gzipped)
lodash: 124.01 KB (11.8%)
react-redux-form: 35.59 KB (3.40%) |
I've used https://github.com/substack/node-deep-equal instead of lodash's isEqual and it is fairly small (but not sure if it is smaller than the lodash implementation) |
Webpack v2 will include tree shaking and only bundle the lodash functions you really used :-) |
@acidicX Yes, that'll be really helpful, though I anticipate many developers will still be using Webpack 1. I am actively working on reducing the bundle size in V1, and you can check out the current work in the |
Currently react-redux-form has quite a large bundle size.
Using a Webpack production setup, ran the results though gzip-size, pretty-bytes, and webpack-bundle-size-analyzer get the following results. (granted I could be doing something drastically wrong)
Before react-redux-form:
Info: main-a7e6efc158923f542641.js 236.19 kB (~65.99 kB gzipped)
lodash: 2.8 KB (0.326%)
After react-redux-form
Info: main-2baf2fc84daf142ae6da.js 291.89 kB (~82.07 kB gzipped)
~16.08 kB gzipped added.
According to my tests below, lodash is currently accounting for ~8.46 kB, a little more than half.
I think we should start removing as much of lodash as we can.
Below are my results sorted in lodash function size.
Thoughts? Are others seeing this kind of bundle increase?
The text was updated successfully, but these errors were encountered: