Repository navigation
feat(Lottie): add LottieView for web + LottieViewBase API contract + setup dotlottie-react runtime - #1009
feat(Lottie): add LottieView for web + LottieViewBase API contract + setup dotlottie-react runtime#1009aquelemiguel wants to merge 15 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Lumen PR reportTest coverageLibs must reach 80% on every metric. Δ is against the latest green
Internals (reported, not gated)
|
gamegee
left a comment
There was a problem hiding this comment.
[mid] I know the mdx is planned for another ticket. The thing is, this component needs setup before it works (the .lottie asset rule and the wasm URL, see my comment on index.ts), and right now that's only half-written in the symbols README. Could we at least put a short "setup" note in the JSDoc, or link the follow-up ticket in the PR description?
| LottieSource, | ||
| LottieViewRef, | ||
| } from '@ledgerhq/lumen-utils-shared'; | ||
| export { setWasmUrl as setLottieWasmUrl } from '@lottiefiles/dotlottie-react'; |
There was a problem hiding this comment.
[high] (CLAUDE) By default dotlottie-web fetches its wasm (~1.2 MB) from jsdelivr, with unpkg as a fallback, unless someone calls setWasmUrl. That worries me for our apps: CSP or offline would just give a blank animation, and loading a renderer from a public CDN at runtime in a wallet isn't great either.
The package does export @lottiefiles/dotlottie-web/dotlottie-player.wasm, so consumers can import it as an asset and call setLottieWasmUrl at startup. I'd make that the documented setup, and do the same in our Storybook preview so we don't hit the CDN from there either. Also, do we know if a failed wasm load ends up in onError?
Sim: Not sure yet how it should be handled, probably a small investigation on how its done on LW currently,
| }, | ||
| "dependencies": { | ||
| "@ledgerhq/lumen-utils-shared": "0.1.20", | ||
| "@lottiefiles/dotlottie-react": "^0.22.3", |
There was a problem hiding this comment.
[low] Both dotlottie-react and dotlottie-web are ESM-only, and since LottieView is exported from the root barrel, every import of ui-react now loads them. Bundlers are fine since both are sideEffects: false. Jest is a different story: consumers will probably need to add @lottiefiles to their transformIgnorePatterns, like they already do for d3. Might be worth a quick consumer-impact run before release, and a line in the release notes.
|



Closes DLS-1055.