Skip to content

Commit

Permalink
[Fizz] Support aborting with Postpone (#28183)
Browse files Browse the repository at this point in the history
Semantically if you make your reason for aborting a Postpone instance
the render should not hit the error pathways but should instead follow
the postpone pathways. It's awkward today to actually get your hands on
a Postpone instance because you have to catch the throw from postpone
and then pass that into `abort()` or `AbortController.abort()`
(depending on the renderer API you are using)

This change makes it so that in most circumstances if you abort with a
postpone the `onPostpone` handler will be called and the Suspense
boundaries still pending will be put into client render mode with the
appropriate postpone digest to avoid trigger recoverable error pathways
on the client.

Similar to postponing in the shell during a resume or render however if
you abort before the shell is complete in a resume or render we will
fatally error. The fatal error is contextualized by React to avoid
passing the postpone object itself to the `onError` and related options.

DiffTrain build for commit 1219d57.
  • Loading branch information
gnoff committed Feb 1, 2024
1 parent bedf028 commit 012c527
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25623,7 +25623,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-d29f7d973-20240131";
var ReactVersion = "18.3.0-canary-1219d57fc-20240201";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9149,7 +9149,7 @@ var devToolsConfig$jscomp$inline_1031 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-d29f7d973-20240131",
version: "18.3.0-canary-1219d57fc-20240201",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1207 = {
Expand Down Expand Up @@ -9180,7 +9180,7 @@ var internals$jscomp$inline_1207 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-d29f7d973-20240131"
reconcilerVersion: "18.3.0-canary-1219d57fc-20240201"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1208 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9577,7 +9577,7 @@ var devToolsConfig$jscomp$inline_1073 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-d29f7d973-20240131",
version: "18.3.0-canary-1219d57fc-20240201",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1248 = {
Expand Down Expand Up @@ -9608,7 +9608,7 @@ var internals$jscomp$inline_1248 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-d29f7d973-20240131"
reconcilerVersion: "18.3.0-canary-1219d57fc-20240201"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1249 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-d29f7d973-20240131";
var ReactVersion = "18.3.0-canary-1219d57fc-20240201";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,4 +545,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-d29f7d973-20240131";
exports.version = "18.3.0-canary-1219d57fc-20240201";
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-d29f7d973-20240131";
exports.version = "18.3.0-canary-1219d57fc-20240201";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d29f7d973da616a02d6240ea10306a6f33e35ca1
1219d57fc9fcbf44c873c0b10e5acbd31f613c15

0 comments on commit 012c527

Please sign in to comment.