Skip to content
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

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

Open
1 task
calvinf opened this issue Sep 23, 2024 · 3 comments
Open
1 task
Labels
bug Something isn't working react stale

Comments

@calvinf
Copy link

calvinf commented Sep 23, 2024

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 calvinf changed the title +30kb bundle size (min+gzip) when migrating +30kb bundle size (min+gzip) when migrating from @dotlottie/react-player Sep 23, 2024
@calvinf
Copy link
Author

calvinf commented Sep 23, 2024

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

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

@theashraf
Copy link
Member

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 theashraf added the bug Something isn't working label Sep 25, 2024
Copy link
Contributor

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 github-actions bot added the stale label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working react stale
Projects
None yet
Development

No branches or pull requests

2 participants