@samitouri / QOS-React / commits / 3a44ccefed

Fix feature flags react-dom/unstable-new-scheduler (#15309)

I forgot to account for the CommonJS builds. (I had this change in my local checkout but accidentally didn't commit it.)

Andrew Clark committed Apr 3, 2019 at 10:36 UTC 3a44ccefeda8cfa19482c8a3a4480a83cae6c2ae
2 files changed +17 -3
scripts/rollup/bundles.js
+1
@@ -118,6 +118,7 @@ const bundles = [
118 FB_WWW_PROFILING,
119 NODE_DEV,
120 NODE_PROD,
121 + NODE_PROFILING,
122 ],
123 moduleType: RENDERER,
124 entry: 'react-dom/unstable-new-scheduler',
scripts/rollup/forks.js
+16 -3
@@ -7,6 +7,9 @@ const inlinedHostConfigs = require('../shared/inlinedHostConfigs');
7 const UMD_DEV = bundleTypes.UMD_DEV;
8 const UMD_PROD = bundleTypes.UMD_PROD;
9 const UMD_PROFILING = bundleTypes.UMD_PROFILING;
10 +const NODE_DEV = bundleTypes.NODE_DEV;
11 +const NODE_PROD = bundleTypes.NODE_PROD;
12 +const NODE_PROFILING = bundleTypes.NODE_PROFILING;
13 const FB_WWW_DEV = bundleTypes.FB_WWW_DEV;
14 const FB_WWW_PROD = bundleTypes.FB_WWW_PROD;
15 const FB_WWW_PROFILING = bundleTypes.FB_WWW_PROFILING;
@@ -69,10 +72,20 @@ const forks = Object.freeze({
72 'shared/ReactFeatureFlags': (bundleType, entry) => {
73 switch (entry) {
74 case 'react-dom/unstable-new-scheduler': {
72 - if (entry === 'react-dom/unstable-new-scheduler') {
73 - return 'shared/forks/ReactFeatureFlags.www-new-scheduler.js';
75 + switch (bundleType) {
76 + case FB_WWW_DEV:
77 + case FB_WWW_PROD:
78 + case FB_WWW_PROFILING:
79 + return 'shared/forks/ReactFeatureFlags.www-new-scheduler.js';
80 + case NODE_DEV:
81 + case NODE_PROD:
82 + case NODE_PROFILING:
83 + return 'shared/forks/ReactFeatureFlags.new-scheduler.js';
84 + default:
85 + throw Error(
86 + `Unexpected entry (${entry}) and bundleType (${bundleType})`
87 + );
88 }
75 - return null;
89 }
90 case 'react-native-renderer':
91 switch (bundleType) {