dotlottie-web
dotlottie-web copied to clipboard
+30kb bundle size (min+gzip) when migrating from @dotlottie/react-player
Overview
When migrating from @dotlottie/[email protected] to @lottiefiles/[email protected], our gzipped bundle size for pages including DotLottieReact has increased by 30.3kb (min+gzip).
Motivation
What inspired this enhancement? What makes you think this should be included?
Looking at Bundlephobia showcases the size difference:
old:
new:
Request
It would be great to investigate and root cause the source of the bundle increase. Even looking at 0.7.1 to 0.8.12 of this package, the size has increased from ~16kb to ~51kb. (I haven't had a chance to look for what changed in those releases.)
With dot lottie files being focused on performance, it's really counter-productive if the library itself is ballooning in size.
Labels
- [ ] Add the
Type: Enhancementlabel to this issue.
Looks like most of the size increase has been from changes in @lottiefiles/dotlottie-web
https://bundlephobia.com/package/@lottiefiles/[email protected]
Thanks, @calvinf, for your feedback. I'll look into this. As a note, dotlottie-react is shipped as an ESM (ECMAScript module), which supports tree shaking. This means that only the code you actually use from the library will be included in your app's main bundle, assuming you're using a bundler that enables tree shaking by default. Therefore, dotlottie-react should be tree-shakable. Could you let me know which bundler you're using?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.