You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just noticed that my bundler is not tree shaking mobx-react-lite, due to it not having "sideEffects": false in its package.json.
I also noticed it was reverted because of this reported bug: #2689
The real issue is assertEnvironment module. It has sideEffects, but it could be replaced with checks inside the function calls fenced with if ("production" !== process.env.NODE_ENV) { /* check */ }, so bundlers and minifiers can strip it from production code.
This way errors could be caught by React error boundaries, which could prevent a full application break and indicate which part of the application was the culprit.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I just noticed that my bundler is not tree shaking
mobx-react-lite
, due to it not having"sideEffects": false
in itspackage.json
.I also noticed it was reverted because of this reported bug: #2689
The real issue is
assertEnvironment
module. It has sideEffects, but it could be replaced with checks inside the function calls fenced withif ("production" !== process.env.NODE_ENV) { /* check */ }
, so bundlers and minifiers can strip it from production code.This way errors could be caught by React error boundaries, which could prevent a full application break and indicate which part of the application was the culprit.
Beta Was this translation helpful? Give feedback.
All reactions