Read debugRenderPhaseSideEffects from GK (#11603)
* Forked ReactFeatureFlags for React Native to enable debugRenderPhaseSideEffects GK * Changed debugRenderPhaseSideEffects in www feature flags to be runtime as well
Brian Vaughn committed
Nov 20, 2017 at 14:05 UTC
dbf715c958ca43cbcf47d5e3c69e76d6123eb142
3 files changed
+39
-1
packages/react-native-renderer/src/ReactNativeFeatureFlags.js
new
+37
@@ -0,0 +1,37 @@
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 'fbjs/lib/invariant';
11
+
12
+import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
13
+import typeof * as FeatureFlagsShimType from './ReactNativeFeatureFlags';
14
+
15
+// Re-export dynamic flags from the fbsource version.
16
+export const {debugRenderPhaseSideEffects} = require('ReactFeatureFlags');
17
+
18
+// The rest of the flags are static for better dead code elimination.
19
+export const enableAsyncSubtreeAPI = true;
20
+export const enableAsyncSchedulingByDefaultInReactDOM = false;
21
+export const enableReactFragment = false;
22
+export const enableCreateRoot = false;
23
+export const enableUserTimingAPI = __DEV__;
24
+export const enableMutatingReconciler = true;
25
+export const enableNoopReconciler = false;
26
+export const enablePersistentReconciler = false;
27
+
28
+// Only used in www builds.
29
+export function addUserTimingListener() {
30
+ invariant(false, 'Not implemented.');
31
+}
32
+
33
+// Flow magic to verify the exports of this file match the original version.
34
+// eslint-disable-next-line no-unused-vars
35
+type Check<_X, Y: _X, X: Y = _X> = null;
36
+// eslint-disable-next-line no-unused-expressions
37
+(null: Check<FeatureFlagsShimType, FeatureFlagsType>);
scripts/rollup/bundles.js
+1
@@ -129,6 +129,7 @@ const bundles = [
129
'deepFreezeAndThrowOnMutationInDev',
130
'flattenStyle',
131
],
132
+ featureFlags: 'react-native-renderer/src/ReactNativeFeatureFlags',
133
},
134
135
/******* React Native RT *******/
scripts/rollup/shims/rollup/ReactFeatureFlags-www.js
+1
-1
@@ -12,11 +12,11 @@ import typeof * as FeatureFlagsShimType from './ReactFeatureFlags-www';
12
13
// Re-export dynamic flags from the www version.
14
export const {
15
+ debugRenderPhaseSideEffects,
16
enableAsyncSchedulingByDefaultInReactDOM,
17
} = require('ReactFeatureFlags');
18
19
// The rest of the flags are static for better dead code elimination.
19
-export const debugRenderPhaseSideEffects = false;
20
export const enableAsyncSubtreeAPI = true;
21
export const enableReactFragment = false;
22
export const enableCreateRoot = true;