-
Notifications
You must be signed in to change notification settings - Fork 10.3k
react-spring SideEffects must be set to true #30454
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
Comments
As far as I can see, Gatsby is doing nothing special in this regard and is delegating this decision making to webpack.There's some documentation here https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free that highlights the difficulties.
Are there any side effects in react spring that you are aware of? Perhaps it's prudent to explicitly call out those files so webpack can function better. Although the workaround works, it's surely much better that react spring defines this in its package.json and then all webpack users will benefit from this change. |
I think the library has specifically removed It doesn't sound like we have to explicitly declare
I definitely agree, I'm just trying to get my head round what sideEffects actually were, so thank you for the article 👍🏼 It explains why this issue is so important pmndrs/react-spring#1158 |
Yes I agree, false would indicate there's no side effects and that could further inflict issues. True would almost definitely solve the issue although its heavy handed. Specifically highlighting the sideffect files seems to be the utopia but might be complex, as there are a number of calls to |
I agree, it's definitely something to look into. Thanks for the insight 👍🏼 |
Description
This issue has been reported to us a few times see: pmndrs/react-spring#1239 & pmndrs/react-spring#1069 as an example. Peoples workaround is to enforce
sideEffects:true
on the particular package:It'd be great to get your feedback on whether this is the intended fix for the issue or it's a bug in either library that can be fixed. If it's the correct thing to do then I can add some documentation to let everyone know so neither library gets the bugs.
The text was updated successfully, but these errors were encountered: