Skip to content

Commit

Permalink
Configure Dynamic Feature Flags for React Native (facebook#28527)
Browse files Browse the repository at this point in the history
## Summary

This PR is a subset of facebook#28425,
which only includes the feature flags that will be configured as
dynamic.

The following list summarizes the feature flag changes:

* RN FB
  * Change to Dynamic
    * consoleManagedByDevToolsDuringStrictMode
    * enableAsyncActions
    * enableDeferRootSchedulingToMicrotask
    * enableRenderableContext
    * useModernStrictMode

## How did you test this change?

Ran the following successfully:

```
$ yarn test
$ yarn flow native
$ yarn flow fabric
```
  • Loading branch information
yungsters authored and AndyPengc12 committed Apr 15, 2024
1 parent f8aa5c6 commit feaaccc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
8 changes: 6 additions & 2 deletions packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ import typeof * as DynamicFlagsType from 'ReactNativeInternalFeatureFlags';
// update the test configuration.

export const alwaysThrottleRetries = __VARIANT__;
export const consoleManagedByDevToolsDuringStrictMode = __VARIANT__;
export const enableAsyncActions = __VARIANT__;
export const enableComponentStackLocations = __VARIANT__;
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
export const enableInfiniteRenderLoopDetection = __VARIANT__;
export const enableRenderableContext = __VARIANT__;
export const enableUnifiedSyncLane = __VARIANT__;
export const enableUseRefAccessWarning = __VARIANT__;
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
export const useMicrotasksForSchedulingInFabric = __VARIANT__;
export const enableUnifiedSyncLane = __VARIANT__;
export const enableInfiniteRenderLoopDetection = __VARIANT__;
export const useModernStrictMode = __VARIANT__;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): DynamicFlagsType): ExportsType);
13 changes: 6 additions & 7 deletions packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ import * as dynamicFlags from 'ReactNativeInternalFeatureFlags';
// the exports object every time a flag is read.
export const {
alwaysThrottleRetries,
consoleManagedByDevToolsDuringStrictMode,
enableAsyncActions,
enableComponentStackLocations,
enableDeferRootSchedulingToMicrotask,
enableInfiniteRenderLoopDetection,
enableRenderableContext,
enableUnifiedSyncLane,
enableUseRefAccessWarning,
passChildrenWhenCloningPersistedNodes,
useMicrotasksForSchedulingInFabric,
enableUnifiedSyncLane,
enableInfiniteRenderLoopDetection,
useModernStrictMode,
} = dynamicFlags;

// The rest of the flags are static for better dead code elimination.
Expand Down Expand Up @@ -67,7 +71,6 @@ export const enableClientRenderFallbackOnTextMismatch = true;
export const enableLegacyFBSupport = false;
export const enableFilterEmptyStringAttributesDOM = true;
export const enableGetInspectorDataForInstanceInProduction = true;
export const enableRenderableContext = false;

export const enableRetryLaneExpiration = false;
export const retryLaneExpirationMs = 5000;
Expand All @@ -81,17 +84,13 @@ export const forceConcurrentByDefaultForTesting = false;
export const allowConcurrentByDefault = false;
export const enableCustomElementPropertySupport = true;

export const consoleManagedByDevToolsDuringStrictMode = false;

export const enableTransitionTracing = false;

export const enableFloat = true;

export const useModernStrictMode = false;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFizzExternalRuntime = true;

export const enableAsyncActions = false;
export const enableUseDeferredValueInitialArg = true;
export const disableClientCache = true;

Expand Down
8 changes: 6 additions & 2 deletions scripts/flow/xplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@

declare module 'ReactNativeInternalFeatureFlags' {
declare export var alwaysThrottleRetries: boolean;
declare export var consoleManagedByDevToolsDuringStrictMode: boolean;
declare export var enableAsyncActions: boolean;
declare export var enableComponentStackLocations: boolean;
declare export var enableDeferRootSchedulingToMicrotask: boolean;
declare export var enableInfiniteRenderLoopDetection: boolean;
declare export var enableRenderableContext: boolean;
declare export var enableUnifiedSyncLane: boolean;
declare export var enableUseRefAccessWarning: boolean;
declare export var passChildrenWhenCloningPersistedNodes: boolean;
declare export var useMicrotasksForSchedulingInFabric: boolean;
declare export var enableUnifiedSyncLane: boolean;
declare export var enableInfiniteRenderLoopDetection: boolean;
declare export var useModernStrictMode: boolean;
}

0 comments on commit feaaccc

Please sign in to comment.