Skip to content

Commit

Permalink
[Fizz] handle throwing after abort during render (#30730)
Browse files Browse the repository at this point in the history
It is possible to throw after aborting during a render and we were not
properly tracking this. We use an AbortSigil to mark whether a rendering
task needs to abort but the throw interrupts that and we end up handling
an error on the error pathway instead.

This change reworks the abort-while-rendering support to be robust to
throws after calling abort

DiffTrain build for [7954db9](7954db9)
  • Loading branch information
gnoff committed Aug 17, 2024
1 parent b41f0cd commit 6f94ca8
Show file tree
Hide file tree
Showing 36 changed files with 148 additions and 147 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7e8a06cf4c628be45171da52c1a8e97f9869b7ee
7954db9398b9afa962167577a6c6940be3856c39
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7e8a06cf4c628be45171da52c1a8e97f9869b7ee
7954db9398b9afa962167577a6c6940be3856c39
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-7e8a06cf-20240815";
exports.version = "19.0.0-www-classic-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-7e8a06cf-20240815";
exports.version = "19.0.0-www-modern-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-7e8a06cf-20240815";
exports.version = "19.0.0-www-classic-7954db93-20240816";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-7e8a06cf-20240815";
exports.version = "19.0.0-www-modern-7954db93-20240816";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-7e8a06cf-20240815";
exports.version = "19.0.0-www-classic-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-7e8a06cf-20240815";
exports.version = "19.0.0-www-modern-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16776,11 +16776,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-7e8a06cf-20240815",
version: "19.0.0-www-classic-7954db93-20240816",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-classic-7954db93-20240816"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16814,7 +16814,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-7e8a06cf-20240815";
exports.version = "19.0.0-www-classic-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16189,11 +16189,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-7e8a06cf-20240815",
version: "19.0.0-www-modern-7954db93-20240816",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-modern-7954db93-20240816"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16227,7 +16227,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-7e8a06cf-20240815";
exports.version = "19.0.0-www-modern-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10618,13 +10618,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1361 = {
bundleType: 0,
version: "19.0.0-www-classic-7e8a06cf-20240815",
version: "19.0.0-www-classic-7954db93-20240816",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-classic-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-classic-7954db93-20240816"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1362 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10650,4 +10650,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-classic-7e8a06cf-20240815";
exports.version = "19.0.0-www-classic-7954db93-20240816";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10132,13 +10132,13 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1353 = {
bundleType: 0,
version: "19.0.0-www-modern-7e8a06cf-20240815",
version: "19.0.0-www-modern-7954db93-20240816",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function () {
return null;
},
reconcilerVersion: "19.0.0-www-modern-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-modern-7954db93-20240816"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1354 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10164,4 +10164,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.0.0-www-modern-7e8a06cf-20240815";
exports.version = "19.0.0-www-modern-7954db93-20240816";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27528,11 +27528,11 @@ __DEV__ &&
: flushSyncErrorInBuildsThatSupportLegacyMode;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-classic-7e8a06cf-20240815" !== isomorphicReactPackageVersion)
if ("19.0.0-www-classic-7954db93-20240816" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-classic-7e8a06cf-20240815\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-classic-7954db93-20240816\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27576,11 +27576,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-classic-7e8a06cf-20240815",
version: "19.0.0-www-classic-7954db93-20240816",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-classic-7954db93-20240816"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -28233,7 +28233,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-7e8a06cf-20240815";
exports.version = "19.0.0-www-classic-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -26613,11 +26613,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-modern-7e8a06cf-20240815" !== isomorphicReactPackageVersion)
if ("19.0.0-www-modern-7954db93-20240816" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-modern-7e8a06cf-20240815\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-modern-7954db93-20240816\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26660,11 +26660,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-www-modern-7e8a06cf-20240815",
version: "19.0.0-www-modern-7954db93-20240816",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-modern-7954db93-20240816"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -27269,7 +27269,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-7e8a06cf-20240815";
exports.version = "19.0.0-www-modern-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17170,14 +17170,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1753 = React.version;
if (
"19.0.0-www-classic-7e8a06cf-20240815" !==
"19.0.0-www-classic-7954db93-20240816" !==
isomorphicReactPackageVersion$jscomp$inline_1753
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1753,
"19.0.0-www-classic-7e8a06cf-20240815"
"19.0.0-www-classic-7954db93-20240816"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -17222,11 +17222,11 @@ Internals.Events = [
];
var internals$jscomp$inline_2208 = {
bundleType: 0,
version: "19.0.0-www-classic-7e8a06cf-20240815",
version: "19.0.0-www-classic-7954db93-20240816",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-classic-7954db93-20240816"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2209 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17682,4 +17682,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-7e8a06cf-20240815";
exports.version = "19.0.0-www-classic-7954db93-20240816";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16544,14 +16544,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1724 = React.version;
if (
"19.0.0-www-modern-7e8a06cf-20240815" !==
"19.0.0-www-modern-7954db93-20240816" !==
isomorphicReactPackageVersion$jscomp$inline_1724
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1724,
"19.0.0-www-modern-7e8a06cf-20240815"
"19.0.0-www-modern-7954db93-20240816"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -16569,11 +16569,11 @@ Internals.Events = [
];
var internals$jscomp$inline_2199 = {
bundleType: 0,
version: "19.0.0-www-modern-7e8a06cf-20240815",
version: "19.0.0-www-modern-7954db93-20240816",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-modern-7954db93-20240816"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2200 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16936,4 +16936,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-7e8a06cf-20240815";
exports.version = "19.0.0-www-modern-7954db93-20240816";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17949,14 +17949,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1841 = React.version;
if (
"19.0.0-www-classic-7e8a06cf-20240815" !==
"19.0.0-www-classic-7954db93-20240816" !==
isomorphicReactPackageVersion$jscomp$inline_1841
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1841,
"19.0.0-www-classic-7e8a06cf-20240815"
"19.0.0-www-classic-7954db93-20240816"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -18001,11 +18001,11 @@ Internals.Events = [
];
var internals$jscomp$inline_1848 = {
bundleType: 0,
version: "19.0.0-www-classic-7e8a06cf-20240815",
version: "19.0.0-www-classic-7954db93-20240816",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-classic-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-classic-7954db93-20240816"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1848.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -18464,7 +18464,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-7e8a06cf-20240815";
exports.version = "19.0.0-www-classic-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -17306,14 +17306,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version;
if (
"19.0.0-www-modern-7e8a06cf-20240815" !==
"19.0.0-www-modern-7954db93-20240816" !==
isomorphicReactPackageVersion$jscomp$inline_1812
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1812,
"19.0.0-www-modern-7e8a06cf-20240815"
"19.0.0-www-modern-7954db93-20240816"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17331,11 +17331,11 @@ Internals.Events = [
];
var internals$jscomp$inline_1814 = {
bundleType: 0,
version: "19.0.0-www-modern-7e8a06cf-20240815",
version: "19.0.0-www-modern-7954db93-20240816",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-www-modern-7e8a06cf-20240815"
reconcilerVersion: "19.0.0-www-modern-7954db93-20240816"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1814.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -17701,7 +17701,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-7e8a06cf-20240815";
exports.version = "19.0.0-www-modern-7954db93-20240816";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 6f94ca8

Please sign in to comment.