mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add a feature flag to enable expiration of retry lanes (#27694)
An attempt to see if we can bring back expiration of retry lanes to avoid cases resolving Suspense can be starved by frequent updates. In the past, this caused increase browser crashes, but a lot of time has passed since then. Just trying if we can re-enable this. Old PR that reverted adding the timeout: https://github.com/facebook/react/pull/21300
This commit is contained in:
+4
-3
@@ -19,11 +19,12 @@ export type Lane = number;
|
||||
export type LaneMap<T> = Array<T>;
|
||||
|
||||
import {
|
||||
enableSchedulingProfiler,
|
||||
enableUpdaterTracking,
|
||||
allowConcurrentByDefault,
|
||||
enableRetryLaneExpiration,
|
||||
enableSchedulingProfiler,
|
||||
enableTransitionTracing,
|
||||
enableUnifiedSyncLane,
|
||||
enableUpdaterTracking,
|
||||
} from 'shared/ReactFeatureFlags';
|
||||
import {isDevToolsPresent} from './ReactFiberDevToolsHook';
|
||||
import {ConcurrentUpdatesByDefaultMode, NoMode} from './ReactTypeOfMode';
|
||||
@@ -383,7 +384,7 @@ function computeExpirationTime(lane: Lane, currentTime: number) {
|
||||
// crashes. There must be some other underlying bug; not super urgent but
|
||||
// ideally should figure out why and fix it. Unfortunately we don't have
|
||||
// a repro for the crashes, only detected via production metrics.
|
||||
return NoTimestamp;
|
||||
return enableRetryLaneExpiration ? currentTime + 5000 : NoTimestamp;
|
||||
case SelectiveHydrationLane:
|
||||
case IdleHydrationLane:
|
||||
case IdleLane:
|
||||
|
||||
@@ -128,6 +128,11 @@ export const passChildrenWhenCloningPersistedNodes = false;
|
||||
|
||||
export const enableUseDeferredValueInitialArg = __EXPERIMENTAL__;
|
||||
|
||||
/**
|
||||
* Enables an expiration time for retry lanes to avoid starvation.
|
||||
*/
|
||||
export const enableRetryLaneExpiration = false;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Chopping Block
|
||||
//
|
||||
|
||||
@@ -66,6 +66,7 @@ export const enableComponentStackLocations = false;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableGetInspectorDataForInstanceInProduction = true;
|
||||
export const enableRetryLaneExpiration = false;
|
||||
|
||||
export const createRootStrictEffectsByDefault = false;
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ export const enableComponentStackLocations = false;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableGetInspectorDataForInstanceInProduction = false;
|
||||
export const enableRetryLaneExpiration = false;
|
||||
|
||||
export const createRootStrictEffectsByDefault = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
@@ -49,6 +49,7 @@ export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableGetInspectorDataForInstanceInProduction = false;
|
||||
export const enableRetryLaneExpiration = false;
|
||||
|
||||
export const createRootStrictEffectsByDefault = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
@@ -51,6 +51,7 @@ export const enableUseEffectEventHook = false;
|
||||
export const enableClientRenderFallbackOnTextMismatch = true;
|
||||
export const createRootStrictEffectsByDefault = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
export const enableRetryLaneExpiration = false;
|
||||
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
export const enableLazyContextPropagation = false;
|
||||
|
||||
@@ -49,6 +49,7 @@ export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = true;
|
||||
export const enableGetInspectorDataForInstanceInProduction = false;
|
||||
export const enableRetryLaneExpiration = false;
|
||||
|
||||
export const createRootStrictEffectsByDefault = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
@@ -29,6 +29,7 @@ export const enableAsyncActions = __VARIANT__;
|
||||
export const alwaysThrottleRetries = __VARIANT__;
|
||||
export const enableDO_NOT_USE_disableStrictPassiveEffect = __VARIANT__;
|
||||
export const enableUseDeferredValueInitialArg = __VARIANT__;
|
||||
export const enableRetryLaneExpiration = __VARIANT__;
|
||||
|
||||
// Enable this flag to help with concurrent mode debugging.
|
||||
// It logs information to the console about React scheduling, rendering, and commit phases.
|
||||
|
||||
@@ -24,6 +24,7 @@ export const {
|
||||
enableUseRefAccessWarning,
|
||||
enableLazyContextPropagation,
|
||||
enableUnifiedSyncLane,
|
||||
enableRetryLaneExpiration,
|
||||
enableTransitionTracing,
|
||||
enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask,
|
||||
|
||||
Reference in New Issue
Block a user