strip proptypes in production build (fixes #1882)#2003
strip proptypes in production build (fixes #1882)#2003JedWatson merged 1 commit intoJedWatson:masterfrom
Conversation
|
I guess we need to replace |
|
And what should happen to |
fb33957 to
a6b023a
Compare
|
Hi @jochenberger thank you for the PR, instead of putting the |
yes please 🙂 |
|
I'm not so sure. Don't we want to have the checks in the |
JedWatson
left a comment
There was a problem hiding this comment.
I think that it's not safe to have if (process.env.NODE_ENV !== 'production') anywhere other than in src. We can't guarantee anything about the environment the code may be run in now or in the future, which doing so breaks.
I don't think there's any concern having proptypes in place in a node environment, if the consumer requires the lib entry. React ignores proptypes in production anyway so this is only an optimisation for client-side package size.
Given the consistency of other major packages using babel-plugin-transform-react-remove-prop-types I think that's the way to go, and let's not introduce environment specific code in our source that we don't need to (I'm happy to follow react-router's configuration for this in terms of which builds to apply the plugin to)
|
Please update to use |
a6b023a to
5da115a
Compare
|
Done. Now the only file size change is |
|
Neat, thanks @jochenberger! |
File size changes:
See also #1876.