Replies: 3 comments
-
really need this feature |
Beta Was this translation helpful? Give feedback.
0 replies
-
I made a repo playground: https://github.com/nandorojo/reanimated-tree-shaking |
Beta Was this translation helpful? Give feedback.
0 replies
-
Just checking if we find a solution to reduce the bundle size. in our react native project the reanimated takes 510KB. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Update: I opened a PR here: #3278
Reanimated's bundle size is currently massive, and it doesn't have any optimizations for tree shaking. As a result, by using Reanimated, my website is loading in a lot of code it doesn't actually use.
When I import it in a Next.js project, and run
ANALYZE=true yarn next build
using@next/bundle-analyzer
, this is the output I see.Reanimated and Gesture Handler add 60kb and 25kb gzipped (respectively).
framer-motion
had a similar issue, but they optimized it very well. I'm wondering if there could be a similar solution for Reanimated.What if we added an extra
tree
export, like:That way, we could find a way to tree shake the library without causing a breaking change.
The main export file could import from the
tree.ts
file, so that there isn't duplicate code.Beta Was this translation helpful? Give feedback.
All reactions