@samitouri / QOS-React-2 / commits / 4ef8865120

Fix externalization of 'lowPriorityWarning' in fb builds (#9790)

**what is the change?:** - Add two more special cases for 'lowPriorityWarning' in 'modules.js', treating it the same as 'ReactCurrentOwner'. **why make this change?:** Without this, the build was including 'lowPriorityWarning' seemingly both as an external module and as part of the bundle. **test plan:** Ran `yarn build` and inspected the `React-dev` build. `lowPriorityWarning` did not get bundled in this time. **issue:** None yet - @gaearon flagged this for me directly.

Flarnie Marchan committed May 26, 2017 at 10:35 UTC 4ef8865120d9fe52d614ed731356ff07ccc172ce
2 files changed +10 -8
scripts/rollup/modules.js
+4 -2
@@ -78,10 +78,11 @@ function createModuleMap(paths, extractErrors, bundleType) {
78 moduleMap[moduleName] = resolve(file);
79 });
80 });
81 - // if this is FB, we want to remove ReactCurrentOwner, so we can
82 - // handle it with a different case
81 + // if this is FB, we want to remove ReactCurrentOwner and lowPriorityWarning,
82 + // so we can handle it with a different case
83 if (bundleType === FB_DEV || bundleType === FB_PROD) {
84 delete moduleMap.ReactCurrentOwner;
85 + delete moduleMap.lowPriorityWarning;
86 }
87 return moduleMap;
88 }
@@ -120,6 +121,7 @@ function ignoreFBModules() {
121 // In FB bundles, we preserve an inline require to ReactCurrentOwner.
122 // See the explanation in FB version of ReactCurrentOwner in www:
123 'ReactCurrentOwner',
124 + 'lowPriorityWarning',
125 ];
126 }
127
scripts/rollup/results.json
+6 -6
@@ -41,16 +41,16 @@
41 "gzip": 3614
42 },
43 "React-dev.js (FB_DEV)": {
44 - "size": 74115,
45 - "gzip": 18980
44 + "size": 71806,
45 + "gzip": 18233
46 },
47 "React-prod.js (FB_PROD)": {
48 - "size": 36847,
49 - "gzip": 9254
48 + "size": 36172,
49 + "gzip": 9226
50 },
51 "ReactDOMStack-dev.js (FB_DEV)": {
52 - "size": 497678,
53 - "gzip": 119007
52 + "size": 495315,
53 + "gzip": 118265
54 },
55 "ReactDOMStack-prod.js (FB_PROD)": {
56 "size": 353140,