Remove revertRemovalOfSiblingPrerendering killswitch (#26549)
removal of sibling prerendering has been rolled out at Meta. We can delete the flag now.
This commit is contained in:
parent
8256781fdf
commit
7b0642bb98
|
@ -38,7 +38,6 @@ import {
|
||||||
enableCache,
|
enableCache,
|
||||||
enableTransitionTracing,
|
enableTransitionTracing,
|
||||||
useModernStrictMode,
|
useModernStrictMode,
|
||||||
revertRemovalOfSiblingPrerendering,
|
|
||||||
disableLegacyContext,
|
disableLegacyContext,
|
||||||
} from 'shared/ReactFeatureFlags';
|
} from 'shared/ReactFeatureFlags';
|
||||||
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
||||||
|
@ -2441,19 +2440,6 @@ function completeUnitOfWork(unitOfWork: Fiber): void {
|
||||||
// sibling. If there are no more siblings, return to the parent fiber.
|
// sibling. If there are no more siblings, return to the parent fiber.
|
||||||
let completedWork: Fiber = unitOfWork;
|
let completedWork: Fiber = unitOfWork;
|
||||||
do {
|
do {
|
||||||
if (revertRemovalOfSiblingPrerendering) {
|
|
||||||
if ((completedWork.flags & Incomplete) !== NoFlags) {
|
|
||||||
// This fiber did not complete, because one of its children did not
|
|
||||||
// complete. Switch to unwinding the stack instead of completing it.
|
|
||||||
//
|
|
||||||
// The reason "unwind" and "complete" is interleaved is because when
|
|
||||||
// something suspends, we continue rendering the siblings even though
|
|
||||||
// they will be replaced by a fallback.
|
|
||||||
// TODO: Disable sibling prerendering, then remove this branch.
|
|
||||||
unwindUnitOfWork(completedWork);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
if ((completedWork.flags & Incomplete) !== NoFlags) {
|
if ((completedWork.flags & Incomplete) !== NoFlags) {
|
||||||
// NOTE: If we re-enable sibling prerendering in some cases, this branch
|
// NOTE: If we re-enable sibling prerendering in some cases, this branch
|
||||||
|
@ -2464,7 +2450,6 @@ function completeUnitOfWork(unitOfWork: Fiber): void {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// The current, flushed, state of this fiber is the alternate. Ideally
|
// The current, flushed, state of this fiber is the alternate. Ideally
|
||||||
// nothing should rely on this, but relying on it here means that we don't
|
// nothing should rely on this, but relying on it here means that we don't
|
||||||
|
@ -2566,24 +2551,9 @@ function unwindUnitOfWork(unitOfWork: Fiber): void {
|
||||||
returnFiber.deletions = null;
|
returnFiber.deletions = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (revertRemovalOfSiblingPrerendering) {
|
// NOTE: If we re-enable sibling prerendering in some cases, here we
|
||||||
// If there are siblings, work on them now even though they're going to be
|
// would switch to the normal completion path: check if a sibling
|
||||||
// replaced by a fallback. We're "prerendering" them. Historically our
|
// exists, and if so, begin work on it.
|
||||||
// rationale for this behavior has been to initiate any lazy data requests
|
|
||||||
// in the siblings, and also to warm up the CPU cache.
|
|
||||||
// TODO: Don't prerender siblings. With `use`, we suspend the work loop
|
|
||||||
// until the data has resolved, anyway.
|
|
||||||
const siblingFiber = incompleteWork.sibling;
|
|
||||||
if (siblingFiber !== null) {
|
|
||||||
// This branch will return us to the normal work loop.
|
|
||||||
workInProgress = siblingFiber;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// NOTE: If we re-enable sibling prerendering in some cases, this branch
|
|
||||||
// is where we would switch to the normal completion path: check if a
|
|
||||||
// sibling exists, and if so, begin work on it.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise, return to the parent
|
// Otherwise, return to the parent
|
||||||
// $FlowFixMe[incompatible-type] we bail out when we get a null
|
// $FlowFixMe[incompatible-type] we bail out when we get a null
|
||||||
|
|
|
@ -22,11 +22,6 @@ export const enableComponentStackLocations = true;
|
||||||
// when it rolls out to prod. We should remove these as soon as possible.
|
// when it rolls out to prod. We should remove these as soon as possible.
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
// This is phrased as a negative so that if someone forgets to add a GK, the
|
|
||||||
// default is to enable the feature. It should only be overridden if there's
|
|
||||||
// a regression in prod.
|
|
||||||
export const revertRemovalOfSiblingPrerendering = false;
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Land or remove (moderate effort)
|
// Land or remove (moderate effort)
|
||||||
//
|
//
|
||||||
|
|
|
@ -43,7 +43,6 @@ export const enableScopeAPI = false;
|
||||||
export const enableCreateEventHandleAPI = false;
|
export const enableCreateEventHandleAPI = false;
|
||||||
export const enableSuspenseCallback = false;
|
export const enableSuspenseCallback = false;
|
||||||
export const disableLegacyContext = false;
|
export const disableLegacyContext = false;
|
||||||
export const revertRemovalOfSiblingPrerendering = false;
|
|
||||||
export const enableTrustedTypesIntegration = false;
|
export const enableTrustedTypesIntegration = false;
|
||||||
export const disableTextareaChildren = false;
|
export const disableTextareaChildren = false;
|
||||||
export const disableModulePatternComponents = false;
|
export const disableModulePatternComponents = false;
|
||||||
|
|
|
@ -32,7 +32,6 @@ export const enableScopeAPI = false;
|
||||||
export const enableCreateEventHandleAPI = false;
|
export const enableCreateEventHandleAPI = false;
|
||||||
export const enableSuspenseCallback = false;
|
export const enableSuspenseCallback = false;
|
||||||
export const disableLegacyContext = false;
|
export const disableLegacyContext = false;
|
||||||
export const revertRemovalOfSiblingPrerendering = false;
|
|
||||||
export const enableTrustedTypesIntegration = false;
|
export const enableTrustedTypesIntegration = false;
|
||||||
export const disableTextareaChildren = false;
|
export const disableTextareaChildren = false;
|
||||||
export const disableModulePatternComponents = false;
|
export const disableModulePatternComponents = false;
|
||||||
|
|
|
@ -32,7 +32,6 @@ export const enableScopeAPI = false;
|
||||||
export const enableCreateEventHandleAPI = false;
|
export const enableCreateEventHandleAPI = false;
|
||||||
export const enableSuspenseCallback = false;
|
export const enableSuspenseCallback = false;
|
||||||
export const disableLegacyContext = false;
|
export const disableLegacyContext = false;
|
||||||
export const revertRemovalOfSiblingPrerendering = false;
|
|
||||||
export const enableTrustedTypesIntegration = false;
|
export const enableTrustedTypesIntegration = false;
|
||||||
export const disableTextareaChildren = false;
|
export const disableTextareaChildren = false;
|
||||||
export const disableModulePatternComponents = false;
|
export const disableModulePatternComponents = false;
|
||||||
|
|
|
@ -32,7 +32,6 @@ export const enableScopeAPI = false;
|
||||||
export const enableCreateEventHandleAPI = false;
|
export const enableCreateEventHandleAPI = false;
|
||||||
export const enableSuspenseCallback = false;
|
export const enableSuspenseCallback = false;
|
||||||
export const disableLegacyContext = false;
|
export const disableLegacyContext = false;
|
||||||
export const revertRemovalOfSiblingPrerendering = false;
|
|
||||||
export const enableTrustedTypesIntegration = false;
|
export const enableTrustedTypesIntegration = false;
|
||||||
export const disableTextareaChildren = false;
|
export const disableTextareaChildren = false;
|
||||||
export const disableModulePatternComponents = false;
|
export const disableModulePatternComponents = false;
|
||||||
|
|
|
@ -32,7 +32,6 @@ export const enableScopeAPI = true;
|
||||||
export const enableCreateEventHandleAPI = false;
|
export const enableCreateEventHandleAPI = false;
|
||||||
export const enableSuspenseCallback = true;
|
export const enableSuspenseCallback = true;
|
||||||
export const disableLegacyContext = false;
|
export const disableLegacyContext = false;
|
||||||
export const revertRemovalOfSiblingPrerendering = false;
|
|
||||||
export const enableTrustedTypesIntegration = false;
|
export const enableTrustedTypesIntegration = false;
|
||||||
export const disableTextareaChildren = false;
|
export const disableTextareaChildren = false;
|
||||||
export const disableModulePatternComponents = true;
|
export const disableModulePatternComponents = true;
|
||||||
|
|
|
@ -39,12 +39,6 @@ export const enableSchedulingProfiler = __VARIANT__;
|
||||||
// so we don't need to use __VARIANT__ to get extra coverage.
|
// so we don't need to use __VARIANT__ to get extra coverage.
|
||||||
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
|
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
|
||||||
|
|
||||||
// This flag only exists so it can be connected to a www GK that acts as a
|
|
||||||
// killswitch. We don't run our tests against the `true` value because 1) it
|
|
||||||
// affects too many tests 2) it shouldn't break anything. But it is mildly
|
|
||||||
// risky, hence this extra precaution.
|
|
||||||
export const revertRemovalOfSiblingPrerendering = false;
|
|
||||||
|
|
||||||
// TODO: These flags are hard-coded to the default values used in open source.
|
// TODO: These flags are hard-coded to the default values used in open source.
|
||||||
// Update the tests so that they pass in either mode, then set these
|
// Update the tests so that they pass in either mode, then set these
|
||||||
// to __VARIANT__.
|
// to __VARIANT__.
|
||||||
|
|
|
@ -18,7 +18,6 @@ export const {
|
||||||
disableInputAttributeSyncing,
|
disableInputAttributeSyncing,
|
||||||
disableIEWorkarounds,
|
disableIEWorkarounds,
|
||||||
enableTrustedTypesIntegration,
|
enableTrustedTypesIntegration,
|
||||||
revertRemovalOfSiblingPrerendering,
|
|
||||||
replayFailedUnitOfWorkWithInvokeGuardedCallback,
|
replayFailedUnitOfWorkWithInvokeGuardedCallback,
|
||||||
enableLegacyFBSupport,
|
enableLegacyFBSupport,
|
||||||
enableDebugTracing,
|
enableDebugTracing,
|
||||||
|
|
Loading…
Reference in New Issue