Skip to content

Commit a009a75

Browse files
committed
[Fizz] Outline if a boundary would add too many bytes to the next completion (#33029)
Follow up to #33027. This enhances the heuristic so that we accumulate the size of the currently written boundaries. Starting from the size of the root (minus preamble) for the shell. This ensures that if you have many small boundaries they don't all continue to get inlined. For example, you can wrap each paragraph in a document in a Suspense boundary to regain document streaming capabilities if that's what you want. However, one consideration is if it's worth producing a fallback at all. Maybe if it's like `null` it's free but if it's like a whole alternative page, then it's not. It's possible to have completely useless Suspense boundaries such as when you nest several directly inside each other. So this uses a limit of at least 500 bytes of the content itself for it to be worth outlining at all. It also can't be too small because then for example a long list of paragraphs can never be outlined. In the fixture I straddle this limit so some paragraphs are too small to be considered. An unfortunate effect of that is that you can end up with some of them not being outlined which means that they appear out of order. SuspenseList is supposed to address that but it's unfortunate. The limit is still fairly high though so it's unlikely that by default you'd start outlining anything within the viewport at all. I had to reduce the `progressiveChunkSize` by an order of magnitude in my fixture to try it out properly. DiffTrain build for [18212ca](18212ca)
1 parent 9e80ede commit a009a75

36 files changed

+161
-117
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
88b976740467f9dfabae03c79a8eff9033c35050
1+
18212ca960ee2f0acf538c2198f7ba36c3042ecd
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
88b976740467f9dfabae03c79a8eff9033c35050
1+
18212ca960ee2f0acf538c2198f7ba36c3042ecd

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-88b97674-20250429";
1541+
exports.version = "19.2.0-www-classic-18212ca9-20250429";
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-88b97674-20250429";
1541+
exports.version = "19.2.0-www-modern-18212ca9-20250429";
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-88b97674-20250429";
639+
exports.version = "19.2.0-www-classic-18212ca9-20250429";

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-88b97674-20250429";
639+
exports.version = "19.2.0-www-modern-18212ca9-20250429";

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-88b97674-20250429";
643+
exports.version = "19.2.0-www-classic-18212ca9-20250429";
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-88b97674-20250429";
643+
exports.version = "19.2.0-www-modern-18212ca9-20250429";
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18800,10 +18800,10 @@ __DEV__ &&
1880018800
(function () {
1880118801
var internals = {
1880218802
bundleType: 1,
18803-
version: "19.2.0-www-classic-88b97674-20250429",
18803+
version: "19.2.0-www-classic-18212ca9-20250429",
1880418804
rendererPackageName: "react-art",
1880518805
currentDispatcherRef: ReactSharedInternals,
18806-
reconcilerVersion: "19.2.0-www-classic-88b97674-20250429"
18806+
reconcilerVersion: "19.2.0-www-classic-18212ca9-20250429"
1880718807
};
1880818808
internals.overrideHookState = overrideHookState;
1880918809
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18837,7 +18837,7 @@ __DEV__ &&
1883718837
exports.Shape = Shape;
1883818838
exports.Surface = Surface;
1883918839
exports.Text = Text;
18840-
exports.version = "19.2.0-www-classic-88b97674-20250429";
18840+
exports.version = "19.2.0-www-classic-18212ca9-20250429";
1884118841
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1884218842
"function" ===
1884318843
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
@@ -18572,10 +18572,10 @@ __DEV__ &&
1857218572
(function () {
1857318573
var internals = {
1857418574
bundleType: 1,
18575-
version: "19.2.0-www-modern-88b97674-20250429",
18575+
version: "19.2.0-www-modern-18212ca9-20250429",
1857618576
rendererPackageName: "react-art",
1857718577
currentDispatcherRef: ReactSharedInternals,
18578-
reconcilerVersion: "19.2.0-www-modern-88b97674-20250429"
18578+
reconcilerVersion: "19.2.0-www-modern-18212ca9-20250429"
1857918579
};
1858018580
internals.overrideHookState = overrideHookState;
1858118581
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18609,7 +18609,7 @@ __DEV__ &&
1860918609
exports.Shape = Shape;
1861018610
exports.Surface = Surface;
1861118611
exports.Text = Text;
18612-
exports.version = "19.2.0-www-modern-88b97674-20250429";
18612+
exports.version = "19.2.0-www-modern-18212ca9-20250429";
1861318613
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1861418614
"function" ===
1861518615
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)