dotlottie-web icon indicating copy to clipboard operation
dotlottie-web copied to clipboard

+30kb bundle size (min+gzip) when migrating from @dotlottie/react-player

Open calvinf opened this issue 1 year ago • 3 comments

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: image

new: image

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: Enhancement label to this issue.

calvinf avatar Sep 23 '24 22:09 calvinf

Looks like most of the size increase has been from changes in @lottiefiles/dotlottie-web

https://bundlephobia.com/package/@lottiefiles/[email protected]

calvinf avatar Sep 23 '24 22:09 calvinf

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?

theashraf avatar Sep 25 '24 12:09 theashraf

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.

github-actions[bot] avatar Nov 25 '24 02:11 github-actions[bot]