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

Add support for dotlottie format lottie animations #94

Open
AmitSingh12345678 opened this issue Sep 11, 2023 · 7 comments
Open

Add support for dotlottie format lottie animations #94

AmitSingh12345678 opened this issue Sep 11, 2023 · 7 comments

Comments

@AmitSingh12345678
Copy link

Is your feature request related to a problem? Please describe.
For now, we are using dotjson format lottie animations which takes quite a time for fetching(remote lottie files) and rendering lottie files. As dotlottie format lottie files are quite small as compared to dotjson format lottie files(upto 80%), hence it will help in improving the performance of the app and reducing app size.

Describe the solution you'd like
Add support for dotlottie format lottie files.

Describe alternatives you've considered
There are some packages I have found which support dotlottie format lottie animations, but none of them are fulfilling our requirement as either some have large package size or some are not maintained.
Some alternative packages i have checked:
@dotlottie/player-component (Problem: large package size)
@johanaarstein/dotlottie-player

Also these above packages only support dotlottie format lottie files, not dotjson format lottie files.

It will be really helpful if you add support for dotlottie format lottie files, as it will really help a lot of people in improving the performance of app and reducing app size.

@theashraf
Copy link

@AmitSingh12345678

I'd like to recommend the official dotlottie react player, which can be found here: https://www.npmjs.com/package/@dotlottie/react-player
It supports both dotlottie and lottie json formats, and also offers advanced features such as multi-animation support, interactivity, and theming. Plus, it's optimized for a smaller bundle size which should help in improving the performance and reducing the app size as you mentioned.

It might be a good solution for your requirements.

@AmitSingh12345678
Copy link
Author

@AmitSingh12345678

I'd like to recommend the official dotlottie react player, which can be found here: https://www.npmjs.com/package/@dotlottie/react-player It supports both dotlottie and lottie json formats, and also offers advanced features such as multi-animation support, interactivity, and theming. Plus, it's optimized for a smaller bundle size which should help in improving the performance and reducing the app size as you mentioned.

It might be a good solution for your requirements.

@theashraf

Thankyou for the quick response. The package you have mentioned seems good, but it's unpacked size is around 2mb, while the package i am currently using for displaying lottie files(dotjson format) has size around 230kb.
Is there any way to reduce the size of the package you mentioned?

@Gamote
Copy link
Owner

Gamote commented Sep 11, 2023

Hey @AmitSingh12345678, thank you for the input, I will keep it in mind for when we release the version 3. 🌊

@AmitSingh12345678
Copy link
Author

Hey @AmitSingh12345678, thank you for the input, I will keep it in mind for when we release the version 3. 🌊

@Gamote
What's the ETA for release of version 3?
It will be helpful for us to plan accordingly.

@Gamote
Copy link
Owner

Gamote commented Sep 11, 2023

@AmitSingh12345678 In the spirit of full transparency I must say that the last piece is the interactivity, no contributor has any available time. So we are considering releasing the version 3 in 1 month without the interactivity and after that focus on it.

@theashraf
Copy link

theashraf commented Sep 11, 2023

@AmitSingh12345678
I'd like to recommend the official dotlottie react player, which can be found here: https://www.npmjs.com/package/@dotlottie/react-player It supports both dotlottie and lottie json formats, and also offers advanced features such as multi-animation support, interactivity, and theming. Plus, it's optimized for a smaller bundle size which should help in improving the performance and reducing the app size as you mentioned.
It might be a good solution for your requirements.

@theashraf

Thankyou for the quick response. The package you have mentioned seems good, but it's unpacked size is around 2mb, while the package i am currently using for displaying lottie files(dotjson format) has size around 230kb. Is there any way to reduce the size of the package you mentioned?

@AmitSingh12345678, while the total unpacked size of the dotlottie player is around 2MB, the minified bundle size is actually just about 105KB. Remember that not all the files from the 2MB are going to be loaded into your bundle. Instead, only the relevant chunks will be included, based on the specific features of the dotlottie player you utilize.

For a better understanding, you can review the bundle sizes on https://bundlephobia.com/package/@dotlottie/player-component@2.5.3 or even test the package out yourself. Hope this helps! :)

Additionally, you can check out the dotlottie playground and inspect the bundle size of the player directly from the network tab in your browser's developer tools.

@AmitSingh12345678
Copy link
Author

@AmitSingh12345678
I'd like to recommend the official dotlottie react player, which can be found here: https://www.npmjs.com/package/@dotlottie/react-player It supports both dotlottie and lottie json formats, and also offers advanced features such as multi-animation support, interactivity, and theming. Plus, it's optimized for a smaller bundle size which should help in improving the performance and reducing the app size as you mentioned.
It might be a good solution for your requirements.

@theashraf
Thankyou for the quick response. The package you have mentioned seems good, but it's unpacked size is around 2mb, while the package i am currently using for displaying lottie files(dotjson format) has size around 230kb. Is there any way to reduce the size of the package you mentioned?

@AmitSingh12345678, while the total unpacked size of the dotlottie player is around 2MB, the minified bundle size is actually just about 105KB. Remember that not all the files from the 2MB are going to be loaded into your bundle. Instead, only the relevant chunks will be included, based on the specific features of the dotlottie player you utilize.

For a better understanding, you can review the bundle sizes on https://bundlephobia.com/package/@dotlottie/player-component@2.5.3 or even test the package out yourself. Hope this helps! :)

Additionally, you can check out the dotlottie playground and inspect the bundle size of the player directly from the network tab in your browser's developer tools.

Got it, thanks for helping 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants