Move ReactElementValidator to __DEV__ block#6830
Conversation
|
Can you post the sizes before and after? I believe they should be printed when you run the build. |
It saves some more bytes in production mode.
|
@gaearon done above. |
|
@ruiaraujo updated the pull request. |
|
Looks good to me. Thanks! |
|
Wow, -600 bytes gzipped is great, thanks! |
|
@gaearon low hanging fruit is the best fruit. ;) |
|
Just coming around to this. This win is going to get lost internally at FB and in the future if we move to imports, both cases where dependencies are statically analyzed. It's not the only place we do this (IIRC) so it's totally cool to do, just wanted to fill in some backstory (and make sure other FB people understand). |
|
@zpao I totally broke my mind trying to parse your second sentence, can you rephrase please? 😄 |
|
I'm pretty sure we have another require() in dev blocks so it's ok to do here. I just wanted to reiterate that we only get the wins here and not at FB since requires are resolved statically. |
It saves some more bytes in production mode. (cherry picked from commit d955ee9)
It saves some more bytes in production mode. (cherry picked from commit d955ee9)
It saves some more bytes in production mode.