Skip to content

Commit 7cc8093

Browse files
committed
[Fizz] Error and deopt from rel=expect for large documents without boundaries (#33454)
We want to make sure that we can block the reveal of a well designed complete shell reliably. In the Suspense model, client transitions don't have any way to implicitly resolve. This means you need to use Suspense or SuspenseList to explicitly split the document. Relying on implicit would mean you can't add a Suspense boundary later where needed. So we highly encourage the use of them around large content. However, if you have constructed a too large shell (e.g. by not adding any Suspense boundaries at all) then that might take too long to render on the client. We shouldn't punish users (or overzealous metrics tracking tools like search engines) in that scenario. This opts out of render blocking if the shell ends up too large to be intentional and too slow to load. Instead it deopts to showing the content split up in arbitrary ways (browser default). It only does this for SSR, and not client navs so it's not reliable. In fact, we issue an error to `onError`. This error is recoverable in that the document is still produced. It's up to your framework to decide if this errors the build or just surface it for action later. What should be the limit though? There's a trade off here. If this limit is too low then you can't fit a reasonably well built UI within it without getting errors. If it's too high then things that accidentally fall below it might take too long to load. I came up with 512kB of uncompressed shell HTML. See the comment in code for the rationale for this number. TL;DR: Data and theory indicates that having this much content inside `rel="expect"` doesn't meaningfully change metrics. Research of above-the-fold content on various websites indicate that this can comfortable fit all of them which should be enough for any intentional initial paint. DiffTrain build for [d177272](d177272)
1 parent 57de703 commit 7cc8093

36 files changed

+312
-260
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22b929156c325eaf52c375f0c62801831951814a
1+
d177272802b7f86a847312c23b7e60a6f56434de
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22b929156c325eaf52c375f0c62801831951814a
1+
d177272802b7f86a847312c23b7e60a6f56434de

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ __DEV__ &&
15371537
exports.useTransition = function () {
15381538
return resolveDispatcher().useTransition();
15391539
};
1540-
exports.version = "19.2.0-www-classic-22b92915-20250606";
1540+
exports.version = "19.2.0-www-classic-d1772728-20250606";
15411541
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15421542
"function" ===
15431543
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
@@ -1537,7 +1537,7 @@ __DEV__ &&
15371537
exports.useTransition = function () {
15381538
return resolveDispatcher().useTransition();
15391539
};
1540-
exports.version = "19.2.0-www-modern-22b92915-20250606";
1540+
exports.version = "19.2.0-www-modern-d1772728-20250606";
15411541
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15421542
"function" ===
15431543
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.2.0-www-classic-22b92915-20250606";
638+
exports.version = "19.2.0-www-classic-d1772728-20250606";

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.2.0-www-modern-22b92915-20250606";
638+
exports.version = "19.2.0-www-modern-d1772728-20250606";

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.2.0-www-classic-22b92915-20250606";
642+
exports.version = "19.2.0-www-classic-d1772728-20250606";
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.2.0-www-modern-22b92915-20250606";
642+
exports.version = "19.2.0-www-modern-d1772728-20250606";
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
@@ -19105,10 +19105,10 @@ __DEV__ &&
1910519105
(function () {
1910619106
var internals = {
1910719107
bundleType: 1,
19108-
version: "19.2.0-www-classic-22b92915-20250606",
19108+
version: "19.2.0-www-classic-d1772728-20250606",
1910919109
rendererPackageName: "react-art",
1911019110
currentDispatcherRef: ReactSharedInternals,
19111-
reconcilerVersion: "19.2.0-www-classic-22b92915-20250606"
19111+
reconcilerVersion: "19.2.0-www-classic-d1772728-20250606"
1911219112
};
1911319113
internals.overrideHookState = overrideHookState;
1911419114
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19142,7 +19142,7 @@ __DEV__ &&
1914219142
exports.Shape = Shape;
1914319143
exports.Surface = Surface;
1914419144
exports.Text = Text;
19145-
exports.version = "19.2.0-www-classic-22b92915-20250606";
19145+
exports.version = "19.2.0-www-classic-d1772728-20250606";
1914619146
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1914719147
"function" ===
1914819148
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
@@ -18877,10 +18877,10 @@ __DEV__ &&
1887718877
(function () {
1887818878
var internals = {
1887918879
bundleType: 1,
18880-
version: "19.2.0-www-modern-22b92915-20250606",
18880+
version: "19.2.0-www-modern-d1772728-20250606",
1888118881
rendererPackageName: "react-art",
1888218882
currentDispatcherRef: ReactSharedInternals,
18883-
reconcilerVersion: "19.2.0-www-modern-22b92915-20250606"
18883+
reconcilerVersion: "19.2.0-www-modern-d1772728-20250606"
1888418884
};
1888518885
internals.overrideHookState = overrideHookState;
1888618886
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18914,7 +18914,7 @@ __DEV__ &&
1891418914
exports.Shape = Shape;
1891518915
exports.Surface = Surface;
1891618916
exports.Text = Text;
18917-
exports.version = "19.2.0-www-modern-22b92915-20250606";
18917+
exports.version = "19.2.0-www-modern-d1772728-20250606";
1891818918
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1891918919
"function" ===
1892018920
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)