Open
Conversation
|
martin-wahlberg
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
lottie-web is a package that seems to have been completely abandoned by AirBnB. There's an issue related to a new navigator API in Node >21 which breaks the currently used package, even though it's wrapped in a
<ClientOnly>component in spor-react. 😢Undersigned found this github issue: Gamote/lottie-react#101 and found a user who had success with https://www.npmjs.com/package/@lottiefiles/dotlottie-react instead (directly followed by a comment from user who did not have success with it 🙄 )
Solution
@lottiefiles/dotlottie-reactrelies onsrc={urlToSrc}format, so the oldcontent-loader.tstypescript objects were not compatible. I made a script that converted all the lottie objects into json, which I could then upload to https://lottiefiles.com and export as.lottiefiles.The free tier has a max of 10 files you can upload as .json and export as .lottie before you have to pay up. So I made two accounts 😈
This PR proposes to use these lottie files instead and replace
lottie-webwithdotlottie-react. Lottie files are ~90% smaller than the ts/json equivalent and could improve load times for our end users. (I haven't benchmarked this)I'm unsure on how to proceed further with making these .lottie files accessible to
spor-react, as they could either A. be stored in thespor-loaderpackage and imported intospor-react, or B. be stored on a CDN (https://spor.vy.no/assets/lottie/content-loader.lottie) and fetched by thespor-reactloader components.The lottie files currently live in: https://github.com/nsbno/spor/tree/feat/replace-lottie-react/packages/spor-loader/src/lottie
Screenshots
lottie-weband node v24:Chakra update checklist
Not sure if these changes solicit any checklist ticking, but let me know if I'm wrong!
Chakra update checklist
UU checks
If no packages, only docs has been changed:
Everything about making a React component:
https://spor.vy.no/guides/how-to-make-new-react-components
HOW TO MAKE A CHANGESET:
Go here: https://spor.vy.no/guides/how-to-make-new-react-components#creating-a-pr-and-publish-package
How to test
pnpm build before running pnpm dev and check out the loaders locally.