From a180cdd8bfd2cacd74e22ef17a29a7c4c8bc7f0d Mon Sep 17 00:00:00 2001 From: sebmarkbage Date: Fri, 29 Mar 2024 20:48:18 +0000 Subject: [PATCH] Don't let error boundaries catch errors during hydration (#28675) When an error boundary catches an error during hydration it'll try to render the error state which will then try to hydrate that state, causing hydration warnings. When an error happens inside a Suspense boundary during hydration, we instead let the boundary catch it and restart a client render from there. However, when it's in the root we instead let it fail the root and do the sync recovery pass. This didn't consider that we might hit an error boundary first so this just skips the error boundary in that case. We should probably instead let the root do a concurrent client render in this same pass instead to unify with Suspense boundaries. DiffTrain build for [5d4b7587da52dd81bc5c366b909c4511e2970cd1](https://github.com/facebook/react/commit/5d4b7587da52dd81bc5c366b909c4511e2970cd1) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 3 +- compiled/facebook-www/ReactART-dev.modern.js | 3 +- compiled/facebook-www/ReactDOM-dev.classic.js | 11 ++- compiled/facebook-www/ReactDOM-dev.modern.js | 11 ++- .../facebook-www/ReactDOM-prod.classic.js | 80 ++++++++++--------- compiled/facebook-www/ReactDOM-prod.modern.js | 80 ++++++++++--------- .../ReactDOM-profiling.classic.js | 80 ++++++++++--------- .../facebook-www/ReactDOM-profiling.modern.js | 80 ++++++++++--------- .../ReactDOMTesting-dev.classic.js | 11 ++- .../ReactDOMTesting-dev.modern.js | 11 ++- .../ReactDOMTesting-prod.classic.js | 80 ++++++++++--------- .../ReactDOMTesting-prod.modern.js | 80 ++++++++++--------- .../ReactTestRenderer-dev.classic.js | 3 +- .../ReactTestRenderer-dev.modern.js | 3 +- 15 files changed, 287 insertions(+), 251 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index afa293becc..f7d03a3bfd 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -2aed507a76a0b1524426c398897cbe47d80c51e5 +5d4b7587da52dd81bc5c366b909c4511e2970cd1 diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 2fa24bdfea..edcd8fcb77 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -66,7 +66,7 @@ if (__DEV__) { return self; } - var ReactVersion = "19.0.0-www-classic-9a163259"; + var ReactVersion = "19.0.0-www-classic-b8b7775c"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -15149,7 +15149,6 @@ if (__DEV__) { } case ClassComponent: - // Capture and retry var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index a23861b157..93257830e4 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -66,7 +66,7 @@ if (__DEV__) { return self; } - var ReactVersion = "19.0.0-www-modern-58f8023b"; + var ReactVersion = "19.0.0-www-modern-c4adbf64"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -14873,7 +14873,6 @@ if (__DEV__) { } case ClassComponent: - // Capture and retry var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index e8ba47de85..c83eb4d914 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -19939,7 +19939,14 @@ if (__DEV__) { } case ClassComponent: - // Capture and retry + if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { + // If we're hydrating and got here, it means that we didn't find a suspense + // boundary above so it's a root error. In this case we shouldn't let the + // error boundary capture it because it'll just try to hydrate the error state. + // Instead we let it bubble to the root and let the recover pass handle it. + break; + } // Capture and retry + var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -36351,7 +36358,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-36b47fc1"; + var ReactVersion = "19.0.0-www-classic-7d681296"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 196d146f2f..f67ea68c1b 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -19861,7 +19861,14 @@ if (__DEV__) { } case ClassComponent: - // Capture and retry + if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { + // If we're hydrating and got here, it means that we didn't find a suspense + // boundary above so it's a root error. In this case we shouldn't let the + // error boundary capture it because it'll just try to hydrate the error state. + // Instead we let it bubble to the root and let the recover pass handle it. + break; + } // Capture and retry + var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -36199,7 +36206,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-7787bbbe"; + var ReactVersion = "19.0.0-www-modern-439124ba"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 626ac6874c..f2acd2c33f 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -5018,10 +5018,10 @@ function throwException( ), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber + : ((sourceFiber = value.updateQueue), + null === sourceFiber ? (value.updateQueue = new Set([wakeable])) - : returnFiber.add(wakeable), + : sourceFiber.add(wakeable), value.mode & 1 && attachPingListener(root, wakeable, rootRenderLanes)), !1 @@ -5032,18 +5032,18 @@ function throwException( (value.flags |= 65536), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber - ? ((returnFiber = { + : ((sourceFiber = value.updateQueue), + null === sourceFiber + ? ((sourceFiber = { transitions: null, markerInstances: null, retryQueue: new Set([wakeable]) }), - (value.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([wakeable])) - : sourceFiber.add(wakeable)), + (value.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([wakeable])) + : returnFiber.add(wakeable)), attachPingListener(root, wakeable, rootRenderLanes)), !1 ); @@ -5099,31 +5099,33 @@ function throwException( !1 ); case 1: - returnFiber = value; - sourceFiber = wakeable.type; - var instance = wakeable.stateNode; - if ( - 0 === (wakeable.flags & 128) && - ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - wakeable, - returnFiber - ), - enqueueCapturedUpdate(wakeable, rootRenderLanes), - !1 - ); + if (!(isHydrating && sourceFiber.mode & 1)) { + returnFiber = value; + var ctor = wakeable.type, + instance = wakeable.stateNode; + if ( + 0 === (wakeable.flags & 128) && + ("function" === typeof ctor.getDerivedStateFromError || + (null !== instance && + "function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) + ) + return ( + (wakeable.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (wakeable.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + wakeable, + returnFiber + ), + enqueueCapturedUpdate(wakeable, rootRenderLanes), + !1 + ); + } } wakeable = wakeable.return; } while (null !== wakeable); @@ -17105,7 +17107,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1732 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-64e7bfa1", + version: "19.0.0-www-classic-b1be4296", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2160 = { @@ -17135,7 +17137,7 @@ var internals$jscomp$inline_2160 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-64e7bfa1" + reconcilerVersion: "19.0.0-www-classic-b1be4296" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2161 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17585,4 +17587,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-64e7bfa1"; +exports.version = "19.0.0-www-classic-b1be4296"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index fde4644a47..a1b9095084 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -4902,10 +4902,10 @@ function throwException( ), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber + : ((sourceFiber = value.updateQueue), + null === sourceFiber ? (value.updateQueue = new Set([wakeable])) - : returnFiber.add(wakeable), + : sourceFiber.add(wakeable), value.mode & 1 && attachPingListener(root, wakeable, rootRenderLanes)), !1 @@ -4916,18 +4916,18 @@ function throwException( (value.flags |= 65536), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber - ? ((returnFiber = { + : ((sourceFiber = value.updateQueue), + null === sourceFiber + ? ((sourceFiber = { transitions: null, markerInstances: null, retryQueue: new Set([wakeable]) }), - (value.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([wakeable])) - : sourceFiber.add(wakeable)), + (value.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([wakeable])) + : returnFiber.add(wakeable)), attachPingListener(root, wakeable, rootRenderLanes)), !1 ); @@ -4983,31 +4983,33 @@ function throwException( !1 ); case 1: - returnFiber = value; - sourceFiber = wakeable.type; - var instance = wakeable.stateNode; - if ( - 0 === (wakeable.flags & 128) && - ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - wakeable, - returnFiber - ), - enqueueCapturedUpdate(wakeable, rootRenderLanes), - !1 - ); + if (!(isHydrating && sourceFiber.mode & 1)) { + returnFiber = value; + var ctor = wakeable.type, + instance = wakeable.stateNode; + if ( + 0 === (wakeable.flags & 128) && + ("function" === typeof ctor.getDerivedStateFromError || + (null !== instance && + "function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) + ) + return ( + (wakeable.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (wakeable.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + wakeable, + returnFiber + ), + enqueueCapturedUpdate(wakeable, rootRenderLanes), + !1 + ); + } } wakeable = wakeable.return; } while (null !== wakeable); @@ -16619,7 +16621,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1693 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-0a452e58", + version: "19.0.0-www-modern-44929488", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2122 = { @@ -16649,7 +16651,7 @@ var internals$jscomp$inline_2122 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-0a452e58" + reconcilerVersion: "19.0.0-www-modern-44929488" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2123 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16952,4 +16954,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-0a452e58"; +exports.version = "19.0.0-www-modern-44929488"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 14d05fe46b..d18b520800 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -5227,10 +5227,10 @@ function throwException( ), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber + : ((sourceFiber = value.updateQueue), + null === sourceFiber ? (value.updateQueue = new Set([wakeable])) - : returnFiber.add(wakeable), + : sourceFiber.add(wakeable), value.mode & 1 && attachPingListener(root, wakeable, rootRenderLanes)), !1 @@ -5241,18 +5241,18 @@ function throwException( (value.flags |= 65536), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber - ? ((returnFiber = { + : ((sourceFiber = value.updateQueue), + null === sourceFiber + ? ((sourceFiber = { transitions: null, markerInstances: null, retryQueue: new Set([wakeable]) }), - (value.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([wakeable])) - : sourceFiber.add(wakeable)), + (value.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([wakeable])) + : returnFiber.add(wakeable)), attachPingListener(root, wakeable, rootRenderLanes)), !1 ); @@ -5308,31 +5308,33 @@ function throwException( !1 ); case 1: - returnFiber = value; - sourceFiber = wakeable.type; - var instance = wakeable.stateNode; - if ( - 0 === (wakeable.flags & 128) && - ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - wakeable, - returnFiber - ), - enqueueCapturedUpdate(wakeable, rootRenderLanes), - !1 - ); + if (!(isHydrating && sourceFiber.mode & 1)) { + returnFiber = value; + var ctor = wakeable.type, + instance = wakeable.stateNode; + if ( + 0 === (wakeable.flags & 128) && + ("function" === typeof ctor.getDerivedStateFromError || + (null !== instance && + "function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) + ) + return ( + (wakeable.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (wakeable.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + wakeable, + returnFiber + ), + enqueueCapturedUpdate(wakeable, rootRenderLanes), + !1 + ); + } } wakeable = wakeable.return; } while (null !== wakeable); @@ -17855,7 +17857,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1818 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-be736b3f", + version: "19.0.0-www-classic-329e17e1", rendererPackageName: "react-dom" }; (function (internals) { @@ -17899,7 +17901,7 @@ var devToolsConfig$jscomp$inline_1818 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-be736b3f" + reconcilerVersion: "19.0.0-www-classic-329e17e1" }); var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); if ("function" !== typeof ReactFiberErrorDialogWWW.showErrorDialog) @@ -18336,7 +18338,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-be736b3f"; +exports.version = "19.0.0-www-classic-329e17e1"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index c264b1fe37..170edaaf79 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -5111,10 +5111,10 @@ function throwException( ), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber + : ((sourceFiber = value.updateQueue), + null === sourceFiber ? (value.updateQueue = new Set([wakeable])) - : returnFiber.add(wakeable), + : sourceFiber.add(wakeable), value.mode & 1 && attachPingListener(root, wakeable, rootRenderLanes)), !1 @@ -5125,18 +5125,18 @@ function throwException( (value.flags |= 65536), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber - ? ((returnFiber = { + : ((sourceFiber = value.updateQueue), + null === sourceFiber + ? ((sourceFiber = { transitions: null, markerInstances: null, retryQueue: new Set([wakeable]) }), - (value.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([wakeable])) - : sourceFiber.add(wakeable)), + (value.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([wakeable])) + : returnFiber.add(wakeable)), attachPingListener(root, wakeable, rootRenderLanes)), !1 ); @@ -5192,31 +5192,33 @@ function throwException( !1 ); case 1: - returnFiber = value; - sourceFiber = wakeable.type; - var instance = wakeable.stateNode; - if ( - 0 === (wakeable.flags & 128) && - ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - wakeable, - returnFiber - ), - enqueueCapturedUpdate(wakeable, rootRenderLanes), - !1 - ); + if (!(isHydrating && sourceFiber.mode & 1)) { + returnFiber = value; + var ctor = wakeable.type, + instance = wakeable.stateNode; + if ( + 0 === (wakeable.flags & 128) && + ("function" === typeof ctor.getDerivedStateFromError || + (null !== instance && + "function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) + ) + return ( + (wakeable.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (wakeable.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + wakeable, + returnFiber + ), + enqueueCapturedUpdate(wakeable, rootRenderLanes), + !1 + ); + } } wakeable = wakeable.return; } while (null !== wakeable); @@ -17363,7 +17365,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1779 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-f5cb12fd", + version: "19.0.0-www-modern-e6f7faa5", rendererPackageName: "react-dom" }; (function (internals) { @@ -17407,7 +17409,7 @@ var devToolsConfig$jscomp$inline_1779 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-f5cb12fd" + reconcilerVersion: "19.0.0-www-modern-e6f7faa5" }); var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); if ("function" !== typeof ReactFiberErrorDialogWWW.showErrorDialog) @@ -17697,7 +17699,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-f5cb12fd"; +exports.version = "19.0.0-www-modern-e6f7faa5"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index bd18793c42..dcbed26d4e 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -20076,7 +20076,14 @@ if (__DEV__) { } case ClassComponent: - // Capture and retry + if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { + // If we're hydrating and got here, it means that we didn't find a suspense + // boundary above so it's a root error. In this case we shouldn't let the + // error boundary capture it because it'll just try to hydrate the error state. + // Instead we let it bubble to the root and let the recover pass handle it. + break; + } // Capture and retry + var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -36975,7 +36982,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-5c6af03f"; + var ReactVersion = "19.0.0-www-classic-0f7004dd"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 9f1f27a6e4..19e7f4d896 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -19998,7 +19998,14 @@ if (__DEV__) { } case ClassComponent: - // Capture and retry + if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { + // If we're hydrating and got here, it means that we didn't find a suspense + // boundary above so it's a root error. In this case we shouldn't let the + // error boundary capture it because it'll just try to hydrate the error state. + // Instead we let it bubble to the root and let the recover pass handle it. + break; + } // Capture and retry + var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -36823,7 +36830,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-909b8e80"; + var ReactVersion = "19.0.0-www-modern-980a3fa3"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 8ad8db2c97..c208a6ee8f 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -5104,10 +5104,10 @@ function throwException( ), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber + : ((sourceFiber = value.updateQueue), + null === sourceFiber ? (value.updateQueue = new Set([wakeable])) - : returnFiber.add(wakeable), + : sourceFiber.add(wakeable), value.mode & 1 && attachPingListener(root, wakeable, rootRenderLanes)), !1 @@ -5118,18 +5118,18 @@ function throwException( (value.flags |= 65536), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber - ? ((returnFiber = { + : ((sourceFiber = value.updateQueue), + null === sourceFiber + ? ((sourceFiber = { transitions: null, markerInstances: null, retryQueue: new Set([wakeable]) }), - (value.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([wakeable])) - : sourceFiber.add(wakeable)), + (value.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([wakeable])) + : returnFiber.add(wakeable)), attachPingListener(root, wakeable, rootRenderLanes)), !1 ); @@ -5185,31 +5185,33 @@ function throwException( !1 ); case 1: - returnFiber = value; - sourceFiber = wakeable.type; - var instance = wakeable.stateNode; - if ( - 0 === (wakeable.flags & 128) && - ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - wakeable, - returnFiber - ), - enqueueCapturedUpdate(wakeable, rootRenderLanes), - !1 - ); + if (!(isHydrating && sourceFiber.mode & 1)) { + returnFiber = value; + var ctor = wakeable.type, + instance = wakeable.stateNode; + if ( + 0 === (wakeable.flags & 128) && + ("function" === typeof ctor.getDerivedStateFromError || + (null !== instance && + "function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) + ) + return ( + (wakeable.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (wakeable.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + wakeable, + returnFiber + ), + enqueueCapturedUpdate(wakeable, rootRenderLanes), + !1 + ); + } } wakeable = wakeable.return; } while (null !== wakeable); @@ -17434,7 +17436,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1759 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-9cca9405", + version: "19.0.0-www-classic-4e93399a", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2168 = { @@ -17464,7 +17466,7 @@ var internals$jscomp$inline_2168 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-9cca9405" + reconcilerVersion: "19.0.0-www-classic-4e93399a" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2169 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -18057,4 +18059,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-9cca9405"; +exports.version = "19.0.0-www-classic-4e93399a"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 66e8f99eb5..22934886e2 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -5049,10 +5049,10 @@ function throwException( ), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber + : ((sourceFiber = value.updateQueue), + null === sourceFiber ? (value.updateQueue = new Set([wakeable])) - : returnFiber.add(wakeable), + : sourceFiber.add(wakeable), value.mode & 1 && attachPingListener(root, wakeable, rootRenderLanes)), !1 @@ -5063,18 +5063,18 @@ function throwException( (value.flags |= 65536), wakeable === noopSuspenseyCommitThenable ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), - null === returnFiber - ? ((returnFiber = { + : ((sourceFiber = value.updateQueue), + null === sourceFiber + ? ((sourceFiber = { transitions: null, markerInstances: null, retryQueue: new Set([wakeable]) }), - (value.updateQueue = returnFiber)) - : ((sourceFiber = returnFiber.retryQueue), - null === sourceFiber - ? (returnFiber.retryQueue = new Set([wakeable])) - : sourceFiber.add(wakeable)), + (value.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([wakeable])) + : returnFiber.add(wakeable)), attachPingListener(root, wakeable, rootRenderLanes)), !1 ); @@ -5130,31 +5130,33 @@ function throwException( !1 ); case 1: - returnFiber = value; - sourceFiber = wakeable.type; - var instance = wakeable.stateNode; - if ( - 0 === (wakeable.flags & 128) && - ("function" === typeof sourceFiber.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - wakeable, - returnFiber - ), - enqueueCapturedUpdate(wakeable, rootRenderLanes), - !1 - ); + if (!(isHydrating && sourceFiber.mode & 1)) { + returnFiber = value; + var ctor = wakeable.type, + instance = wakeable.stateNode; + if ( + 0 === (wakeable.flags & 128) && + ("function" === typeof ctor.getDerivedStateFromError || + (null !== instance && + "function" === typeof instance.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) + ) + return ( + (wakeable.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (wakeable.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + wakeable, + returnFiber + ), + enqueueCapturedUpdate(wakeable, rootRenderLanes), + !1 + ); + } } wakeable = wakeable.return; } while (null !== wakeable); @@ -17009,7 +17011,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1720 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-5be8bd62", + version: "19.0.0-www-modern-08ff994a", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2126 = { @@ -17039,7 +17041,7 @@ var internals$jscomp$inline_2126 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-5be8bd62" + reconcilerVersion: "19.0.0-www-modern-08ff994a" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2127 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17465,4 +17467,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-5be8bd62"; +exports.version = "19.0.0-www-modern-08ff994a"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 9db9921f65..040e3c19c0 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -13718,7 +13718,6 @@ if (__DEV__) { } case ClassComponent: - // Capture and retry var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -26859,7 +26858,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-4b7162fb"; + var ReactVersion = "19.0.0-www-classic-8d9aa32f"; // Might add PROFILE later. diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 7cd77174db..75218c4946 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -13718,7 +13718,6 @@ if (__DEV__) { } case ClassComponent: - // Capture and retry var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -26859,7 +26858,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-4b7162fb"; + var ReactVersion = "19.0.0-www-modern-8d9aa32f"; // Might add PROFILE later.