Skip to content

Commit b1eb8cd

Browse files
committed
Remove revertRemovalOfSiblingPrerendering killswitch
1 parent 4a1cc2d commit b1eb8cd

9 files changed

+7
-58
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import {
3838
enableCache,
3939
enableTransitionTracing,
4040
useModernStrictMode,
41-
revertRemovalOfSiblingPrerendering,
4241
disableLegacyContext,
4342
} from 'shared/ReactFeatureFlags';
4443
import ReactSharedInternals from 'shared/ReactSharedInternals';
@@ -2535,28 +2534,14 @@ function completeUnitOfWork(unitOfWork: Fiber): void {
25352534
// sibling. If there are no more siblings, return to the parent fiber.
25362535
let completedWork: Fiber = unitOfWork;
25372536
do {
2538-
if (revertRemovalOfSiblingPrerendering) {
2537+
if (__DEV__) {
25392538
if ((completedWork.flags & Incomplete) !== NoFlags) {
2540-
// This fiber did not complete, because one of its children did not
2541-
// complete. Switch to unwinding the stack instead of completing it.
2542-
//
2543-
// The reason "unwind" and "complete" is interleaved is because when
2544-
// something suspends, we continue rendering the siblings even though
2545-
// they will be replaced by a fallback.
2546-
// TODO: Disable sibling prerendering, then remove this branch.
2547-
unwindUnitOfWork(completedWork);
2548-
return;
2549-
}
2550-
} else {
2551-
if (__DEV__) {
2552-
if ((completedWork.flags & Incomplete) !== NoFlags) {
2553-
// NOTE: If we re-enable sibling prerendering in some cases, this branch
2554-
// is where we would switch to the unwinding path.
2555-
console.error(
2556-
'Internal React error: Expected this fiber to be complete, but ' +
2557-
"it isn't. It should have been unwound. This is a bug in React.",
2558-
);
2559-
}
2539+
// NOTE: If we re-enable sibling prerendering in some cases, this branch
2540+
// is where we would switch to the unwinding path.
2541+
console.error(
2542+
'Internal React error: Expected this fiber to be complete, but ' +
2543+
"it isn't. It should have been unwound. This is a bug in React.",
2544+
);
25602545
}
25612546
}
25622547

@@ -2660,25 +2645,6 @@ function unwindUnitOfWork(unitOfWork: Fiber): void {
26602645
returnFiber.deletions = null;
26612646
}
26622647

2663-
if (revertRemovalOfSiblingPrerendering) {
2664-
// If there are siblings, work on them now even though they're going to be
2665-
// replaced by a fallback. We're "prerendering" them. Historically our
2666-
// rationale for this behavior has been to initiate any lazy data requests
2667-
// in the siblings, and also to warm up the CPU cache.
2668-
// TODO: Don't prerender siblings. With `use`, we suspend the work loop
2669-
// until the data has resolved, anyway.
2670-
const siblingFiber = incompleteWork.sibling;
2671-
if (siblingFiber !== null) {
2672-
// This branch will return us to the normal work loop.
2673-
workInProgress = siblingFiber;
2674-
return;
2675-
}
2676-
} else {
2677-
// NOTE: If we re-enable sibling prerendering in some cases, this branch
2678-
// is where we would switch to the normal completion path: check if a
2679-
// sibling exists, and if so, begin work on it.
2680-
}
2681-
26822648
// Otherwise, return to the parent
26832649
// $FlowFixMe[incompatible-type] we bail out when we get a null
26842650
incompleteWork = returnFiber;

packages/shared/ReactFeatureFlags.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ export const enableComponentStackLocations = true;
2222
// when it rolls out to prod. We should remove these as soon as possible.
2323
// -----------------------------------------------------------------------------
2424

25-
// This is phrased as a negative so that if someone forgets to add a GK, the
26-
// default is to enable the feature. It should only be overridden if there's
27-
// a regression in prod.
28-
export const revertRemovalOfSiblingPrerendering = false;
29-
3025
// -----------------------------------------------------------------------------
3126
// Land or remove (moderate effort)
3227
//

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export const enableScopeAPI = false;
4343
export const enableCreateEventHandleAPI = false;
4444
export const enableSuspenseCallback = false;
4545
export const disableLegacyContext = false;
46-
export const revertRemovalOfSiblingPrerendering = false;
4746
export const enableTrustedTypesIntegration = false;
4847
export const disableTextareaChildren = false;
4948
export const disableModulePatternComponents = false;

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const enableScopeAPI = false;
3232
export const enableCreateEventHandleAPI = false;
3333
export const enableSuspenseCallback = false;
3434
export const disableLegacyContext = false;
35-
export const revertRemovalOfSiblingPrerendering = false;
3635
export const enableTrustedTypesIntegration = false;
3736
export const disableTextareaChildren = false;
3837
export const disableModulePatternComponents = false;

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const enableScopeAPI = false;
3232
export const enableCreateEventHandleAPI = false;
3333
export const enableSuspenseCallback = false;
3434
export const disableLegacyContext = false;
35-
export const revertRemovalOfSiblingPrerendering = false;
3635
export const enableTrustedTypesIntegration = false;
3736
export const disableTextareaChildren = false;
3837
export const disableModulePatternComponents = false;

packages/shared/forks/ReactFeatureFlags.test-renderer.native.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const enableScopeAPI = false;
3232
export const enableCreateEventHandleAPI = false;
3333
export const enableSuspenseCallback = false;
3434
export const disableLegacyContext = false;
35-
export const revertRemovalOfSiblingPrerendering = false;
3635
export const enableTrustedTypesIntegration = false;
3736
export const disableTextareaChildren = false;
3837
export const disableModulePatternComponents = false;

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const enableScopeAPI = true;
3232
export const enableCreateEventHandleAPI = false;
3333
export const enableSuspenseCallback = true;
3434
export const disableLegacyContext = false;
35-
export const revertRemovalOfSiblingPrerendering = false;
3635
export const enableTrustedTypesIntegration = false;
3736
export const disableTextareaChildren = false;
3837
export const disableModulePatternComponents = true;

packages/shared/forks/ReactFeatureFlags.www-dynamic.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ export const enableSchedulingProfiler = __VARIANT__;
3737
// so we don't need to use __VARIANT__ to get extra coverage.
3838
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
3939

40-
// This flag only exists so it can be connected to a www GK that acts as a
41-
// killswitch. We don't run our tests against the `true` value because 1) it
42-
// affects too many tests 2) it shouldn't break anything. But it is mildly
43-
// risky, hence this extra precaution.
44-
export const revertRemovalOfSiblingPrerendering = false;
45-
4640
// TODO: These flags are hard-coded to the default values used in open source.
4741
// Update the tests so that they pass in either mode, then set these
4842
// to __VARIANT__.

packages/shared/forks/ReactFeatureFlags.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const {
1818
disableInputAttributeSyncing,
1919
disableIEWorkarounds,
2020
enableTrustedTypesIntegration,
21-
revertRemovalOfSiblingPrerendering,
2221
replayFailedUnitOfWorkWithInvokeGuardedCallback,
2322
enableLegacyFBSupport,
2423
enableDebugTracing,

0 commit comments

Comments
 (0)