Skip to content

Commit

Permalink
[Fiber] Schedule client renders using non-hydration lane (#31776)
Browse files Browse the repository at this point in the history
Related to #31752.

When hydrating, we have two different ways of handling a Suspense
boundary that the server has already given up on and decided to client
render. If we have already hydrated the parent and then later this
happens, then we'll use the retry lane like any ping. If we discover
that it was already in client-render mode when we discover the Suspense
boundary for the first time, then schedule a default lane to let us
first finish the current render and then upgrade the priority to sync to
try to client render this boundary as soon as possible since we're
holding back content.

We used to use the `DefaultHydrationLane` for this but this is not
really a Hydration. It's actually a client render. If we get any other
updates flowing in from above at the same time we might as well do them
in the same pass instead of two passes. So this should be considered
more like any update.

This also means that visually the client render pass now gets painted as
a render instead of a hydration.

This show the flow of a shell being hydrated at the default priority,
then a Suspense boundary being discovered and hydrated at Idle and then
an inner boundary being discovered as client rendered which gets
upgraded to default.

<img width="1363" alt="Screenshot 2024-12-14 at 12 13 57 AM"
src="https://github.com/user-attachments/assets/a141133e-4856-4f38-a11f-f26bd00b6245"
/>

DiffTrain build for [d1dd7fe](d1dd7fe)
  • Loading branch information
sebmarkbage committed Dec 14, 2024
1 parent 2556bc0 commit 82c0c10
Show file tree
Hide file tree
Showing 34 changed files with 100 additions and 100 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0d67cc065157b2b98843cd1e2578b0969765c54b
c32780eeb4c44e138d09a35da841926f512d3b07
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0d67cc065157b2b98843cd1e2578b0969765c54b
c32780eeb4c44e138d09a35da841926f512d3b07
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 @@ -1954,7 +1954,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-0d67cc06-20241214";
exports.version = "19.1.0-www-classic-d1dd7fea-20241214";
"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 @@ -1954,7 +1954,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-0d67cc06-20241214";
exports.version = "19.1.0-www-modern-d1dd7fea-20241214";
"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 @@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-0d67cc06-20241214";
exports.version = "19.1.0-www-classic-d1dd7fea-20241214";
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 @@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-0d67cc06-20241214";
exports.version = "19.1.0-www-modern-d1dd7fea-20241214";
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 @@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-0d67cc06-20241214";
exports.version = "19.1.0-www-classic-d1dd7fea-20241214";
"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 @@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-0d67cc06-20241214";
exports.version = "19.1.0-www-modern-d1dd7fea-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17189,10 +17189,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-0d67cc06-20241214",
version: "19.1.0-www-classic-d1dd7fea-20241214",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-classic-d1dd7fea-20241214"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17226,7 +17226,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-0d67cc06-20241214";
exports.version = "19.1.0-www-classic-d1dd7fea-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16952,10 +16952,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-0d67cc06-20241214",
version: "19.1.0-www-modern-d1dd7fea-20241214",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-modern-d1dd7fea-20241214"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16989,7 +16989,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-0d67cc06-20241214";
exports.version = "19.1.0-www-modern-d1dd7fea-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10825,10 +10825,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1500 = {
bundleType: 0,
version: "19.1.0-www-classic-0d67cc06-20241214",
version: "19.1.0-www-classic-d1dd7fea-20241214",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-classic-d1dd7fea-20241214"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1501 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10854,4 +10854,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-0d67cc06-20241214";
exports.version = "19.1.0-www-classic-d1dd7fea-20241214";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10541,10 +10541,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1479 = {
bundleType: 0,
version: "19.1.0-www-modern-0d67cc06-20241214",
version: "19.1.0-www-modern-d1dd7fea-20241214",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-modern-d1dd7fea-20241214"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1480 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10570,4 +10570,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-0d67cc06-20241214";
exports.version = "19.1.0-www-modern-d1dd7fea-20241214";
12 changes: 6 additions & 6 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9486,7 +9486,7 @@ __DEV__ &&
)
return (
isSuspenseInstanceFallback(JSCompiler_object_inline_message_2493)
? (workInProgress.lanes = 16)
? (workInProgress.lanes = 32)
: (workInProgress.lanes = 536870912),
null
);
Expand Down Expand Up @@ -27665,11 +27665,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-classic-0d67cc06-20241214" !== isomorphicReactPackageVersion)
if ("19.1.0-www-classic-d1dd7fea-20241214" !== 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.1.0-www-classic-0d67cc06-20241214\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-classic-d1dd7fea-20241214\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27712,10 +27712,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-0d67cc06-20241214",
version: "19.1.0-www-classic-d1dd7fea-20241214",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-classic-d1dd7fea-20241214"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -28322,7 +28322,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-0d67cc06-20241214";
exports.version = "19.1.0-www-classic-d1dd7fea-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
12 changes: 6 additions & 6 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -9298,7 +9298,7 @@ __DEV__ &&
)
return (
isSuspenseInstanceFallback(JSCompiler_object_inline_message_2485)
? (workInProgress.lanes = 16)
? (workInProgress.lanes = 32)
: (workInProgress.lanes = 536870912),
null
);
Expand Down Expand Up @@ -27444,11 +27444,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-modern-0d67cc06-20241214" !== isomorphicReactPackageVersion)
if ("19.1.0-www-modern-d1dd7fea-20241214" !== 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.1.0-www-modern-0d67cc06-20241214\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-modern-d1dd7fea-20241214\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27491,10 +27491,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-0d67cc06-20241214",
version: "19.1.0-www-modern-d1dd7fea-20241214",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-modern-d1dd7fea-20241214"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -28101,7 +28101,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-0d67cc06-20241214";
exports.version = "19.1.0-www-modern-d1dd7fea-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
12 changes: 6 additions & 6 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -6211,7 +6211,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
)
return (
isSuspenseInstanceFallback(nextInstance)
? (workInProgress.lanes = 16)
? (workInProgress.lanes = 32)
: (workInProgress.lanes = 536870912),
null
);
Expand Down Expand Up @@ -17282,14 +17282,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1765 = React.version;
if (
"19.1.0-www-classic-0d67cc06-20241214" !==
"19.1.0-www-classic-d1dd7fea-20241214" !==
isomorphicReactPackageVersion$jscomp$inline_1765
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1765,
"19.1.0-www-classic-0d67cc06-20241214"
"19.1.0-www-classic-d1dd7fea-20241214"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17307,10 +17307,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2306 = {
bundleType: 0,
version: "19.1.0-www-classic-0d67cc06-20241214",
version: "19.1.0-www-classic-d1dd7fea-20241214",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-classic-d1dd7fea-20241214"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2307 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17675,4 +17675,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-0d67cc06-20241214";
exports.version = "19.1.0-www-classic-d1dd7fea-20241214";
12 changes: 6 additions & 6 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -5985,7 +5985,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
)
return (
isSuspenseInstanceFallback(nextInstance)
? (workInProgress.lanes = 16)
? (workInProgress.lanes = 32)
: (workInProgress.lanes = 536870912),
null
);
Expand Down Expand Up @@ -17013,14 +17013,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1755 = React.version;
if (
"19.1.0-www-modern-0d67cc06-20241214" !==
"19.1.0-www-modern-d1dd7fea-20241214" !==
isomorphicReactPackageVersion$jscomp$inline_1755
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1755,
"19.1.0-www-modern-0d67cc06-20241214"
"19.1.0-www-modern-d1dd7fea-20241214"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17038,10 +17038,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2288 = {
bundleType: 0,
version: "19.1.0-www-modern-0d67cc06-20241214",
version: "19.1.0-www-modern-d1dd7fea-20241214",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-modern-d1dd7fea-20241214"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2289 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17406,4 +17406,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-0d67cc06-20241214";
exports.version = "19.1.0-www-modern-d1dd7fea-20241214";
12 changes: 6 additions & 6 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -6399,7 +6399,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
)
return (
isSuspenseInstanceFallback(nextInstance)
? (workInProgress.lanes = 16)
? (workInProgress.lanes = 32)
: (workInProgress.lanes = 536870912),
null
);
Expand Down Expand Up @@ -17971,14 +17971,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1858 = React.version;
if (
"19.1.0-www-classic-0d67cc06-20241214" !==
"19.1.0-www-classic-d1dd7fea-20241214" !==
isomorphicReactPackageVersion$jscomp$inline_1858
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1858,
"19.1.0-www-classic-0d67cc06-20241214"
"19.1.0-www-classic-d1dd7fea-20241214"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17996,10 +17996,10 @@ Internals.Events = [
];
var internals$jscomp$inline_1860 = {
bundleType: 0,
version: "19.1.0-www-classic-0d67cc06-20241214",
version: "19.1.0-www-classic-d1dd7fea-20241214",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-0d67cc06-20241214"
reconcilerVersion: "19.1.0-www-classic-d1dd7fea-20241214"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1860.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -18367,7 +18367,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-0d67cc06-20241214";
exports.version = "19.1.0-www-classic-d1dd7fea-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 82c0c10

Please sign in to comment.