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 was examining my application bundles after adding microstates, and noticed that invariant was adding nearly a KB, since it is used by funcadelic.
I see the value in having that during development, but for production builds it would be nice to remove/tree-shake it away.
I see the rollup file will already do replacements for process.env.NODE_ENV, so could the code be wrapped up inside an if (process.env.NODE_ENV !== 'production') { ... } block?
EDIT: I know this seems fiddly and trivial in the grand scheme, but I was a bit surprised by the actual size of adding microstates, since bundlephobia's figure does not include funcadelic.
The text was updated successfully, but these errors were encountered:
No worries! I finally remembered to circle back to this.
I'm curious why you do not currently produce any minified builds?
I did some research into what other libraries do with invariant, and a popular alternative is tiny-invariant, combined with babel-plugin-dev-expression to strip the string messages in production builds. I'll submit a PR shortly.
I was examining my application bundles after adding
microstates
, and noticed thatinvariant
was adding nearly a KB, since it is used byfuncadelic
.I see the value in having that during development, but for production builds it would be nice to remove/tree-shake it away.
I see the rollup file will already do replacements for
process.env.NODE_ENV
, so could the code be wrapped up inside anif (process.env.NODE_ENV !== 'production') { ... }
block?EDIT: I know this seems fiddly and trivial in the grand scheme, but I was a bit surprised by the actual size of adding
microstates
, since bundlephobia's figure does not includefuncadelic
.The text was updated successfully, but these errors were encountered: