Skip to content

Commit

Permalink
Add dynamic disableModulePatternComponents flag for native-fb
Browse files Browse the repository at this point in the history
  • Loading branch information
kassens committed Nov 22, 2023
1 parent bbb9cb1 commit e9c785a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import typeof * as DynamicFlagsType from 'ReactNativeInternalFeatureFlags';
// flag here but it won't be set to `true` in any of our test runs. Need to
// update the test configuration.

export const enableUseRefAccessWarning = __VARIANT__;
export const alwaysThrottleRetries = __VARIANT__;
export const disableModulePatternComponents = __VARIANT__;
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
export const enableUnifiedSyncLane = __VARIANT__;
export const alwaysThrottleRetries = __VARIANT__;
export const useMicrotasksForSchedulingInFabric = __VARIANT__;
export const enableUseRefAccessWarning = __VARIANT__;
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
export const useMicrotasksForSchedulingInFabric = __VARIANT__;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): DynamicFlagsType): ExportsType);
8 changes: 4 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import * as dynamicFlags from 'ReactNativeInternalFeatureFlags';
// We destructure each value before re-exporting to avoid a dynamic look-up on
// the exports object every time a flag is read.
export const {
enableUseRefAccessWarning,
alwaysThrottleRetries,
disableModulePatternComponents,
enableDeferRootSchedulingToMicrotask,
enableUnifiedSyncLane,
alwaysThrottleRetries,
useMicrotasksForSchedulingInFabric,
enableUseRefAccessWarning,
passChildrenWhenCloningPersistedNodes,
useMicrotasksForSchedulingInFabric,
} = dynamicFlags;

// The rest of the flags are static for better dead code elimination.
Expand Down Expand Up @@ -55,7 +56,6 @@ export const enableSuspenseCallback = false;
export const disableLegacyContext = false;
export const enableTrustedTypesIntegration = false;
export const disableTextareaChildren = false;
export const disableModulePatternComponents = false;
export const enableSuspenseAvoidThisFallback = false;
export const enableSuspenseAvoidThisFallbackFizz = false;
export const enableCPUSuspense = true;
Expand Down
7 changes: 4 additions & 3 deletions scripts/flow/xplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
*/

declare module 'ReactNativeInternalFeatureFlags' {
declare export var enableUseRefAccessWarning: boolean;
declare export var alwaysThrottleRetries: boolean;
declare export var disableModulePatternComponents: boolean;
declare export var enableDeferRootSchedulingToMicrotask: boolean;
declare export var enableUnifiedSyncLane: boolean;
declare export var alwaysThrottleRetries: boolean;
declare export var useMicrotasksForSchedulingInFabric: boolean;
declare export var enableUseRefAccessWarning: boolean;
declare export var passChildrenWhenCloningPersistedNodes: boolean;
declare export var useMicrotasksForSchedulingInFabric: boolean;
}

0 comments on commit e9c785a

Please sign in to comment.