-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Tree-shaking in v9 #1158
Comments
I plan on adding a Webpack-based tree-shaking demo to the |
Thanks for the response, my assumption is at least correct 😄 |
For the latest webpack + ts, it seems refactoring similar to #1150 will be needed. |
This comment has been minimized.
This comment has been minimized.
@joshuaellis Why was this closed and marked with |
@frenic because right now this isn't the priority of development, there are a fair few bugs and unification of the API to solve before that as well as updating the documentation. However, if you're interested in working on this, then i'm happy to reopen and support you however I can? Would you like too? |
I'm working on an application where this is all we use from React Spring const [y, setY] = useState(i * 75);
useSpring({
y: i * 75,
onChange(change) {
setY(change.value.y);
},
}); Do you have any idea how to make it so the entire package isn't included in the bundle? I know it might not be feasible for you all to implement tree shaking but I assume there's a different way to do this eliminating the need for React Spring altogether. Thanks! |
@joshuaellis A year later, will this ever get on the roadmap? |
Hi @itayganor, any particular reason you're asking? 😄 Unfortunately, |
@joshuaellis I see. It's a great opportunity to thank you for your contributions for this magical library. As for why I'm asking, it's because I just upgraded my app from v8 to v9 and I noticed an increased bundle size :\ |
I think it could be the next large task to start investigating. The issue I worry about is how much of an architecture change it could cause, so it'd need to be handled as investigation before committing to development. I'll think about opening a new issue to track in the coming days. |
How does tree-shaking works in
v9
? It looks like I got the entire@react-spring
in bundle no mater what I use. Is this expected behavior or did I miss something?Originally posted by @jerry84 in #985 (comment)
OK, from my understanding
@react-spring/core
includes all the features that is possible to tree-shake before, for examplecolor-interpolations
. It doesn't look like it is possible anymore.Originally posted by @jerry84 in #985 (comment)
The text was updated successfully, but these errors were encountered: