Skip to content

Commit 8d4a351

Browse files
committed
Hide/unhide the content of dehydrated suspense boundaries if they resuspend (#32900)
Found this bug while working on Activity. There's a weird edge case when a dehydrated Suspense boundary is a direct child of another Suspense boundary which is hydrated but then it resuspends without forcing the inner one to hydrate/delete. It used to just leave that in place because hiding/unhiding didn't deal with dehydrated fragments. Not sure this is really worth fixing. DiffTrain build for [ebf7318](ebf7318)
1 parent afed35b commit 8d4a351

34 files changed

+1658
-1038
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b303610c33ab903f6f0d9d1c6297b704781b3678
1+
ebf7318e87cf2e10b6bd9a6bb0ad8bf6f6186f80
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b303610c33ab903f6f0d9d1c6297b704781b3678
1+
ebf7318e87cf2e10b6bd9a6bb0ad8bf6f6186f80

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ __DEV__ &&
15381538
exports.useTransition = function () {
15391539
return resolveDispatcher().useTransition();
15401540
};
1541-
exports.version = "19.2.0-www-classic-b303610c-20250421";
1541+
exports.version = "19.2.0-www-classic-ebf7318e-20250422";
15421542
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15431543
"function" ===
15441544
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
@@ -1538,7 +1538,7 @@ __DEV__ &&
15381538
exports.useTransition = function () {
15391539
return resolveDispatcher().useTransition();
15401540
};
1541-
exports.version = "19.2.0-www-modern-b303610c-20250421";
1541+
exports.version = "19.2.0-www-modern-ebf7318e-20250422";
15421542
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15431543
"function" ===
15441544
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
@@ -636,4 +636,4 @@ exports.useSyncExternalStore = function (
636636
exports.useTransition = function () {
637637
return ReactSharedInternals.H.useTransition();
638638
};
639-
exports.version = "19.2.0-www-classic-b303610c-20250421";
639+
exports.version = "19.2.0-www-classic-ebf7318e-20250422";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,4 +636,4 @@ exports.useSyncExternalStore = function (
636636
exports.useTransition = function () {
637637
return ReactSharedInternals.H.useTransition();
638638
};
639-
exports.version = "19.2.0-www-modern-b303610c-20250421";
639+
exports.version = "19.2.0-www-modern-ebf7318e-20250422";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ exports.useSyncExternalStore = function (
640640
exports.useTransition = function () {
641641
return ReactSharedInternals.H.useTransition();
642642
};
643-
exports.version = "19.2.0-www-classic-b303610c-20250421";
643+
exports.version = "19.2.0-www-classic-ebf7318e-20250422";
644644
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
645645
"function" ===
646646
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
@@ -640,7 +640,7 @@ exports.useSyncExternalStore = function (
640640
exports.useTransition = function () {
641641
return ReactSharedInternals.H.useTransition();
642642
};
643-
exports.version = "19.2.0-www-modern-b303610c-20250421";
643+
exports.version = "19.2.0-www-modern-ebf7318e-20250422";
644644
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
645645
"function" ===
646646
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11923,6 +11923,26 @@ __DEV__ &&
1192311923
captureCommitPhaseError(lanes, lanes.return, error);
1192411924
}
1192511925
}
11926+
} else if (18 === root.tag) {
11927+
if (null === current) {
11928+
lanes = root;
11929+
try {
11930+
var instance$jscomp$0 = lanes.stateNode;
11931+
suspenseCallback
11932+
? runWithFiberInDEV(
11933+
lanes,
11934+
hideSuspenseBoundary,
11935+
instance$jscomp$0
11936+
)
11937+
: runWithFiberInDEV(
11938+
lanes,
11939+
unhideSuspenseBoundary,
11940+
lanes.stateNode
11941+
);
11942+
} catch (error) {
11943+
captureCommitPhaseError(lanes, lanes.return, error);
11944+
}
11945+
}
1192611946
} else if (
1192711947
((22 !== root.tag && 23 !== root.tag) ||
1192811948
null === root.memoizedState ||
@@ -16416,6 +16436,8 @@ __DEV__ &&
1641616436
registerSuspenseInstanceRetry = shim$2,
1641716437
clearSuspenseBoundary = shim$2,
1641816438
clearSuspenseBoundaryFromContainer = shim$2,
16439+
hideSuspenseBoundary = shim$2,
16440+
unhideSuspenseBoundary = shim$2,
1641916441
prepareScopeUpdate = shim$1,
1642016442
getInstanceFromScope = shim$1,
1642116443
preloadResource = shim,
@@ -18558,10 +18580,10 @@ __DEV__ &&
1855818580
(function () {
1855918581
var internals = {
1856018582
bundleType: 1,
18561-
version: "19.2.0-www-classic-b303610c-20250421",
18583+
version: "19.2.0-www-classic-ebf7318e-20250422",
1856218584
rendererPackageName: "react-art",
1856318585
currentDispatcherRef: ReactSharedInternals,
18564-
reconcilerVersion: "19.2.0-www-classic-b303610c-20250421"
18586+
reconcilerVersion: "19.2.0-www-classic-ebf7318e-20250422"
1856518587
};
1856618588
internals.overrideHookState = overrideHookState;
1856718589
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18595,7 +18617,7 @@ __DEV__ &&
1859518617
exports.Shape = Shape;
1859618618
exports.Surface = Surface;
1859718619
exports.Text = Text;
18598-
exports.version = "19.2.0-www-classic-b303610c-20250421";
18620+
exports.version = "19.2.0-www-classic-ebf7318e-20250422";
1859918621
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1860018622
"function" ===
1860118623
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11741,6 +11741,26 @@ __DEV__ &&
1174111741
captureCommitPhaseError(lanes, lanes.return, error);
1174211742
}
1174311743
}
11744+
} else if (18 === root.tag) {
11745+
if (null === current) {
11746+
lanes = root;
11747+
try {
11748+
var instance$jscomp$0 = lanes.stateNode;
11749+
suspenseCallback
11750+
? runWithFiberInDEV(
11751+
lanes,
11752+
hideSuspenseBoundary,
11753+
instance$jscomp$0
11754+
)
11755+
: runWithFiberInDEV(
11756+
lanes,
11757+
unhideSuspenseBoundary,
11758+
lanes.stateNode
11759+
);
11760+
} catch (error) {
11761+
captureCommitPhaseError(lanes, lanes.return, error);
11762+
}
11763+
}
1174411764
} else if (
1174511765
((22 !== root.tag && 23 !== root.tag) ||
1174611766
null === root.memoizedState ||
@@ -16193,6 +16213,8 @@ __DEV__ &&
1619316213
registerSuspenseInstanceRetry = shim$2,
1619416214
clearSuspenseBoundary = shim$2,
1619516215
clearSuspenseBoundaryFromContainer = shim$2,
16216+
hideSuspenseBoundary = shim$2,
16217+
unhideSuspenseBoundary = shim$2,
1619616218
prepareScopeUpdate = shim$1,
1619716219
getInstanceFromScope = shim$1,
1619816220
preloadResource = shim,
@@ -18330,10 +18352,10 @@ __DEV__ &&
1833018352
(function () {
1833118353
var internals = {
1833218354
bundleType: 1,
18333-
version: "19.2.0-www-modern-b303610c-20250421",
18355+
version: "19.2.0-www-modern-ebf7318e-20250422",
1833418356
rendererPackageName: "react-art",
1833518357
currentDispatcherRef: ReactSharedInternals,
18336-
reconcilerVersion: "19.2.0-www-modern-b303610c-20250421"
18358+
reconcilerVersion: "19.2.0-www-modern-ebf7318e-20250422"
1833718359
};
1833818360
internals.overrideHookState = overrideHookState;
1833918361
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18367,7 +18389,7 @@ __DEV__ &&
1836718389
exports.Shape = Shape;
1836818390
exports.Surface = Surface;
1836918391
exports.Text = Text;
18370-
exports.version = "19.2.0-www-modern-b303610c-20250421";
18392+
exports.version = "19.2.0-www-modern-ebf7318e-20250422";
1837118393
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1837218394
"function" ===
1837318395
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)