Skip to content

Commit 2a2d2f8

Browse files
committed
[Fiber] Use hydration lanes when scheduling hydration work (#31751)
When scheduling the initial root and when using `unstable_scheduleHydration` we should use the Hydration Lanes rather than the raw update lane. This ensures that we're always hydrating using a Hydration Lane or the Offscreen Lane rather than other lanes getting some random hydration in it. This fixes an issue where updating a root while it is still hydrating causes it to trigger client rendering when it could just hydrate and then apply the update on top of that. It also fixes a potential performance issue where `unstable_scheduleHydration` gets batched with an update that then ends up forcing an update of a boundary that requires it to rewind to do the hydration lane anyway. Might as well just start with the hydration without the update applied first. I added a kill switch (`enableHydrationLaneScheduling`) just in case but seems very safe given that using `unstable_scheduleHydration` at all is very rare and updating the root before the shell hydrates is extremely rare (and used to trigger a recoverable error). DiffTrain build for [d5e8f79](d5e8f79)
1 parent 0bcbbf0 commit 2a2d2f8

34 files changed

+1034
-912
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a4964987dc140526702e996223fe7ee293def8ac
1+
d5e8f79cf4d11fa7eee263b3f937deecbe65ffd7
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a4964987dc140526702e996223fe7ee293def8ac
1+
d5e8f79cf4d11fa7eee263b3f937deecbe65ffd7

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ __DEV__ &&
19541954
exports.useTransition = function () {
19551955
return resolveDispatcher().useTransition();
19561956
};
1957-
exports.version = "19.0.0-www-classic-a4964987-20241211";
1957+
exports.version = "19.1.0-www-classic-d5e8f79c-20241212";
19581958
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19591959
"function" ===
19601960
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ __DEV__ &&
19541954
exports.useTransition = function () {
19551955
return resolveDispatcher().useTransition();
19561956
};
1957-
exports.version = "19.0.0-www-modern-a4964987-20241211";
1957+
exports.version = "19.1.0-www-modern-d5e8f79c-20241212";
19581958
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19591959
"function" ===
19601960
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
635635
exports.useTransition = function () {
636636
return ReactSharedInternals.H.useTransition();
637637
};
638-
exports.version = "19.0.0-www-classic-a4964987-20241211";
638+
exports.version = "19.1.0-www-classic-d5e8f79c-20241212";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
635635
exports.useTransition = function () {
636636
return ReactSharedInternals.H.useTransition();
637637
};
638-
exports.version = "19.0.0-www-modern-a4964987-20241211";
638+
exports.version = "19.1.0-www-modern-d5e8f79c-20241212";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
639639
exports.useTransition = function () {
640640
return ReactSharedInternals.H.useTransition();
641641
};
642-
exports.version = "19.0.0-www-classic-a4964987-20241211";
642+
exports.version = "19.1.0-www-classic-d5e8f79c-20241212";
643643
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
644644
"function" ===
645645
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
639639
exports.useTransition = function () {
640640
return ReactSharedInternals.H.useTransition();
641641
};
642-
exports.version = "19.0.0-www-modern-a4964987-20241211";
642+
exports.version = "19.1.0-www-modern-d5e8f79c-20241212";
643643
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
644644
"function" ===
645645
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17237,10 +17237,10 @@ __DEV__ &&
1723717237
(function () {
1723817238
var internals = {
1723917239
bundleType: 1,
17240-
version: "19.0.0-www-classic-a4964987-20241211",
17240+
version: "19.1.0-www-classic-d5e8f79c-20241212",
1724117241
rendererPackageName: "react-art",
1724217242
currentDispatcherRef: ReactSharedInternals,
17243-
reconcilerVersion: "19.0.0-www-classic-a4964987-20241211"
17243+
reconcilerVersion: "19.1.0-www-classic-d5e8f79c-20241212"
1724417244
};
1724517245
internals.overrideHookState = overrideHookState;
1724617246
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17274,7 +17274,7 @@ __DEV__ &&
1727417274
exports.Shape = Shape;
1727517275
exports.Surface = Surface;
1727617276
exports.Text = Text;
17277-
exports.version = "19.0.0-www-classic-a4964987-20241211";
17277+
exports.version = "19.1.0-www-classic-d5e8f79c-20241212";
1727817278
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1727917279
"function" ===
1728017280
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17000,10 +17000,10 @@ __DEV__ &&
1700017000
(function () {
1700117001
var internals = {
1700217002
bundleType: 1,
17003-
version: "19.0.0-www-modern-a4964987-20241211",
17003+
version: "19.1.0-www-modern-d5e8f79c-20241212",
1700417004
rendererPackageName: "react-art",
1700517005
currentDispatcherRef: ReactSharedInternals,
17006-
reconcilerVersion: "19.0.0-www-modern-a4964987-20241211"
17006+
reconcilerVersion: "19.1.0-www-modern-d5e8f79c-20241212"
1700717007
};
1700817008
internals.overrideHookState = overrideHookState;
1700917009
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17037,7 +17037,7 @@ __DEV__ &&
1703717037
exports.Shape = Shape;
1703817038
exports.Surface = Surface;
1703917039
exports.Text = Text;
17040-
exports.version = "19.0.0-www-modern-a4964987-20241211";
17040+
exports.version = "19.1.0-www-modern-d5e8f79c-20241212";
1704117041
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1704217042
"function" ===
1704317043
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)