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 https://github.com/pmndrs/react-spring/issues/985#issuecomment-697275104_
OK, from my understanding @react-spring/core includes all the features that is possible to tree-shake before, for example color-interpolations. It doesn't look like it is possible anymore.
_Originally posted by @jerry84 in https://github.com/pmndrs/react-spring/issues/985#issuecomment-697288923_
I plan on adding a Webpack-based tree-shaking demo to the v9 branch sometime soon. If anyone wants to contribute on that front, go right ahead. Then we can figure out if there's anything that needs to be fixed.
I plan on adding a Webpack-based tree-shaking demo to the
v9branch sometime soon. If anyone wants to contribute on that front, go right ahead. Then we can figure out if there's anything that needs to be fixed.
Thanks for the response, my assumption is at least correct 馃槃
For the latest webpack + ts, it seems refactoring similar to #1150 will be needed.
What's the status of this issue? I just upgraded to v9.0.0-rc.3, and now I'm getting this error with our Jest tests:
TypeError: (0 , _reactSpring.useSpring) is not a function
We're using Create React App, with Typescript. Any file that imports anything from react-spring, i.e.
import { useSpring } from 'react-spring' is effected.
Most helpful comment
I plan on adding a Webpack-based tree-shaking demo to the
v9branch sometime soon. If anyone wants to contribute on that front, go right ahead. Then we can figure out if there's anything that needs to be fixed.