Skip to content

Commit b764450

Browse files
bvaughnraphamorim
authored andcommitted
Read debugRenderPhaseSideEffects from GK (facebook#11603)
* Forked ReactFeatureFlags for React Native to enable debugRenderPhaseSideEffects GK * Changed debugRenderPhaseSideEffects in www feature flags to be runtime as well
1 parent 0764dec commit b764450

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ const bundles = [
129129
'deepFreezeAndThrowOnMutationInDev',
130130
'flattenStyle',
131131
],
132+
featureFlags: 'react-native-renderer/src/ReactNativeFeatureFlags',
132133
},
133134

134135
/******* React Native RT *******/

scripts/rollup/shims/rollup/ReactFeatureFlags-www.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import typeof * as FeatureFlagsShimType from './ReactFeatureFlags-www';
1212

1313
// Re-export dynamic flags from the www version.
1414
export const {
15+
debugRenderPhaseSideEffects,
1516
enableAsyncSchedulingByDefaultInReactDOM,
1617
} = require('ReactFeatureFlags');
1718

1819
// The rest of the flags are static for better dead code elimination.
19-
export const debugRenderPhaseSideEffects = false;
2020
export const enableAsyncSubtreeAPI = true;
2121
export const enableReactFragment = false;
2222
export const enableCreateRoot = true;

0 commit comments

Comments
 (0)