create a new FeatureFlags file for test renderer on www (#13159)
Chang Yan committed
Jul 6, 2018 at 12:55 UTC
449f6ddd5c075da965ec430015c66977c38db8d3
2 files changed
+40
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
new
+34
@@ -0,0 +1,34 @@
1
+/**
2
+ * Copyright (c) 2013-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+import invariant from 'shared/invariant';
11
+
12
+import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
13
+import typeof * as PersistentFeatureFlagsType from './ReactFeatureFlags.persistent';
14
+
15
+export const debugRenderPhaseSideEffects = false;
16
+export const debugRenderPhaseSideEffectsForStrictMode = false;
17
+export const enableUserTimingAPI = __DEV__;
18
+export const enableGetDerivedStateFromCatch = false;
19
+export const enableSuspense = true;
20
+export const warnAboutDeprecatedLifecycles = false;
21
+export const warnAboutLegacyContextAPI = false;
22
+export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
23
+export const enableProfilerTimer = false;
24
+
25
+// Only used in www builds.
26
+export function addUserTimingListener() {
27
+ invariant(false, 'Not implemented.');
28
+}
29
+
30
+// Flow magic to verify the exports of this file match the original version.
31
+// eslint-disable-next-line no-unused-vars
32
+type Check<_X, Y: _X, X: Y = _X> = null;
33
+// eslint-disable-next-line no-unused-expressions
34
+(null: Check<PersistentFeatureFlagsType, FeatureFlagsType>);
scripts/rollup/forks.js
+6
@@ -74,6 +74,12 @@ const forks = Object.freeze({
74
case 'react-reconciler/persistent':
75
return 'shared/forks/ReactFeatureFlags.persistent.js';
76
case 'react-test-renderer':
77
+ switch (bundleType) {
78
+ case FB_WWW_DEV:
79
+ case FB_WWW_PROD:
80
+ case FB_WWW_PROFILING:
81
+ return 'shared/forks/ReactFeatureFlags.test-renderer.www.js';
82
+ }
83
return 'shared/forks/ReactFeatureFlags.test-renderer.js';
84
default:
85
switch (bundleType) {