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 f114757 commit 01ac93f
Show file tree
Hide file tree
Showing 23 changed files with 577 additions and 640 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.0.0-native-fb-de43d560-20241009
19.0.0-native-fb-13411e45-20241014
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<550c10c16de0559e53cbd039c2e4f6d9>>
* @generated SignedSource<<1d8dd9e8ce69a34a08cc90461cf3ab97>>
*/

"use strict";
Expand Down Expand Up @@ -420,5 +420,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de43d560-20241009";
exports.version = "19.0.0-native-fb-13411e45-20241014";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4ba3a2044ec1d4234e283594a2af1550>>
* @generated SignedSource<<2dd40d3277960a40fd61ad48c151ffa8>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de43d560-20241009";
exports.version = "19.0.0-native-fb-13411e45-20241014";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4ba3a2044ec1d4234e283594a2af1550>>
* @generated SignedSource<<2dd40d3277960a40fd61ad48c151ffa8>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de43d560-20241009";
exports.version = "19.0.0-native-fb-13411e45-20241014";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<8180b974f916c25525536140b7314c8a>>
* @generated SignedSource<<d81dd6637407a77fecc43d347e5de1c5>>
*/

/*
Expand Down Expand Up @@ -1046,7 +1046,8 @@ __DEV__ &&
: ((pingedLanes &= nonIdlePendingLanes),
0 !== pingedLanes
? (nextLanes = getHighestPriorityLanes(pingedLanes))
: root ||
: enableSiblingPrerendering &&
!root &&
((warmLanes = nonIdlePendingLanes & ~warmLanes),
0 !== warmLanes &&
(nextLanes = getHighestPriorityLanes(warmLanes)))))
Expand All @@ -1055,7 +1056,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 @@ -1182,7 +1184,8 @@ __DEV__ &&
remainingLanes &= ~lane;
}
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
0 !== suspendedRetryLanes &&
enableSiblingPrerendering &&
0 !== suspendedRetryLanes &&
0 === updatedLanes &&
(root.suspendedLanes |=
suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
Expand Down Expand Up @@ -14095,7 +14098,8 @@ __DEV__ &&
((retryQueue =
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
(workInProgress.lanes |= retryQueue),
(workInProgressSuspendedRetryLanes |= retryQueue));
enableSiblingPrerendering &&
(workInProgressSuspendedRetryLanes |= retryQueue));
}
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
if (!isHydrating)
Expand Down Expand Up @@ -15277,7 +15281,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 @@ -25304,11 +25310,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-native-fb-de43d560-20241009" !== isomorphicReactPackageVersion)
if ("19.0.0-native-fb-13411e45-20241014" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-native-fb-de43d560-20241009\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-native-fb-13411e45-20241014\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25345,11 +25351,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-de43d560-20241009",
version: "19.0.0-native-fb-13411e45-20241014",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de43d560-20241009"
reconcilerVersion: "19.0.0-native-fb-13411e45-20241014"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -25493,5 +25499,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-de43d560-20241009";
exports.version = "19.0.0-native-fb-13411e45-20241014";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<86bcc49ed3494f6591ac576b591609e0>>
* @generated SignedSource<<3cc21b65f550413946b26a12d53d1166>>
*/

/*
Expand Down Expand Up @@ -674,7 +674,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 @@ -683,7 +684,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 @@ -803,7 +805,8 @@ function markRootFinished(
remainingLanes &= ~lane;
}
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
0 !== suspendedRetryLanes &&
enableSiblingPrerendering &&
0 !== suspendedRetryLanes &&
0 === updatedLanes &&
(root.suspendedLanes |=
suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
Expand Down Expand Up @@ -10081,7 +10084,8 @@ function scheduleRetryEffect(workInProgress, retryQueue) {
((retryQueue =
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
(workInProgress.lanes |= retryQueue),
(workInProgressSuspendedRetryLanes |= retryQueue));
enableSiblingPrerendering &&
(workInProgressSuspendedRetryLanes |= retryQueue));
}
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
if (!isHydrating)
Expand Down Expand Up @@ -11051,7 +11055,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 @@ -15598,14 +15604,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1691 = React.version;
if (
"19.0.0-native-fb-de43d560-20241009" !==
"19.0.0-native-fb-13411e45-20241014" !==
isomorphicReactPackageVersion$jscomp$inline_1691
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1691,
"19.0.0-native-fb-de43d560-20241009"
"19.0.0-native-fb-13411e45-20241014"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15627,11 +15633,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2144 = {
bundleType: 0,
version: "19.0.0-native-fb-de43d560-20241009",
version: "19.0.0-native-fb-13411e45-20241014",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de43d560-20241009"
reconcilerVersion: "19.0.0-native-fb-13411e45-20241014"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2145 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15735,4 +15741,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-de43d560-20241009";
exports.version = "19.0.0-native-fb-13411e45-20241014";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4824b23c5f4ff96fb4802c9f8adf2471>>
* @generated SignedSource<<1f9731688cb275b818de4cd35d1795ac>>
*/

/*
Expand Down Expand Up @@ -739,7 +739,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 @@ -748,7 +749,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 @@ -868,7 +870,8 @@ function markRootFinished(
remainingLanes &= ~lane;
}
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
0 !== suspendedRetryLanes &&
enableSiblingPrerendering &&
0 !== suspendedRetryLanes &&
0 === updatedLanes &&
(root.suspendedLanes |=
suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
Expand Down Expand Up @@ -10552,7 +10555,8 @@ function scheduleRetryEffect(workInProgress, retryQueue) {
((retryQueue =
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
(workInProgress.lanes |= retryQueue),
(workInProgressSuspendedRetryLanes |= retryQueue));
enableSiblingPrerendering &&
(workInProgressSuspendedRetryLanes |= retryQueue));
}
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
if (!isHydrating)
Expand Down Expand Up @@ -11589,7 +11593,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 @@ -16255,14 +16261,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1781 = React.version;
if (
"19.0.0-native-fb-de43d560-20241009" !==
"19.0.0-native-fb-13411e45-20241014" !==
isomorphicReactPackageVersion$jscomp$inline_1781
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1781,
"19.0.0-native-fb-de43d560-20241009"
"19.0.0-native-fb-13411e45-20241014"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16284,11 +16290,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1788 = {
bundleType: 0,
version: "19.0.0-native-fb-de43d560-20241009",
version: "19.0.0-native-fb-13411e45-20241014",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de43d560-20241009",
reconcilerVersion: "19.0.0-native-fb-13411e45-20241014",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$286 = 0;
Expand Down Expand Up @@ -16407,4 +16413,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-de43d560-20241009";
exports.version = "19.0.0-native-fb-13411e45-20241014";
Loading

0 comments on commit 01ac93f

Please sign in to comment.