Skip to content

Commit 94c515f

Browse files
committed
Remove revertRemovalOfSiblingPrerendering killswitch (#26549)
removal of sibling prerendering has been rolled out at Meta. We can delete the flag now. DiffTrain build for [7b0642b](7b0642b)
1 parent 62dabe5 commit 94c515f

18 files changed

+500
-792
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8256781fdf3ae1947a7f27ddc78ae11b9989c2cd
1+
7b0642bb989ec659c6c9891ea16daa0420caab4d

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-ad6e07a1";
30+
var ReactVersion = "18.3.0-www-modern-50a23993";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-classic-3684ffc4";
72+
var ReactVersion = "18.3.0-www-classic-4e76503d";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -165,9 +165,7 @@ var ReactSharedInternals =
165165
// Re-export dynamic flags from the www version.
166166
var dynamicFeatureFlags = require("ReactFeatureFlags");
167167

168-
var revertRemovalOfSiblingPrerendering =
169-
dynamicFeatureFlags.revertRemovalOfSiblingPrerendering,
170-
replayFailedUnitOfWorkWithInvokeGuardedCallback =
168+
var replayFailedUnitOfWorkWithInvokeGuardedCallback =
171169
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
172170
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
173171
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
@@ -25446,28 +25444,14 @@ function completeUnitOfWork(unitOfWork) {
2544625444
var completedWork = unitOfWork;
2544725445

2544825446
do {
25449-
if (revertRemovalOfSiblingPrerendering) {
25447+
{
2545025448
if ((completedWork.flags & Incomplete) !== NoFlags$1) {
25451-
// This fiber did not complete, because one of its children did not
25452-
// complete. Switch to unwinding the stack instead of completing it.
25453-
//
25454-
// The reason "unwind" and "complete" is interleaved is because when
25455-
// something suspends, we continue rendering the siblings even though
25456-
// they will be replaced by a fallback.
25457-
// TODO: Disable sibling prerendering, then remove this branch.
25458-
unwindUnitOfWork(completedWork);
25459-
return;
25460-
}
25461-
} else {
25462-
{
25463-
if ((completedWork.flags & Incomplete) !== NoFlags$1) {
25464-
// NOTE: If we re-enable sibling prerendering in some cases, this branch
25465-
// is where we would switch to the unwinding path.
25466-
error(
25467-
"Internal React error: Expected this fiber to be complete, but " +
25468-
"it isn't. It should have been unwound. This is a bug in React."
25469-
);
25470-
}
25449+
// NOTE: If we re-enable sibling prerendering in some cases, this branch
25450+
// is where we would switch to the unwinding path.
25451+
error(
25452+
"Internal React error: Expected this fiber to be complete, but " +
25453+
"it isn't. It should have been unwound. This is a bug in React."
25454+
);
2547125455
}
2547225456
} // The current, flushed, state of this fiber is the alternate. Ideally
2547325457
// nothing should rely on this, but relying on it here means that we don't
@@ -25566,23 +25550,10 @@ function unwindUnitOfWork(unitOfWork) {
2556625550
returnFiber.flags |= Incomplete;
2556725551
returnFiber.subtreeFlags = NoFlags$1;
2556825552
returnFiber.deletions = null;
25569-
}
25570-
25571-
if (revertRemovalOfSiblingPrerendering) {
25572-
// If there are siblings, work on them now even though they're going to be
25573-
// replaced by a fallback. We're "prerendering" them. Historically our
25574-
// rationale for this behavior has been to initiate any lazy data requests
25575-
// in the siblings, and also to warm up the CPU cache.
25576-
// TODO: Don't prerender siblings. With `use`, we suspend the work loop
25577-
// until the data has resolved, anyway.
25578-
var siblingFiber = incompleteWork.sibling;
25579-
25580-
if (siblingFiber !== null) {
25581-
// This branch will return us to the normal work loop.
25582-
workInProgress = siblingFiber;
25583-
return;
25584-
}
25585-
} // Otherwise, return to the parent
25553+
} // NOTE: If we re-enable sibling prerendering in some cases, here we
25554+
// would switch to the normal completion path: check if a sibling
25555+
// exists, and if so, begin work on it.
25556+
// Otherwise, return to the parent
2558625557
// $FlowFixMe[incompatible-type] we bail out when we get a null
2558725558

2558825559
incompleteWork = returnFiber; // Update the next thing we're working on in case something throws.

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-modern-b352a803";
72+
var ReactVersion = "18.3.0-www-modern-f2fcb129";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -165,9 +165,7 @@ var ReactSharedInternals =
165165
// Re-export dynamic flags from the www version.
166166
var dynamicFeatureFlags = require("ReactFeatureFlags");
167167

168-
var revertRemovalOfSiblingPrerendering =
169-
dynamicFeatureFlags.revertRemovalOfSiblingPrerendering,
170-
replayFailedUnitOfWorkWithInvokeGuardedCallback =
168+
var replayFailedUnitOfWorkWithInvokeGuardedCallback =
171169
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
172170
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
173171
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
@@ -25106,28 +25104,14 @@ function completeUnitOfWork(unitOfWork) {
2510625104
var completedWork = unitOfWork;
2510725105

2510825106
do {
25109-
if (revertRemovalOfSiblingPrerendering) {
25107+
{
2511025108
if ((completedWork.flags & Incomplete) !== NoFlags$1) {
25111-
// This fiber did not complete, because one of its children did not
25112-
// complete. Switch to unwinding the stack instead of completing it.
25113-
//
25114-
// The reason "unwind" and "complete" is interleaved is because when
25115-
// something suspends, we continue rendering the siblings even though
25116-
// they will be replaced by a fallback.
25117-
// TODO: Disable sibling prerendering, then remove this branch.
25118-
unwindUnitOfWork(completedWork);
25119-
return;
25120-
}
25121-
} else {
25122-
{
25123-
if ((completedWork.flags & Incomplete) !== NoFlags$1) {
25124-
// NOTE: If we re-enable sibling prerendering in some cases, this branch
25125-
// is where we would switch to the unwinding path.
25126-
error(
25127-
"Internal React error: Expected this fiber to be complete, but " +
25128-
"it isn't. It should have been unwound. This is a bug in React."
25129-
);
25130-
}
25109+
// NOTE: If we re-enable sibling prerendering in some cases, this branch
25110+
// is where we would switch to the unwinding path.
25111+
error(
25112+
"Internal React error: Expected this fiber to be complete, but " +
25113+
"it isn't. It should have been unwound. This is a bug in React."
25114+
);
2513125115
}
2513225116
} // The current, flushed, state of this fiber is the alternate. Ideally
2513325117
// nothing should rely on this, but relying on it here means that we don't
@@ -25226,23 +25210,10 @@ function unwindUnitOfWork(unitOfWork) {
2522625210
returnFiber.flags |= Incomplete;
2522725211
returnFiber.subtreeFlags = NoFlags$1;
2522825212
returnFiber.deletions = null;
25229-
}
25230-
25231-
if (revertRemovalOfSiblingPrerendering) {
25232-
// If there are siblings, work on them now even though they're going to be
25233-
// replaced by a fallback. We're "prerendering" them. Historically our
25234-
// rationale for this behavior has been to initiate any lazy data requests
25235-
// in the siblings, and also to warm up the CPU cache.
25236-
// TODO: Don't prerender siblings. With `use`, we suspend the work loop
25237-
// until the data has resolved, anyway.
25238-
var siblingFiber = incompleteWork.sibling;
25239-
25240-
if (siblingFiber !== null) {
25241-
// This branch will return us to the normal work loop.
25242-
workInProgress = siblingFiber;
25243-
return;
25244-
}
25245-
} // Otherwise, return to the parent
25213+
} // NOTE: If we re-enable sibling prerendering in some cases, here we
25214+
// would switch to the normal completion path: check if a sibling
25215+
// exists, and if so, begin work on it.
25216+
// Otherwise, return to the parent
2524625217
// $FlowFixMe[incompatible-type] we bail out when we get a null
2524725218

2524825219
incompleteWork = returnFiber; // Update the next thing we're working on in case something throws.

compiled/facebook-www/ReactART-prod.classic.js

Lines changed: 35 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ function formatProdErrorMessage(code) {
6363
var ReactSharedInternals =
6464
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
6565
dynamicFeatureFlags = require("ReactFeatureFlags"),
66-
revertRemovalOfSiblingPrerendering =
67-
dynamicFeatureFlags.revertRemovalOfSiblingPrerendering,
6866
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
6967
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
7068
enableLazyContextPropagation =
@@ -8692,21 +8690,31 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
86928690
} catch (error) {
86938691
throw ((workInProgress = returnFiber), error);
86948692
}
8695-
unitOfWork.flags & 32768
8696-
? unwindUnitOfWork(unitOfWork)
8697-
: completeUnitOfWork(unitOfWork);
8693+
if (unitOfWork.flags & 32768)
8694+
a: {
8695+
do {
8696+
returnFiber = unwindWork(unitOfWork.alternate, unitOfWork);
8697+
if (null !== returnFiber) {
8698+
returnFiber.flags &= 32767;
8699+
workInProgress = returnFiber;
8700+
break a;
8701+
}
8702+
unitOfWork = unitOfWork.return;
8703+
null !== unitOfWork &&
8704+
((unitOfWork.flags |= 32768),
8705+
(unitOfWork.subtreeFlags = 0),
8706+
(unitOfWork.deletions = null));
8707+
workInProgress = unitOfWork;
8708+
} while (null !== unitOfWork);
8709+
workInProgressRootExitStatus = 6;
8710+
workInProgress = null;
8711+
}
8712+
else completeUnitOfWork(unitOfWork);
86988713
}
86998714
}
87008715
function completeUnitOfWork(unitOfWork) {
87018716
var completedWork = unitOfWork;
87028717
do {
8703-
if (
8704-
revertRemovalOfSiblingPrerendering &&
8705-
0 !== (completedWork.flags & 32768)
8706-
) {
8707-
unwindUnitOfWork(completedWork);
8708-
return;
8709-
}
87108718
unitOfWork = completedWork.return;
87118719
var next = completeWork(
87128720
completedWork.alternate,
@@ -8726,29 +8734,6 @@ function completeUnitOfWork(unitOfWork) {
87268734
} while (null !== completedWork);
87278735
0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
87288736
}
8729-
function unwindUnitOfWork(unitOfWork) {
8730-
do {
8731-
var next = unwindWork(unitOfWork.alternate, unitOfWork);
8732-
if (null !== next) {
8733-
next.flags &= 32767;
8734-
workInProgress = next;
8735-
return;
8736-
}
8737-
next = unitOfWork.return;
8738-
null !== next &&
8739-
((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null));
8740-
if (
8741-
revertRemovalOfSiblingPrerendering &&
8742-
((unitOfWork = unitOfWork.sibling), null !== unitOfWork)
8743-
) {
8744-
workInProgress = unitOfWork;
8745-
return;
8746-
}
8747-
workInProgress = unitOfWork = next;
8748-
} while (null !== unitOfWork);
8749-
workInProgressRootExitStatus = 6;
8750-
workInProgress = null;
8751-
}
87528737
function commitRoot(root, recoverableErrors, transitions) {
87538738
var previousUpdateLanePriority = currentUpdatePriority,
87548739
prevTransition = ReactCurrentBatchConfig.transition;
@@ -9982,19 +9967,19 @@ var slice = Array.prototype.slice,
99829967
};
99839968
return Text;
99849969
})(React.Component),
9985-
devToolsConfig$jscomp$inline_1164 = {
9970+
devToolsConfig$jscomp$inline_1170 = {
99869971
findFiberByHostInstance: function () {
99879972
return null;
99889973
},
99899974
bundleType: 0,
9990-
version: "18.3.0-www-classic-8cb12f3b",
9975+
version: "18.3.0-www-classic-3d4daf47",
99919976
rendererPackageName: "react-art"
99929977
};
9993-
var internals$jscomp$inline_1329 = {
9994-
bundleType: devToolsConfig$jscomp$inline_1164.bundleType,
9995-
version: devToolsConfig$jscomp$inline_1164.version,
9996-
rendererPackageName: devToolsConfig$jscomp$inline_1164.rendererPackageName,
9997-
rendererConfig: devToolsConfig$jscomp$inline_1164.rendererConfig,
9978+
var internals$jscomp$inline_1335 = {
9979+
bundleType: devToolsConfig$jscomp$inline_1170.bundleType,
9980+
version: devToolsConfig$jscomp$inline_1170.version,
9981+
rendererPackageName: devToolsConfig$jscomp$inline_1170.rendererPackageName,
9982+
rendererConfig: devToolsConfig$jscomp$inline_1170.rendererConfig,
99989983
overrideHookState: null,
99999984
overrideHookStateDeletePath: null,
100009985
overrideHookStateRenamePath: null,
@@ -10011,26 +9996,26 @@ var internals$jscomp$inline_1329 = {
100119996
return null === fiber ? null : fiber.stateNode;
100129997
},
100139998
findFiberByHostInstance:
10014-
devToolsConfig$jscomp$inline_1164.findFiberByHostInstance ||
9999+
devToolsConfig$jscomp$inline_1170.findFiberByHostInstance ||
1001510000
emptyFindFiberByHostInstance,
1001610001
findHostInstancesForRefresh: null,
1001710002
scheduleRefresh: null,
1001810003
scheduleRoot: null,
1001910004
setRefreshHandler: null,
1002010005
getCurrentFiber: null,
10021-
reconcilerVersion: "18.3.0-www-classic-8cb12f3b"
10006+
reconcilerVersion: "18.3.0-www-classic-3d4daf47"
1002210007
};
1002310008
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
10024-
var hook$jscomp$inline_1330 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
10009+
var hook$jscomp$inline_1336 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1002510010
if (
10026-
!hook$jscomp$inline_1330.isDisabled &&
10027-
hook$jscomp$inline_1330.supportsFiber
10011+
!hook$jscomp$inline_1336.isDisabled &&
10012+
hook$jscomp$inline_1336.supportsFiber
1002810013
)
1002910014
try {
10030-
(rendererID = hook$jscomp$inline_1330.inject(
10031-
internals$jscomp$inline_1329
10015+
(rendererID = hook$jscomp$inline_1336.inject(
10016+
internals$jscomp$inline_1335
1003210017
)),
10033-
(injectedHook = hook$jscomp$inline_1330);
10018+
(injectedHook = hook$jscomp$inline_1336);
1003410019
} catch (err) {}
1003510020
}
1003610021
var Path = Mode$1.Path;

0 commit comments

Comments
 (0)