Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup for aligning React Native Feature Flags #28425

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ 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 enableUseRefAccessWarning = __VARIANT__;
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
export const useMicrotasksForSchedulingInFabric = __VARIANT__;
export const useModernStrictMode = __VARIANT__;

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

// The rest of the flags are static for better dead code elimination.
Expand All @@ -36,7 +41,7 @@ export const enableProfilerCommitHooks = __PROFILE__;
export const enableProfilerNestedUpdatePhase = __PROFILE__;
export const enableProfilerNestedUpdateScheduledHook = false;
export const enableUpdaterTracking = __PROFILE__;
export const enableCache = false;
export const enableCache = true;
export const enableLegacyCache = false;
export const enableCacheElement = true;
export const enableFetchInstrumentation = false;
Expand Down Expand Up @@ -66,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 @@ -78,25 +82,20 @@ export const enableLazyContextPropagation = false;
export const enableLegacyHidden = false;
export const forceConcurrentByDefaultForTesting = false;
export const allowConcurrentByDefault = false;
export const enableCustomElementPropertySupport = false;

export const consoleManagedByDevToolsDuringStrictMode = false;
export const enableCustomElementPropertySupport = true;

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 enableUseDeferredValueInitialArg = __EXPERIMENTAL__;
export const disableClientCache = true;

export const enableServerComponentKeys = true;
export const enableServerComponentLogs = true;
export const enableInfiniteRenderLoopDetection = false;

// TODO: Roll out with GK. Don't keep as dynamic flag for too long, though,
// because JSX is an extremely hot path.
Expand Down
8 changes: 4 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import typeof * as ExportsType from './ReactFeatureFlags.native-oss';
export const debugRenderPhaseSideEffectsForStrictMode = __DEV__;
export const enableDebugTracing = false;
export const enableAsyncDebugInfo = false;
export const enableSchedulingProfiler = false;
export const enableSchedulingProfiler = __PROFILE__;
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
export const enableProfilerTimer = __PROFILE__;
export const enableProfilerCommitHooks = __PROFILE__;
export const enableProfilerNestedUpdatePhase = __PROFILE__;
export const enableProfilerNestedUpdateScheduledHook = false;
export const enableUpdaterTracking = __PROFILE__;
export const enableCache = false;
export const enableCache = true;
export const enableLegacyCache = false;
export const enableCacheElement = true;
export const enableFetchInstrumentation = false;
Expand All @@ -35,7 +35,7 @@ export const disableIEWorkarounds = true;
export const enableScopeAPI = false;
export const enableCreateEventHandleAPI = false;
export const enableSuspenseCallback = false;
export const disableLegacyContext = false;
export const disableLegacyContext = true;
export const enableTrustedTypesIntegration = false;
export const disableTextareaChildren = false;
export const disableModulePatternComponents = false;
Expand Down Expand Up @@ -64,7 +64,7 @@ export const enableLegacyHidden = false;
export const forceConcurrentByDefaultForTesting = false;
export const enableUnifiedSyncLane = true;
export const allowConcurrentByDefault = false;
export const enableCustomElementPropertySupport = false;
export const enableCustomElementPropertySupport = true;

export const consoleManagedByDevToolsDuringStrictMode = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import typeof * as ExportsType from './ReactFeatureFlags.test-renderer';
export const debugRenderPhaseSideEffectsForStrictMode = false;
export const enableDebugTracing = false;
export const enableAsyncDebugInfo = false;
export const enableSchedulingProfiler = false;
export const enableSchedulingProfiler = __PROFILE__;
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
export const enableProfilerTimer = __PROFILE__;
export const enableProfilerCommitHooks = __PROFILE__;
Expand All @@ -35,7 +35,7 @@ export const disableIEWorkarounds = true;
export const enableScopeAPI = false;
export const enableCreateEventHandleAPI = false;
export const enableSuspenseCallback = false;
export const disableLegacyContext = false;
export const disableLegacyContext = true; // TODO: Verify safety of enabling.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to make this dynamic

export const enableTrustedTypesIntegration = false;
export const disableTextareaChildren = false;
export const disableModulePatternComponents = false;
Expand Down Expand Up @@ -64,6 +64,7 @@ export const enableLegacyHidden = false;
export const forceConcurrentByDefaultForTesting = false;
export const enableUnifiedSyncLane = true;
export const allowConcurrentByDefault = true;
export const enableCustomElementPropertySupport = true;

export const consoleManagedByDevToolsDuringStrictMode = false;

Expand Down
5 changes: 5 additions & 0 deletions scripts/flow/xplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@

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 enableUseRefAccessWarning: boolean;
declare export var passChildrenWhenCloningPersistedNodes: boolean;
declare export var useMicrotasksForSchedulingInFabric: boolean;
declare export var useModernStrictMode: boolean;
}