Skip to content

Commit d27b809

Browse files
committed
[Fiber] Support Suspense boundaries anywhere (excluding hydration) (facebook#32163)
This is a follow up to facebook#32069 In the prior change I updated Fizz to allow you to render Suspense boundaries at any level within a react-dom application by treating the document body as the default render scope. This change updates Fiber to provide similar semantics. Note that this update still does not deliver hydration so unifying the Fizz and Fiber implementations in a single App is not possible yet. The implementation required a rework of the getHostSibling and getHostParent algorithms. Now most HostSingletons are invisible from a host positioning perspective. Head is special in that it is a valid host scope so when you have Placements inside of it, it will act as the parent. But body, and html, will not directly participate in host positioning. Additionally to support flipping to a fallback html, head, and body tag in a Suspense fallback I updated the offscreen hiding/unhide logic to pierce through singletons when lookin for matching hidable nod boundaries anywhere (excluding hydration) DiffTrain build for [c492f97](facebook@c492f97)
1 parent 3d7a07d commit d27b809

34 files changed

+4114
-3442
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b65afdd0c1f644f3630c4e8cfd9ac264c5ac329f
1+
c492f97541486458ce21653d2669d53d380f0538
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b65afdd0c1f644f3630c4e8cfd9ac264c5ac329f
1+
c492f97541486458ce21653d2669d53d380f0538

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,7 @@ __DEV__ &&
19571957
exports.useTransition = function () {
19581958
return resolveDispatcher().useTransition();
19591959
};
1960-
exports.version = "19.1.0-www-classic-b65afdd0-20250124";
1960+
exports.version = "19.1.0-www-classic-c492f975-20250128";
19611961
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19621962
"function" ===
19631963
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
@@ -1957,7 +1957,7 @@ __DEV__ &&
19571957
exports.useTransition = function () {
19581958
return resolveDispatcher().useTransition();
19591959
};
1960-
exports.version = "19.1.0-www-modern-b65afdd0-20250124";
1960+
exports.version = "19.1.0-www-modern-c492f975-20250128";
19611961
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19621962
"function" ===
19631963
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
@@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
630630
exports.useTransition = function () {
631631
return ReactSharedInternals.H.useTransition();
632632
};
633-
exports.version = "19.1.0-www-classic-b65afdd0-20250124";
633+
exports.version = "19.1.0-www-classic-c492f975-20250128";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
630630
exports.useTransition = function () {
631631
return ReactSharedInternals.H.useTransition();
632632
};
633-
exports.version = "19.1.0-www-modern-b65afdd0-20250124";
633+
exports.version = "19.1.0-www-modern-c492f975-20250128";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.1.0-www-classic-b65afdd0-20250124";
637+
exports.version = "19.1.0-www-classic-c492f975-20250128";
638638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
639639
"function" ===
640640
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
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.1.0-www-modern-b65afdd0-20250124";
637+
exports.version = "19.1.0-www-modern-c492f975-20250128";
638638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
639639
"function" ===
640640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10380,8 +10380,8 @@ __DEV__ &&
1038010380
}
1038110381
finishedRoot.effectDuration += popNestedEffectDurations(current);
1038210382
break;
10383-
case 26:
1038410383
case 27:
10384+
case 26:
1038510385
case 5:
1038610386
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
1038710387
null === current && flags & 4 && commitHostMount(finishedWork);
@@ -11140,10 +11140,10 @@ __DEV__ &&
1114011140
? root._visibility & -2
1114111141
: root._visibility | 1),
1114211142
suspenseCallback &&
11143-
((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden),
11144-
null === current ||
11143+
(null === current ||
1114511144
retryQueue ||
11146-
root ||
11145+
offscreenSubtreeIsHidden ||
11146+
offscreenSubtreeWasHidden ||
1114711147
recursivelyTraverseDisappearLayoutEffects(finishedWork)),
1114811148
null === finishedWork.memoizedProps ||
1114911149
"manual" !== finishedWork.memoizedProps.mode)
@@ -11292,8 +11292,8 @@ __DEV__ &&
1129211292
);
1129311293
recursivelyTraverseDisappearLayoutEffects(finishedWork);
1129411294
break;
11295-
case 26:
1129611295
case 27:
11296+
case 26:
1129711297
case 5:
1129811298
safelyDetachRef(finishedWork, finishedWork.return);
1129911299
recursivelyTraverseDisappearLayoutEffects(finishedWork);
@@ -11367,8 +11367,8 @@ __DEV__ &&
1136711367
commitClassCallbacks(finishedWork);
1136811368
safelyAttachRef(finishedWork, finishedWork.return);
1136911369
break;
11370-
case 26:
1137111370
case 27:
11371+
case 26:
1137211372
case 5:
1137311373
recursivelyTraverseReappearLayoutEffects(
1137411374
finishedRoot,
@@ -16950,10 +16950,10 @@ __DEV__ &&
1695016950
(function () {
1695116951
var internals = {
1695216952
bundleType: 1,
16953-
version: "19.1.0-www-classic-b65afdd0-20250124",
16953+
version: "19.1.0-www-classic-c492f975-20250128",
1695416954
rendererPackageName: "react-art",
1695516955
currentDispatcherRef: ReactSharedInternals,
16956-
reconcilerVersion: "19.1.0-www-classic-b65afdd0-20250124"
16956+
reconcilerVersion: "19.1.0-www-classic-c492f975-20250128"
1695716957
};
1695816958
internals.overrideHookState = overrideHookState;
1695916959
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16987,7 +16987,7 @@ __DEV__ &&
1698716987
exports.Shape = Shape;
1698816988
exports.Surface = Surface;
1698916989
exports.Text = Text;
16990-
exports.version = "19.1.0-www-classic-b65afdd0-20250124";
16990+
exports.version = "19.1.0-www-classic-c492f975-20250128";
1699116991
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1699216992
"function" ===
1699316993
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10198,8 +10198,8 @@ __DEV__ &&
1019810198
}
1019910199
finishedRoot.effectDuration += popNestedEffectDurations(current);
1020010200
break;
10201-
case 26:
1020210201
case 27:
10202+
case 26:
1020310203
case 5:
1020410204
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
1020510205
null === current && flags & 4 && commitHostMount(finishedWork);
@@ -10958,10 +10958,10 @@ __DEV__ &&
1095810958
? root._visibility & -2
1095910959
: root._visibility | 1),
1096010960
suspenseCallback &&
10961-
((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden),
10962-
null === current ||
10961+
(null === current ||
1096310962
retryQueue ||
10964-
root ||
10963+
offscreenSubtreeIsHidden ||
10964+
offscreenSubtreeWasHidden ||
1096510965
recursivelyTraverseDisappearLayoutEffects(finishedWork)),
1096610966
null === finishedWork.memoizedProps ||
1096710967
"manual" !== finishedWork.memoizedProps.mode)
@@ -11110,8 +11110,8 @@ __DEV__ &&
1111011110
);
1111111111
recursivelyTraverseDisappearLayoutEffects(finishedWork);
1111211112
break;
11113-
case 26:
1111411113
case 27:
11114+
case 26:
1111511115
case 5:
1111611116
safelyDetachRef(finishedWork, finishedWork.return);
1111711117
recursivelyTraverseDisappearLayoutEffects(finishedWork);
@@ -11185,8 +11185,8 @@ __DEV__ &&
1118511185
commitClassCallbacks(finishedWork);
1118611186
safelyAttachRef(finishedWork, finishedWork.return);
1118711187
break;
11188-
case 26:
1118911188
case 27:
11189+
case 26:
1119011190
case 5:
1119111191
recursivelyTraverseReappearLayoutEffects(
1119211192
finishedRoot,
@@ -16722,10 +16722,10 @@ __DEV__ &&
1672216722
(function () {
1672316723
var internals = {
1672416724
bundleType: 1,
16725-
version: "19.1.0-www-modern-b65afdd0-20250124",
16725+
version: "19.1.0-www-modern-c492f975-20250128",
1672616726
rendererPackageName: "react-art",
1672716727
currentDispatcherRef: ReactSharedInternals,
16728-
reconcilerVersion: "19.1.0-www-modern-b65afdd0-20250124"
16728+
reconcilerVersion: "19.1.0-www-modern-c492f975-20250128"
1672916729
};
1673016730
internals.overrideHookState = overrideHookState;
1673116731
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16759,7 +16759,7 @@ __DEV__ &&
1675916759
exports.Shape = Shape;
1676016760
exports.Surface = Surface;
1676116761
exports.Text = Text;
16762-
exports.version = "19.1.0-www-modern-b65afdd0-20250124";
16762+
exports.version = "19.1.0-www-modern-c492f975-20250128";
1676316763
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1676416764
"function" ===
1676516765
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)