-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Proposal: Offer an option to use lottie light. #90
base: master
Are you sure you want to change the base?
Conversation
AFAICT react-lottie always uses the svg renderer and (at least in my case) the animations don't have expressions. By importing the light version of of lottie-web one can save around 100KB (minified). airbnb/lottie-web#929
First of all, thanks! |
Yes that sounds good. Problem is I don't know what a good approach would be to get 2 builds. I'd also welcome information regarding the prepublish script. It says:
Is that referring to https://github.com/storybook-eol/react-cdk? Which seems to be outdated? From what I understand, there's actually no way to conditionally I'm really uncertain about this approach, so feedback is very welcome. |
I think this is a very nice proposal, and in addition to it, I'd be very interested in an exportable function from the animation. This would be similar to the Imagine you build your animations, and a single method that exports the whole functionality, with little to no library in it, just the raw svg and functionality that make the animation tick. This could be saved as its own unique react component that is exactly and specifically the required animation, with zero library in it. It would not be useful in all use cases, but in the use case of, for example (mine), a loading spinner, where we've included the whole of lottie just to have a simple and smooth animation, it would make complete sense. |
This would be really helpful as lottie also does not support a CSP without |
Why hasn't this PR been merged? I would love to reduce the bundle size |
+1 |
Hello!
As mentioned by @eyaleizenberg in #79,
the current bundle size is around 250KB. By using lottie_light over lottie-web one can save
around 100KB (minified). The difference between the 2 versions is explained here:
Since react-lottie always uses the SVG renderer (AFAICT) and expressions might not be
required by everyone (my case), it would be nice if we had a way to expose the
lottie_light
option.
The PR is just a proposal, since I'm not sure how often expressions are required. But I think
100KB is worth a discussion. Let me know what you think.