javascript-sdk
javascript-sdk copied to clipboard
Large jump in bundle size as of 4.4.0
If you check out bundlephobia for this package: https://bundlephobia.com/result?p=@optimizely/[email protected]
It looks like there was a pretty substantial jump in bundle size as of 4.4.0. The changelog is pretty sparse for 4.4, perhaps it wasn't noticed?
From what I can see, the minified files increased by about 3-4KB going from 4.3.4 to 4.4.0. See the listing on unpkg:
https://unpkg.com/browse/@optimizely/[email protected]/dist/
optimizely.browser.es.min.js | 59.9 kB
optimizely.browser.umd.min.js | 90 kB
https://unpkg.com/browse/@optimizely/[email protected]/dist/
optimizely.browser.min.js | 63.2 kB
optimizely.browser.umd.min.js | 93.7 kB
This seems right given that we added some code implementing a new feature.
I don't know why bundlephobia is reporting such a big increase. It looks like it wasn't counting our dependencies in 4.3.4, but it is counting them in 4.4.0. I'll see if I can figure out what's going on there.
Looks like this package has steadily been increasing in size since the original 4.0 version. This is an issue for me because I am using it with lambda@edge which has a very small size limit so I am unable to use the newer 4.x versions.
Thanks for keeping tabs on the package.
Along with Issue #352, we're actively working to reduce the size during this and next sprints, which will be part of the 5.0.0 GA release.
We'll also look to publish some general best-practice around downstream bundling to find the optimum settings when shaking out (transitive) dependencies. ....admittedly, the documentation phase will come a bit after the v5 release. I think we may have a doc ticket already (or I'll create one; @Tamara-Barum )
Thanks for bearing with us as we optimize(ly) our deliverables 😉
We have another issue #352 about bundle size. All bundle size reduction work will be tracked under that issue, so closing this one.