Skip to content

Commit

Permalink
Add throttleDisappearingFallbacks Flag
Browse files Browse the repository at this point in the history
  • Loading branch information
yungsters committed Mar 12, 2024
1 parent d469891 commit 314e8b5
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberCommitWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ import {
enableUseEffectEventHook,
enableFloat,
enableLegacyHidden,
alwaysThrottleRetries,
disableStringRefs,
throttleDisappearingFallbacks,
} from 'shared/ReactFeatureFlags';
import {
FunctionComponent,
Expand Down Expand Up @@ -2896,7 +2896,7 @@ function commitMutationEffectsOnFiber(
current !== null &&
(current.memoizedState: SuspenseState | null) !== null;

if (alwaysThrottleRetries) {
if (throttleDisappearingFallbacks) {
if (isShowingFallback !== wasShowingFallback) {
// A fallback is either appearing or disappearing.
markCommitTimeOfFallback();
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export const enableFizzExternalRuntime = true;

export const alwaysThrottleRetries = true;

export const throttleDisappearingFallbacks = true;

export const useMicrotasksForSchedulingInFabric = false;

export const passChildrenWhenCloningPersistedNodes = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const enableRenderableContext = __VARIANT__;
export const enableUnifiedSyncLane = __VARIANT__;
export const enableUseRefAccessWarning = __VARIANT__;
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
export const throttleDisappearingFallbacks = __VARIANT__;
export const useMicrotasksForSchedulingInFabric = __VARIANT__;
export const useModernStrictMode = __VARIANT__;

Expand Down
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const {
enableUnifiedSyncLane,
enableUseRefAccessWarning,
passChildrenWhenCloningPersistedNodes,
throttleDisappearingFallbacks,
useMicrotasksForSchedulingInFabric,
useModernStrictMode,
} = dynamicFlags;
Expand Down
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const enableInfiniteRenderLoopDetection = false;
export const enableAsyncActions = false;

export const alwaysThrottleRetries = false;
export const throttleDisappearingFallbacks = false;

export const useMicrotasksForSchedulingInFabric = false;
export const passChildrenWhenCloningPersistedNodes = false;
Expand Down
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const enableDeferRootSchedulingToMicrotask = true;
export const enableAsyncActions = true;

export const alwaysThrottleRetries = true;
export const throttleDisappearingFallbacks = true;

export const useMicrotasksForSchedulingInFabric = false;
export const passChildrenWhenCloningPersistedNodes = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const enableDeferRootSchedulingToMicrotask = false;
export const enableAsyncActions = true;

export const alwaysThrottleRetries = true;
export const throttleDisappearingFallbacks = true;

export const useMicrotasksForSchedulingInFabric = false;
export const passChildrenWhenCloningPersistedNodes = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const enableDeferRootSchedulingToMicrotask = true;
export const enableAsyncActions = true;

export const alwaysThrottleRetries = true;
export const throttleDisappearingFallbacks = true;

export const useMicrotasksForSchedulingInFabric = false;
export const passChildrenWhenCloningPersistedNodes = false;
Expand Down
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.www-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const enableUnifiedSyncLane = __VARIANT__;
export const enableTransitionTracing = __VARIANT__;
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
export const alwaysThrottleRetries = __VARIANT__;
export const throttleDisappearingFallbacks = __VARIANT__;
export const enableDO_NOT_USE_disableStrictPassiveEffect = __VARIANT__;
export const enableUseDeferredValueInitialArg = __VARIANT__;
export const enableRenderableContext = __VARIANT__;
Expand Down
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const {
enableTransitionTracing,
enableDeferRootSchedulingToMicrotask,
alwaysThrottleRetries,
throttleDisappearingFallbacks,
enableDO_NOT_USE_disableStrictPassiveEffect,
disableSchedulerTimeoutInWorkLoop,
enableUseDeferredValueInitialArg,
Expand Down
1 change: 1 addition & 0 deletions scripts/flow/xplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ declare module 'ReactNativeInternalFeatureFlags' {
declare export var enableUnifiedSyncLane: boolean;
declare export var enableUseRefAccessWarning: boolean;
declare export var passChildrenWhenCloningPersistedNodes: boolean;
declare export var throttleDisappearingFallbacks: boolean;
declare export var useMicrotasksForSchedulingInFabric: boolean;
declare export var useModernStrictMode: boolean;
}

0 comments on commit 314e8b5

Please sign in to comment.