-
Notifications
You must be signed in to change notification settings - Fork 55
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 lottie light player #39
Conversation
Thanks for this! I never heard about lottie light. It seems like an undocumented API? I found something here airbnb/lottie-web#289 |
yeah, the docs are very sketchy around it, but this seems to be the only way to avoid having eval. apps that have a strict CSP would be severely limited in using lottie due to this. i'll take a look at the formatting. i think its just indented the main function since I wrapped it with that factory method. the code for the component is unchanged. i'll take a look though |
yeah, probably not much I can do about the indentation unless you can see something I've missed. The main component is just wrapped in a factory function that allows the various entrypoints to choose which version of the base lottie player will be used. if I moved the component out of this function, it won't have access to the right lottie player. |
If all you did was to wrap the code in the function, then you (or I) can just revert, then redo that change without applying the formatting changes (just only change indentations). I'll have a look at it when i have some time. |
Oh I see what you mean. Yeah, I can update that.
…
On 23 Jul 2021, at 09:42, Mikael Finstad ***@***.***> wrote:
If all you did was to wrap the code in the function, then you (or I) can just revert, then redo that change without applying the formatting changes (just only change indentations). I'll have a look at it when i have some time.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Ok, so I've reverted the formatting changes. Unfortunately not much has changed since the main lottie player is all indented. can you see anything else I could do to sort that? |
Hi @mifi , is this ok now or do you need anything else changing? thanks |
We are using this great package in our component library but rollup doesn't like eval, which the full lottie player uses. This pr reworks the code a little to export a version of the player that uses lottie light, which doesn't use eval, and is much smaller than the full player, which makes rollup happy.
I've added tests for the light player, which seem to pass ok.
Obviously the light player isn't going to support every option that the full player supports, but I guess that's up to the consumer.
Existing functionality should remain unchanged.