Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Convert the Source to ES Modules #11389
referenced this pull request
Oct 31, 2017
Nice work Dan! This is a big diff! Hope I didn't overlook something important.
Tests, lint, and Flow checks all pass locally. I also did a local sync to fbsource to quickly test the React Native renderer and didn't notice any obvious problems so...
I wondered about the impact on bundle size of converting conditional/DEV-only requires to imports, but it looks like this PR has a mostly positive impact on bundle size. There are a couple of small size increases but they seem to be primarily in test renderer and experimental packages.
I noticed lots of new warnings during
'default' is imported from external module '...' but never used
Looks like these are all coming from prod builds, for code that used to only be imported within a DEV conditional. It's unfortunate that this clutters up the output of build.
I also noticed in some cases the size before gzip decreased, but slightly increased after. Since gzip number isn’t that solid anyway (it depends on surrounding context) I wouldn’t worry too much about that.
Yeah. Basically CommonJS builds now include calls like