Skip to content

Commit

Permalink
[Re-land] Make prerendering always non-blocking: Add missing feature …
Browse files Browse the repository at this point in the history
…flag checks (#31238)

This is a partial re-land of
#31056. We saw breakages surface
after the original land and had to revert. Now that they've been fixed,
let's try this again. This time we'll split up the commits to give us
more control of testing and rollout internally.

Original PR: #31056
Original Commit:
2a9fb44
Revert PR: #31080

Commit description:
```
Neglected to wrap some places in the enableSiblingPrerendering flag.
```

Co-authored-by: Andrew Clark <git@andrewclark.io>

DiffTrain build for [13411e4](13411e4)
  • Loading branch information
jackpope committed Oct 14, 2024
1 parent c1210a1 commit d3a3f5f
Show file tree
Hide file tree
Showing 34 changed files with 390 additions and 366 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
75dd053b5e83e8ae20e9f771bca7b95dba4ff881
13411e4589f3d999727c5322781e2dd7bef3b256
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
75dd053b5e83e8ae20e9f771bca7b95dba4ff881
13411e4589f3d999727c5322781e2dd7bef3b256
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-75dd053b-20241014";
exports.version = "19.0.0-www-classic-13411e45-20241014";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-75dd053b-20241014";
exports.version = "19.0.0-www-modern-13411e45-20241014";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,4 +824,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-75dd053b-20241014";
exports.version = "19.0.0-www-classic-13411e45-20241014";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,4 +820,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-75dd053b-20241014";
exports.version = "19.0.0-www-modern-13411e45-20241014";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-75dd053b-20241014";
exports.version = "19.0.0-www-classic-13411e45-20241014";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-75dd053b-20241014";
exports.version = "19.0.0-www-modern-13411e45-20241014";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
22 changes: 14 additions & 8 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,8 @@ __DEV__ &&
: ((pingedLanes &= nonIdlePendingLanes),
0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = nonIdlePendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes)))))
Expand All @@ -866,7 +867,8 @@ __DEV__ &&
? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
: 0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = pendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes))));
Expand Down Expand Up @@ -988,7 +990,8 @@ __DEV__ &&
remainingLanes &= ~lane;
}
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
0 === suspendedRetryLanes ||
!enableSiblingPrerendering ||
0 === suspendedRetryLanes ||
0 !== updatedLanes ||
(disableLegacyMode && 0 === root.tag) ||
(root.suspendedLanes |=
Expand Down Expand Up @@ -8992,7 +8995,8 @@ __DEV__ &&
((retryQueue =
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
(workInProgress.lanes |= retryQueue),
(workInProgressSuspendedRetryLanes |= retryQueue));
enableSiblingPrerendering &&
(workInProgressSuspendedRetryLanes |= retryQueue));
}
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
switch (renderState.tailMode) {
Expand Down Expand Up @@ -12797,7 +12801,9 @@ __DEV__ &&
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
root.suspendedLanes |= suspendedLanes;
root.pingedLanes &= ~suspendedLanes;
didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes);
enableSiblingPrerendering &&
!didSkipSuspendedSiblings &&
(root.warmLanes |= suspendedLanes);
didSkipSuspendedSiblings = root.expirationTimes;
for (var lanes = suspendedLanes; 0 < lanes; ) {
var index = 31 - clz32(lanes),
Expand Down Expand Up @@ -17018,11 +17024,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-75dd053b-20241014",
version: "19.0.0-www-classic-13411e45-20241014",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-75dd053b-20241014"
reconcilerVersion: "19.0.0-www-classic-13411e45-20241014"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17056,7 +17062,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-75dd053b-20241014";
exports.version = "19.0.0-www-classic-13411e45-20241014";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
22 changes: 14 additions & 8 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@ __DEV__ &&
: ((pingedLanes &= nonIdlePendingLanes),
0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = nonIdlePendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes)))))
Expand All @@ -849,7 +850,8 @@ __DEV__ &&
? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
: 0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = pendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes))));
Expand Down Expand Up @@ -971,7 +973,8 @@ __DEV__ &&
remainingLanes &= ~lane;
}
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
0 !== suspendedRetryLanes &&
enableSiblingPrerendering &&
0 !== suspendedRetryLanes &&
0 === updatedLanes &&
0 !== root.tag &&
(root.suspendedLanes |=
Expand Down Expand Up @@ -8647,7 +8650,8 @@ __DEV__ &&
((retryQueue =
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
(workInProgress.lanes |= retryQueue),
(workInProgressSuspendedRetryLanes |= retryQueue));
enableSiblingPrerendering &&
(workInProgressSuspendedRetryLanes |= retryQueue));
}
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
switch (renderState.tailMode) {
Expand Down Expand Up @@ -12342,7 +12346,9 @@ __DEV__ &&
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
root.suspendedLanes |= suspendedLanes;
root.pingedLanes &= ~suspendedLanes;
didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes);
enableSiblingPrerendering &&
!didSkipSuspendedSiblings &&
(root.warmLanes |= suspendedLanes);
didSkipSuspendedSiblings = root.expirationTimes;
for (var lanes = suspendedLanes; 0 < lanes; ) {
var index = 31 - clz32(lanes),
Expand Down Expand Up @@ -16461,11 +16467,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-75dd053b-20241014",
version: "19.0.0-www-modern-13411e45-20241014",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-75dd053b-20241014"
reconcilerVersion: "19.0.0-www-modern-13411e45-20241014"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16499,7 +16505,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-75dd053b-20241014";
exports.version = "19.0.0-www-modern-13411e45-20241014";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
22 changes: 14 additions & 8 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ function getNextLanes(root, wipLanes) {
: ((pingedLanes &= nonIdlePendingLanes),
0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = nonIdlePendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes)))))
Expand All @@ -610,7 +611,8 @@ function getNextLanes(root, wipLanes) {
? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
: 0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = pendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes))));
Expand Down Expand Up @@ -727,7 +729,8 @@ function markRootFinished(
remainingLanes &= ~lane;
}
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
0 === suspendedRetryLanes ||
!enableSiblingPrerendering ||
0 === suspendedRetryLanes ||
0 !== updatedLanes ||
(disableLegacyMode && 0 === root.tag) ||
(root.suspendedLanes |=
Expand Down Expand Up @@ -6551,7 +6554,8 @@ function scheduleRetryEffect(workInProgress, retryQueue) {
((retryQueue =
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
(workInProgress.lanes |= retryQueue),
(workInProgressSuspendedRetryLanes |= retryQueue));
enableSiblingPrerendering &&
(workInProgressSuspendedRetryLanes |= retryQueue));
}
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
switch (renderState.tailMode) {
Expand Down Expand Up @@ -9477,7 +9481,9 @@ function markRootSuspended(
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
root.suspendedLanes |= suspendedLanes;
root.pingedLanes &= ~suspendedLanes;
didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes);
enableSiblingPrerendering &&
!didSkipSuspendedSiblings &&
(root.warmLanes |= suspendedLanes);
didSkipSuspendedSiblings = root.expirationTimes;
for (var lanes = suspendedLanes; 0 < lanes; ) {
var index$6 = 31 - clz32(lanes),
Expand Down Expand Up @@ -10829,13 +10835,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1467 = {
bundleType: 0,
version: "19.0.0-www-classic-75dd053b-20241014",
version: "19.0.0-www-classic-13411e45-20241014",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-classic-75dd053b-20241014"
reconcilerVersion: "19.0.0-www-classic-13411e45-20241014"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1468 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10861,4 +10867,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-75dd053b-20241014";
exports.version = "19.0.0-www-classic-13411e45-20241014";
22 changes: 14 additions & 8 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ function getNextLanes(root, wipLanes) {
: ((pingedLanes &= nonIdlePendingLanes),
0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = nonIdlePendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes)))))
Expand All @@ -527,7 +528,8 @@ function getNextLanes(root, wipLanes) {
? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
: 0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = pendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes))));
Expand Down Expand Up @@ -644,7 +646,8 @@ function markRootFinished(
remainingLanes &= ~lane;
}
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
0 !== suspendedRetryLanes &&
enableSiblingPrerendering &&
0 !== suspendedRetryLanes &&
0 === updatedLanes &&
0 !== root.tag &&
(root.suspendedLanes |=
Expand Down Expand Up @@ -6184,7 +6187,8 @@ function scheduleRetryEffect(workInProgress, retryQueue) {
((retryQueue =
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
(workInProgress.lanes |= retryQueue),
(workInProgressSuspendedRetryLanes |= retryQueue));
enableSiblingPrerendering &&
(workInProgressSuspendedRetryLanes |= retryQueue));
}
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
switch (renderState.tailMode) {
Expand Down Expand Up @@ -9040,7 +9044,9 @@ function markRootSuspended(
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
root.suspendedLanes |= suspendedLanes;
root.pingedLanes &= ~suspendedLanes;
didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes);
enableSiblingPrerendering &&
!didSkipSuspendedSiblings &&
(root.warmLanes |= suspendedLanes);
didSkipSuspendedSiblings = root.expirationTimes;
for (var lanes = suspendedLanes; 0 < lanes; ) {
var index$6 = 31 - clz32(lanes),
Expand Down Expand Up @@ -10340,13 +10346,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1460 = {
bundleType: 0,
version: "19.0.0-www-modern-75dd053b-20241014",
version: "19.0.0-www-modern-13411e45-20241014",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-modern-75dd053b-20241014"
reconcilerVersion: "19.0.0-www-modern-13411e45-20241014"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1461 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10372,4 +10378,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-75dd053b-20241014";
exports.version = "19.0.0-www-modern-13411e45-20241014";
Loading

0 comments on commit d3a3f5f

Please sign in to comment.