Skip to content

Commit 36b078c

Browse files
authored
unify feature flags between fb and oss for React Native renderer (#28269)
# Affected flags: ### alwaysThrottleRetries In RN OSS changed from `true` to `false`. This is what FB build uses. This flag was a root cause for big perf regression internally. ### enableDeferRootSchedulingToMicrotask In RN OSS build changed from `true` to `false`. This is what FB build uses. ### debugRenderPhaseSideEffectsForStrictMode Changed from true to __DEV__ in FB and OSS build. The flag is only used in debug builds and was previously `false` in RN OSS builds ### enableUnifiedSyncLane Changed from `__VARIANT__` to `true` in FB build. This is what OSS build uses. This flag is shipped internally. cc @tyao1 ### enableLegacyHidden In RN FB changed from `true` to `false`. This is what OSS uses. ### allowConcurrentByDefault In RN FB changed from `true` to `false`. I ran `yarn flags --diff rn rn-fb` to get the difference between feature flags and unify them. ## Before ``` yarn run v1.22.19 $ node ./scripts/flags/flags.js --diff rn rn-fb ┌───────────────────────────────────────────────┬────────┬───────┐ │ (index) │ RN OSS │ RN FB │ ├───────────────────────────────────────────────┼────────┼───────┤ │ allowConcurrentByDefault │ '❌' │ '✅' │ │ debugRenderPhaseSideEffectsForStrictMode │ '❌' │ '✅' │ │ disableModulePatternComponents │ '❌' │ '✅' │ │ enableCPUSuspense │ '❌' │ '✅' │ │ enableCacheElement │ '❌' │ '✅' │ │ enableGetInspectorDataForInstanceInProduction │ '❌' │ '✅' │ │ enableLegacyHidden │ '❌' │ '✅' │ │ enableSchedulingProfiler │ '❌' │ '📊' │ │ enableUseDeferredValueInitialArg │ '❌' │ '✅' │ │ enableUseMemoCacheHook │ '❌' │ '✅' │ │ enableUseRefAccessWarning │ '❌' │ '🧪' │ │ passChildrenWhenCloningPersistedNodes │ '❌' │ '🧪' │ │ useMicrotasksForSchedulingInFabric │ '❌' │ '🧪' │ │ alwaysThrottleRetries │ '✅' │ '🧪' │ │ enableDeferRootSchedulingToMicrotask │ '✅' │ '🧪' │ │ enableUnifiedSyncLane │ '✅' │ '🧪' │ └───────────────────────────────────────────────┴────────┴───────┘ ``` ## After ``` yarn run v1.22.19 $ node ./scripts/flags/flags.js --diff rn rn-fb ┌───────────────────────────────────────────────┬────────┬───────┐ │ (index) │ RN OSS │ RN FB │ ├───────────────────────────────────────────────┼────────┼───────┤ │ alwaysThrottleRetries │ '❌' │ '🧪' │ │ disableModulePatternComponents │ '❌' │ '✅' │ │ enableCPUSuspense │ '❌' │ '✅' │ │ enableCacheElement │ '❌' │ '✅' │ │ enableDeferRootSchedulingToMicrotask │ '❌' │ '🧪' │ │ enableGetInspectorDataForInstanceInProduction │ '❌' │ '✅' │ │ enableSchedulingProfiler │ '❌' │ '📊' │ │ enableUseDeferredValueInitialArg │ '❌' │ '✅' │ │ enableUseMemoCacheHook │ '❌' │ '✅' │ │ enableUseRefAccessWarning │ '❌' │ '🧪' │ │ passChildrenWhenCloningPersistedNodes │ '❌' │ '🧪' │ │ useMicrotasksForSchedulingInFabric │ '❌' │ '🧪' │ └───────────────────────────────────────────────┴────────┴───────┘ ```
1 parent ba5e6a8 commit 36b078c

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import typeof * as DynamicFlagsType from 'ReactNativeInternalFeatureFlags';
2222

2323
export const alwaysThrottleRetries = __VARIANT__;
2424
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
25-
export const enableUnifiedSyncLane = __VARIANT__;
2625
export const enableUseRefAccessWarning = __VARIANT__;
2726
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
2827
export const useMicrotasksForSchedulingInFabric = __VARIANT__;

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import * as dynamicFlags from 'ReactNativeInternalFeatureFlags';
2020
export const {
2121
alwaysThrottleRetries,
2222
enableDeferRootSchedulingToMicrotask,
23-
enableUnifiedSyncLane,
2423
enableUseRefAccessWarning,
2524
passChildrenWhenCloningPersistedNodes,
2625
useMicrotasksForSchedulingInFabric,
@@ -44,13 +43,14 @@ export const enableFormActions = true; // Doesn't affect Native
4443
export const enableBinaryFlight = true;
4544
export const enableTaint = true;
4645
export const enablePostpone = false;
47-
export const debugRenderPhaseSideEffectsForStrictMode = true;
46+
export const debugRenderPhaseSideEffectsForStrictMode = __DEV__;
4847
export const disableJavaScriptURLs = false;
4948
export const disableCommentsAsDOMContainers = true;
5049
export const disableInputAttributeSyncing = false;
5150
export const disableIEWorkarounds = true;
5251
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
5352
export const enableScopeAPI = false;
53+
export const enableUnifiedSyncLane = true;
5454
export const enableCreateEventHandleAPI = false;
5555
export const enableSuspenseCallback = false;
5656
export const disableLegacyContext = false;
@@ -74,9 +74,9 @@ export const transitionLaneExpirationMs = 5000;
7474

7575
export const disableSchedulerTimeoutInWorkLoop = false;
7676
export const enableLazyContextPropagation = false;
77-
export const enableLegacyHidden = true;
77+
export const enableLegacyHidden = false;
7878
export const forceConcurrentByDefaultForTesting = false;
79-
export const allowConcurrentByDefault = true;
79+
export const allowConcurrentByDefault = false;
8080
export const enableCustomElementPropertySupport = false;
8181

8282
export const consoleManagedByDevToolsDuringStrictMode = false;

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
1111
import typeof * as ExportsType from './ReactFeatureFlags.native-oss';
1212

13-
export const debugRenderPhaseSideEffectsForStrictMode = false;
13+
export const debugRenderPhaseSideEffectsForStrictMode = __DEV__;
1414
export const enableDebugTracing = false;
1515
export const enableAsyncDebugInfo = false;
1616
export const enableSchedulingProfiler = false;
@@ -74,11 +74,11 @@ export const enableFloat = true;
7474
export const useModernStrictMode = false;
7575
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
7676
export const enableFizzExternalRuntime = false;
77-
export const enableDeferRootSchedulingToMicrotask = true;
77+
export const enableDeferRootSchedulingToMicrotask = false;
7878

7979
export const enableAsyncActions = false;
8080

81-
export const alwaysThrottleRetries = true;
81+
export const alwaysThrottleRetries = false;
8282

8383
export const useMicrotasksForSchedulingInFabric = false;
8484
export const passChildrenWhenCloningPersistedNodes = false;

packages/shared/forks/ReactFeatureFlags.test-renderer.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const enableFloat = true;
7171

7272
export const useModernStrictMode = false;
7373
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
74-
export const enableDeferRootSchedulingToMicrotask = true;
74+
export const enableDeferRootSchedulingToMicrotask = false;
7575

7676
export const enableAsyncActions = true;
7777

scripts/flow/xplat.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
declare module 'ReactNativeInternalFeatureFlags' {
1111
declare export var alwaysThrottleRetries: boolean;
1212
declare export var enableDeferRootSchedulingToMicrotask: boolean;
13-
declare export var enableUnifiedSyncLane: boolean;
1413
declare export var enableUseRefAccessWarning: boolean;
1514
declare export var passChildrenWhenCloningPersistedNodes: boolean;
1615
declare export var useMicrotasksForSchedulingInFabric: boolean;

0 commit comments

Comments
 (0)