diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 6af5cdb64e..d223277239 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -583eb6770d56e9793d3660bd9c6782fdebc93729 +6090cab099a8f7f373e04c7eb2937425a8f80f80 diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index bbf0feb62b..362c3ffc83 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-fce3a147"; + var ReactVersion = "19.0.0-www-classic-086110c8"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -3588,6 +3588,394 @@ if (__DEV__) { } } + var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + return "\n" + prefix + name; + } + } + function describeDebugInfoFrame(name, env) { + return describeBuiltInComponentFrame( + name + (env ? " (" + env + ")" : "") + ); + } + var reentry = false; + var componentFrameCache; + + { + var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap$1(); + } + /** + * Leverages native browser/VM stack frames to get proper details (e.g. + * filename, line + col number) for a single component in a component stack. We + * do this by: + * (1) throwing and catching an error in the function - this will be our + * control error. + * (2) calling the component which will eventually throw an error that we'll + * catch - this will be our sample error. + * (3) diffing the control and sample error stacks to find the stack frame + * which represents our component. + */ + + function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ""; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher$2.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher$2.current = null; + disableLogs(); + } + /** + * Finding a common stack frame between sample and control errors can be + * tricky given the different types and levels of stack trace truncation from + * different JS VMs. So instead we'll attempt to control what that common + * frame should be through this object method: + * Having both the sample and control errors be in the function under the + * `DescribeNativeComponentFrameRoot` property, + setting the `name` and + * `displayName` properties of the function ensures that a stack + * frame exists that has the method name `DescribeNativeComponentFrameRoot` in + * it for both control and sample stacks. + */ + + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + var control; + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe[prop-missing] + + Object.defineProperty(Fake.prototype, "props", { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === "object" && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } // $FlowFixMe[prop-missing] found when upgrading Flow + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } // TODO(luna): This will currently only throw if the function component + // tries to access React/ReactDOM/props. We should probably make this throw + // in simple components too + + var maybePromise = fn(); // If the function component returns a promise, it's likely an async + // component, which we don't yet support. Attach a noop catch handler to + // silence the error. + // TODO: Implement component stacks for async client components? + + if (maybePromise && typeof maybePromise.catch === "function") { + maybePromise.catch(function () {}); + } + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === "string") { + return [sample.stack, control.stack]; + } + } + + return [null, null]; + } + }; // $FlowFixMe[prop-missing] + + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); // Before ES6, the `name` property was not configurable. + + if (namePropDescriptor && namePropDescriptor.configurable) { + // V8 utilizes a function's `name` property when generating a stack trace. + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor + // is set to `false`. + // $FlowFixMe[cannot-write] + "name", + { + value: "DetermineComponentFrameRoot" + } + ); + } + + try { + var _RunInRootFrame$Deter = + RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + + if (sampleStack && controlStack) { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sampleStack.split("\n"); + var controlLines = controlStack.split("\n"); + var s = 0; + var c = 0; + + while ( + s < sampleLines.length && + !sampleLines[s].includes("DetermineComponentFrameRoot") + ) { + s++; + } + + while ( + c < controlLines.length && + !controlLines[c].includes("DetermineComponentFrameRoot") + ) { + c++; + } // We couldn't find our intentionally injected common root frame, attempt + // to find another common root frame by search from the bottom of the + // control stack... + + if (s === sampleLines.length || c === controlLines.length) { + s = sampleLines.length - 1; + c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = + "\n" + sampleLines[s].replace(" at new ", " at "); // If our component frame is labeled "" + // but we have a user-provided "displayName" + // splice it in to make the stack more readable. + + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); + } + + if (true) { + if (typeof fn === "function") { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher$2.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + var name = fn ? fn.displayName || fn.name : ""; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; + + { + if (typeof fn === "function") { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; + } + + function describeClassComponentFrame(ctor, ownerFn) { + { + return describeNativeComponentFrame(ctor, true); + } + } + function describeFunctionComponentFrame(fn, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostHoistable: + case HostSingleton: + case HostComponent: + return describeBuiltInComponentFrame(fiber.type); + + case LazyComponent: + return describeBuiltInComponentFrame("Lazy"); + + case SuspenseComponent: + return describeBuiltInComponentFrame("Suspense"); + + case SuspenseListComponent: + return describeBuiltInComponentFrame("SuspenseList"); + + case FunctionComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(fiber.type); + + case ForwardRef: + return describeFunctionComponentFrame(fiber.type.render); + + case ClassComponent: + return describeClassComponentFrame(fiber.type); + + default: + return ""; + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + var node = workInProgress; + + do { + info += describeFiber(node); + + if (true) { + // Add any Server Component stack frames in reverse order. + var debugInfo = node._debugInfo; + + if (debugInfo) { + for (var i = debugInfo.length - 1; i >= 0; i--) { + var entry = debugInfo[i]; + + if (typeof entry.name === "string") { + info += describeDebugInfoFrame(entry.name, entry.env); + } + } + } + } // $FlowFixMe[incompatible-type] we bail out when we get a null + + node = node.return; + } while (node); + + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + + var CapturedStacks = new WeakMap(); + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + var stack; + + if (typeof value === "object" && value !== null) { + var capturedStack = CapturedStacks.get(value); + + if (typeof capturedStack === "string") { + stack = capturedStack; + } else { + stack = getStackByFiberInDevAndProd(source); + CapturedStacks.set(value, stack); + } + } else { + stack = getStackByFiberInDevAndProd(source); + } + + return { + value: value, + source: source, + stack: stack + }; + } + function createCapturedValueFromError(value, stack) { + if (typeof stack === "string") { + CapturedStacks.set(value, stack); + } + + return { + value: value, + source: null, + stack: stack + }; + } + var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a
) @@ -5816,357 +6204,6 @@ if (__DEV__) { return true; } - var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - return "\n" + prefix + name; - } - } - function describeDebugInfoFrame(name, env) { - return describeBuiltInComponentFrame( - name + (env ? " (" + env + ")" : "") - ); - } - var reentry = false; - var componentFrameCache; - - { - var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap$1(); - } - /** - * Leverages native browser/VM stack frames to get proper details (e.g. - * filename, line + col number) for a single component in a component stack. We - * do this by: - * (1) throwing and catching an error in the function - this will be our - * control error. - * (2) calling the component which will eventually throw an error that we'll - * catch - this will be our sample error. - * (3) diffing the control and sample error stacks to find the stack frame - * which represents our component. - */ - - function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ""; - } - - { - var frame = componentFrameCache.get(fn); - - if (frame !== undefined) { - return frame; - } - } - - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. - - Error.prepareStackTrace = undefined; - var previousDispatcher; - - { - previousDispatcher = ReactCurrentDispatcher$2.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - - ReactCurrentDispatcher$2.current = null; - disableLogs(); - } - /** - * Finding a common stack frame between sample and control errors can be - * tricky given the different types and levels of stack trace truncation from - * different JS VMs. So instead we'll attempt to control what that common - * frame should be through this object method: - * Having both the sample and control errors be in the function under the - * `DescribeNativeComponentFrameRoot` property, + setting the `name` and - * `displayName` properties of the function ensures that a stack - * frame exists that has the method name `DescribeNativeComponentFrameRoot` in - * it for both control and sample stacks. - */ - - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - var control; - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe[prop-missing] - - Object.defineProperty(Fake.prototype, "props", { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === "object" && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } // $FlowFixMe[prop-missing] found when upgrading Flow - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } // TODO(luna): This will currently only throw if the function component - // tries to access React/ReactDOM/props. We should probably make this throw - // in simple components too - - var maybePromise = fn(); // If the function component returns a promise, it's likely an async - // component, which we don't yet support. Attach a noop catch handler to - // silence the error. - // TODO: Implement component stacks for async client components? - - if (maybePromise && typeof maybePromise.catch === "function") { - maybePromise.catch(function () {}); - } - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === "string") { - return [sample.stack, control.stack]; - } - } - - return [null, null]; - } - }; // $FlowFixMe[prop-missing] - - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); // Before ES6, the `name` property was not configurable. - - if (namePropDescriptor && namePropDescriptor.configurable) { - // V8 utilizes a function's `name` property when generating a stack trace. - Object.defineProperty( - RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor - // is set to `false`. - // $FlowFixMe[cannot-write] - "name", - { - value: "DetermineComponentFrameRoot" - } - ); - } - - try { - var _RunInRootFrame$Deter = - RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - - if (sampleStack && controlStack) { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sampleStack.split("\n"); - var controlLines = controlStack.split("\n"); - var s = 0; - var c = 0; - - while ( - s < sampleLines.length && - !sampleLines[s].includes("DetermineComponentFrameRoot") - ) { - s++; - } - - while ( - c < controlLines.length && - !controlLines[c].includes("DetermineComponentFrameRoot") - ) { - c++; - } // We couldn't find our intentionally injected common root frame, attempt - // to find another common root frame by search from the bottom of the - // control stack... - - if (s === sampleLines.length || c === controlLines.length) { - s = sampleLines.length - 1; - c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = - "\n" + sampleLines[s].replace(" at new ", " at "); // If our component frame is labeled "" - // but we have a user-provided "displayName" - // splice it in to make the stack more readable. - - if (fn.displayName && _frame.includes("")) { - _frame = _frame.replace("", fn.displayName); - } - - if (true) { - if (typeof fn === "function") { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. - - return _frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - - { - ReactCurrentDispatcher$2.current = previousDispatcher; - reenableLogs(); - } - - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - - var name = fn ? fn.displayName || fn.name : ""; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; - - { - if (typeof fn === "function") { - componentFrameCache.set(fn, syntheticFrame); - } - } - - return syntheticFrame; - } - - function describeClassComponentFrame(ctor, ownerFn) { - { - return describeNativeComponentFrame(ctor, true); - } - } - function describeFunctionComponentFrame(fn, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } - } - - function describeFiber(fiber) { - switch (fiber.tag) { - case HostHoistable: - case HostSingleton: - case HostComponent: - return describeBuiltInComponentFrame(fiber.type); - - case LazyComponent: - return describeBuiltInComponentFrame("Lazy"); - - case SuspenseComponent: - return describeBuiltInComponentFrame("Suspense"); - - case SuspenseListComponent: - return describeBuiltInComponentFrame("SuspenseList"); - - case FunctionComponent: - case SimpleMemoComponent: - return describeFunctionComponentFrame(fiber.type); - - case ForwardRef: - return describeFunctionComponentFrame(fiber.type.render); - - case ClassComponent: - return describeClassComponentFrame(fiber.type); - - default: - return ""; - } - } - - function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = ""; - var node = workInProgress; - - do { - info += describeFiber(node); - - if (true) { - // Add any Server Component stack frames in reverse order. - var debugInfo = node._debugInfo; - - if (debugInfo) { - for (var i = debugInfo.length - 1; i >= 0; i--) { - var entry = debugInfo[i]; - - if (typeof entry.name === "string") { - info += describeDebugInfoFrame(entry.name, entry.env); - } - } - } - } // $FlowFixMe[incompatible-type] we bail out when we get a null - - node = node.return; - } while (node); - - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var current = null; var isRendering = false; @@ -14505,43 +14542,6 @@ if (__DEV__) { return baseProps; } - var CapturedStacks = new WeakMap(); - function createCapturedValueAtFiber(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - var stack; - - if (typeof value === "object" && value !== null) { - var capturedStack = CapturedStacks.get(value); - - if (typeof capturedStack === "string") { - stack = capturedStack; - } else { - stack = getStackByFiberInDevAndProd(source); - CapturedStacks.set(value, stack); - } - } else { - stack = getStackByFiberInDevAndProd(source); - } - - return { - value: value, - source: source, - stack: stack - }; - } - function createCapturedValueFromError(value, stack) { - if (typeof stack === "string") { - CapturedStacks.set(value, stack); - } - - return { - value: value, - source: null, - stack: stack - }; - } - typeof reportError === "function" // In modern browsers, reportError will dispatch an error event, ? // emulating an uncaught JavaScript error. reportError @@ -15085,8 +15085,17 @@ if (__DEV__) { } } // This is a regular error, not a Suspense wakeable. - value = createCapturedValueAtFiber(value, sourceFiber); - renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + var wrapperError = new Error( + "There was an error during concurrent rendering but React was able to recover by " + + "instead synchronously rendering the entire root.", + { + cause: value + } + ); + queueConcurrentError( + createCapturedValueAtFiber(wrapperError, sourceFiber) + ); + renderDidError(); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. @@ -15096,26 +15105,30 @@ if (__DEV__) { return true; } + var errorInfo = createCapturedValueAtFiber(value, sourceFiber); var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { - var _errorInfo = value; workInProgress.flags |= ShouldCapture; - var lane = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); - var update = createRootErrorUpdate( + + var _lane = pickArbitraryLane(rootRenderLanes); + + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); + + var _update = createRootErrorUpdate( workInProgress.stateNode, - _errorInfo, - lane + errorInfo, + _lane ); - enqueueCapturedUpdate(workInProgress, update); + + enqueueCapturedUpdate(workInProgress, _update); return false; } case ClassComponent: - var errorInfo = value; + // Capture and retry var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -15128,19 +15141,19 @@ if (__DEV__) { ) { workInProgress.flags |= ShouldCapture; - var _lane = pickArbitraryLane(rootRenderLanes); + var _lane2 = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane2); // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(_lane); + var _update2 = createClassErrorUpdate(_lane2); initializeClassErrorUpdate( - _update, + _update2, root, workInProgress, errorInfo ); - enqueueCapturedUpdate(workInProgress, _update); + enqueueCapturedUpdate(workInProgress, _update2); return false; } @@ -17388,20 +17401,12 @@ if (__DEV__) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. - // - // The error is passed in as an argument to enforce that every caller provide - // a custom message, or explicitly opt out (currently the only path that opts - // out is legacy mode; every concurrent path provides an error). - if (recoverableError !== null) { - queueHydrationError(recoverableError); - } // This will add the old fiber to the deletion list - + // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; @@ -17487,9 +17492,7 @@ if (__DEV__) { message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; componentStack = _getSuspenseInstanceF.componentStack; - } - - var capturedValue = null; // TODO: Figure out a better signal than encoding a magic digest value. + } // TODO: Figure out a better signal than encoding a magic digest value. { var error; @@ -17507,17 +17510,17 @@ if (__DEV__) { error.stack = stack || ""; error.digest = digest; - capturedValue = createCapturedValueFromError( + var capturedValue = createCapturedValueFromError( error, componentStack === undefined ? null : componentStack ); + queueHydrationError(capturedValue); } return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - capturedValue + renderLanes ); } @@ -17592,8 +17595,7 @@ if (__DEV__) { return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else if (isSuspenseInstancePending()) { // This component is still pending more data from the server, so we can't hydrate its @@ -17632,22 +17634,13 @@ if (__DEV__) { // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. + // The error should've already been logged in throwException. pushPrimaryTreeSuspenseHandler(workInProgress); workInProgress.flags &= ~ForceClientRender; - - var _capturedValue = createCapturedValueFromError( - new Error( - "There was an error while hydrating this Suspense boundary. " + - "Switched to client rendering." - ), - null - ); - return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - _capturedValue + renderLanes ); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. @@ -27164,11 +27157,12 @@ if (__DEV__) { ); } } - function renderDidError(error) { + function renderDidError() { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } - + } + function queueConcurrentError(error) { if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 73fb2cf8f9..474b60b528 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-8336910b"; + var ReactVersion = "19.0.0-www-modern-792ee5bd"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -3351,6 +3351,394 @@ if (__DEV__) { } } + var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + return "\n" + prefix + name; + } + } + function describeDebugInfoFrame(name, env) { + return describeBuiltInComponentFrame( + name + (env ? " (" + env + ")" : "") + ); + } + var reentry = false; + var componentFrameCache; + + { + var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap$1(); + } + /** + * Leverages native browser/VM stack frames to get proper details (e.g. + * filename, line + col number) for a single component in a component stack. We + * do this by: + * (1) throwing and catching an error in the function - this will be our + * control error. + * (2) calling the component which will eventually throw an error that we'll + * catch - this will be our sample error. + * (3) diffing the control and sample error stacks to find the stack frame + * which represents our component. + */ + + function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ""; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher$2.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher$2.current = null; + disableLogs(); + } + /** + * Finding a common stack frame between sample and control errors can be + * tricky given the different types and levels of stack trace truncation from + * different JS VMs. So instead we'll attempt to control what that common + * frame should be through this object method: + * Having both the sample and control errors be in the function under the + * `DescribeNativeComponentFrameRoot` property, + setting the `name` and + * `displayName` properties of the function ensures that a stack + * frame exists that has the method name `DescribeNativeComponentFrameRoot` in + * it for both control and sample stacks. + */ + + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + var control; + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe[prop-missing] + + Object.defineProperty(Fake.prototype, "props", { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === "object" && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } // $FlowFixMe[prop-missing] found when upgrading Flow + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } // TODO(luna): This will currently only throw if the function component + // tries to access React/ReactDOM/props. We should probably make this throw + // in simple components too + + var maybePromise = fn(); // If the function component returns a promise, it's likely an async + // component, which we don't yet support. Attach a noop catch handler to + // silence the error. + // TODO: Implement component stacks for async client components? + + if (maybePromise && typeof maybePromise.catch === "function") { + maybePromise.catch(function () {}); + } + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === "string") { + return [sample.stack, control.stack]; + } + } + + return [null, null]; + } + }; // $FlowFixMe[prop-missing] + + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); // Before ES6, the `name` property was not configurable. + + if (namePropDescriptor && namePropDescriptor.configurable) { + // V8 utilizes a function's `name` property when generating a stack trace. + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor + // is set to `false`. + // $FlowFixMe[cannot-write] + "name", + { + value: "DetermineComponentFrameRoot" + } + ); + } + + try { + var _RunInRootFrame$Deter = + RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + + if (sampleStack && controlStack) { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sampleStack.split("\n"); + var controlLines = controlStack.split("\n"); + var s = 0; + var c = 0; + + while ( + s < sampleLines.length && + !sampleLines[s].includes("DetermineComponentFrameRoot") + ) { + s++; + } + + while ( + c < controlLines.length && + !controlLines[c].includes("DetermineComponentFrameRoot") + ) { + c++; + } // We couldn't find our intentionally injected common root frame, attempt + // to find another common root frame by search from the bottom of the + // control stack... + + if (s === sampleLines.length || c === controlLines.length) { + s = sampleLines.length - 1; + c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = + "\n" + sampleLines[s].replace(" at new ", " at "); // If our component frame is labeled "" + // but we have a user-provided "displayName" + // splice it in to make the stack more readable. + + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); + } + + if (true) { + if (typeof fn === "function") { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher$2.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + var name = fn ? fn.displayName || fn.name : ""; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; + + { + if (typeof fn === "function") { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; + } + + function describeClassComponentFrame(ctor, ownerFn) { + { + return describeNativeComponentFrame(ctor, true); + } + } + function describeFunctionComponentFrame(fn, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostHoistable: + case HostSingleton: + case HostComponent: + return describeBuiltInComponentFrame(fiber.type); + + case LazyComponent: + return describeBuiltInComponentFrame("Lazy"); + + case SuspenseComponent: + return describeBuiltInComponentFrame("Suspense"); + + case SuspenseListComponent: + return describeBuiltInComponentFrame("SuspenseList"); + + case FunctionComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(fiber.type); + + case ForwardRef: + return describeFunctionComponentFrame(fiber.type.render); + + case ClassComponent: + return describeClassComponentFrame(fiber.type); + + default: + return ""; + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + var node = workInProgress; + + do { + info += describeFiber(node); + + if (true) { + // Add any Server Component stack frames in reverse order. + var debugInfo = node._debugInfo; + + if (debugInfo) { + for (var i = debugInfo.length - 1; i >= 0; i--) { + var entry = debugInfo[i]; + + if (typeof entry.name === "string") { + info += describeDebugInfoFrame(entry.name, entry.env); + } + } + } + } // $FlowFixMe[incompatible-type] we bail out when we get a null + + node = node.return; + } while (node); + + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + + var CapturedStacks = new WeakMap(); + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + var stack; + + if (typeof value === "object" && value !== null) { + var capturedStack = CapturedStacks.get(value); + + if (typeof capturedStack === "string") { + stack = capturedStack; + } else { + stack = getStackByFiberInDevAndProd(source); + CapturedStacks.set(value, stack); + } + } else { + stack = getStackByFiberInDevAndProd(source); + } + + return { + value: value, + source: source, + stack: stack + }; + } + function createCapturedValueFromError(value, stack) { + if (typeof stack === "string") { + CapturedStacks.set(value, stack); + } + + return { + value: value, + source: null, + stack: stack + }; + } + var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) @@ -5567,357 +5955,6 @@ if (__DEV__) { return true; } - var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - return "\n" + prefix + name; - } - } - function describeDebugInfoFrame(name, env) { - return describeBuiltInComponentFrame( - name + (env ? " (" + env + ")" : "") - ); - } - var reentry = false; - var componentFrameCache; - - { - var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap$1(); - } - /** - * Leverages native browser/VM stack frames to get proper details (e.g. - * filename, line + col number) for a single component in a component stack. We - * do this by: - * (1) throwing and catching an error in the function - this will be our - * control error. - * (2) calling the component which will eventually throw an error that we'll - * catch - this will be our sample error. - * (3) diffing the control and sample error stacks to find the stack frame - * which represents our component. - */ - - function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ""; - } - - { - var frame = componentFrameCache.get(fn); - - if (frame !== undefined) { - return frame; - } - } - - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. - - Error.prepareStackTrace = undefined; - var previousDispatcher; - - { - previousDispatcher = ReactCurrentDispatcher$2.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - - ReactCurrentDispatcher$2.current = null; - disableLogs(); - } - /** - * Finding a common stack frame between sample and control errors can be - * tricky given the different types and levels of stack trace truncation from - * different JS VMs. So instead we'll attempt to control what that common - * frame should be through this object method: - * Having both the sample and control errors be in the function under the - * `DescribeNativeComponentFrameRoot` property, + setting the `name` and - * `displayName` properties of the function ensures that a stack - * frame exists that has the method name `DescribeNativeComponentFrameRoot` in - * it for both control and sample stacks. - */ - - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - var control; - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe[prop-missing] - - Object.defineProperty(Fake.prototype, "props", { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === "object" && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } // $FlowFixMe[prop-missing] found when upgrading Flow - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } // TODO(luna): This will currently only throw if the function component - // tries to access React/ReactDOM/props. We should probably make this throw - // in simple components too - - var maybePromise = fn(); // If the function component returns a promise, it's likely an async - // component, which we don't yet support. Attach a noop catch handler to - // silence the error. - // TODO: Implement component stacks for async client components? - - if (maybePromise && typeof maybePromise.catch === "function") { - maybePromise.catch(function () {}); - } - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === "string") { - return [sample.stack, control.stack]; - } - } - - return [null, null]; - } - }; // $FlowFixMe[prop-missing] - - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); // Before ES6, the `name` property was not configurable. - - if (namePropDescriptor && namePropDescriptor.configurable) { - // V8 utilizes a function's `name` property when generating a stack trace. - Object.defineProperty( - RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor - // is set to `false`. - // $FlowFixMe[cannot-write] - "name", - { - value: "DetermineComponentFrameRoot" - } - ); - } - - try { - var _RunInRootFrame$Deter = - RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - - if (sampleStack && controlStack) { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sampleStack.split("\n"); - var controlLines = controlStack.split("\n"); - var s = 0; - var c = 0; - - while ( - s < sampleLines.length && - !sampleLines[s].includes("DetermineComponentFrameRoot") - ) { - s++; - } - - while ( - c < controlLines.length && - !controlLines[c].includes("DetermineComponentFrameRoot") - ) { - c++; - } // We couldn't find our intentionally injected common root frame, attempt - // to find another common root frame by search from the bottom of the - // control stack... - - if (s === sampleLines.length || c === controlLines.length) { - s = sampleLines.length - 1; - c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = - "\n" + sampleLines[s].replace(" at new ", " at "); // If our component frame is labeled "" - // but we have a user-provided "displayName" - // splice it in to make the stack more readable. - - if (fn.displayName && _frame.includes("")) { - _frame = _frame.replace("", fn.displayName); - } - - if (true) { - if (typeof fn === "function") { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. - - return _frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - - { - ReactCurrentDispatcher$2.current = previousDispatcher; - reenableLogs(); - } - - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - - var name = fn ? fn.displayName || fn.name : ""; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; - - { - if (typeof fn === "function") { - componentFrameCache.set(fn, syntheticFrame); - } - } - - return syntheticFrame; - } - - function describeClassComponentFrame(ctor, ownerFn) { - { - return describeNativeComponentFrame(ctor, true); - } - } - function describeFunctionComponentFrame(fn, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } - } - - function describeFiber(fiber) { - switch (fiber.tag) { - case HostHoistable: - case HostSingleton: - case HostComponent: - return describeBuiltInComponentFrame(fiber.type); - - case LazyComponent: - return describeBuiltInComponentFrame("Lazy"); - - case SuspenseComponent: - return describeBuiltInComponentFrame("Suspense"); - - case SuspenseListComponent: - return describeBuiltInComponentFrame("SuspenseList"); - - case FunctionComponent: - case SimpleMemoComponent: - return describeFunctionComponentFrame(fiber.type); - - case ForwardRef: - return describeFunctionComponentFrame(fiber.type.render); - - case ClassComponent: - return describeClassComponentFrame(fiber.type); - - default: - return ""; - } - } - - function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = ""; - var node = workInProgress; - - do { - info += describeFiber(node); - - if (true) { - // Add any Server Component stack frames in reverse order. - var debugInfo = node._debugInfo; - - if (debugInfo) { - for (var i = debugInfo.length - 1; i >= 0; i--) { - var entry = debugInfo[i]; - - if (typeof entry.name === "string") { - info += describeDebugInfoFrame(entry.name, entry.env); - } - } - } - } // $FlowFixMe[incompatible-type] we bail out when we get a null - - node = node.return; - } while (node); - - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var current = null; var isRendering = false; @@ -14215,43 +14252,6 @@ if (__DEV__) { return baseProps; } - var CapturedStacks = new WeakMap(); - function createCapturedValueAtFiber(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - var stack; - - if (typeof value === "object" && value !== null) { - var capturedStack = CapturedStacks.get(value); - - if (typeof capturedStack === "string") { - stack = capturedStack; - } else { - stack = getStackByFiberInDevAndProd(source); - CapturedStacks.set(value, stack); - } - } else { - stack = getStackByFiberInDevAndProd(source); - } - - return { - value: value, - source: source, - stack: stack - }; - } - function createCapturedValueFromError(value, stack) { - if (typeof stack === "string") { - CapturedStacks.set(value, stack); - } - - return { - value: value, - source: null, - stack: stack - }; - } - typeof reportError === "function" // In modern browsers, reportError will dispatch an error event, ? // emulating an uncaught JavaScript error. reportError @@ -14699,8 +14699,17 @@ if (__DEV__) { } } // This is a regular error, not a Suspense wakeable. - value = createCapturedValueAtFiber(value, sourceFiber); - renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + var wrapperError = new Error( + "There was an error during concurrent rendering but React was able to recover by " + + "instead synchronously rendering the entire root.", + { + cause: value + } + ); + queueConcurrentError( + createCapturedValueAtFiber(wrapperError, sourceFiber) + ); + renderDidError(); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. @@ -14710,26 +14719,30 @@ if (__DEV__) { return true; } + var errorInfo = createCapturedValueAtFiber(value, sourceFiber); var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { - var _errorInfo = value; workInProgress.flags |= ShouldCapture; - var lane = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); - var update = createRootErrorUpdate( + + var _lane = pickArbitraryLane(rootRenderLanes); + + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); + + var _update = createRootErrorUpdate( workInProgress.stateNode, - _errorInfo, - lane + errorInfo, + _lane ); - enqueueCapturedUpdate(workInProgress, update); + + enqueueCapturedUpdate(workInProgress, _update); return false; } case ClassComponent: - var errorInfo = value; + // Capture and retry var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -14742,19 +14755,19 @@ if (__DEV__) { ) { workInProgress.flags |= ShouldCapture; - var _lane = pickArbitraryLane(rootRenderLanes); + var _lane2 = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane2); // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(_lane); + var _update2 = createClassErrorUpdate(_lane2); initializeClassErrorUpdate( - _update, + _update2, root, workInProgress, errorInfo ); - enqueueCapturedUpdate(workInProgress, _update); + enqueueCapturedUpdate(workInProgress, _update2); return false; } @@ -16839,20 +16852,12 @@ if (__DEV__) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. - // - // The error is passed in as an argument to enforce that every caller provide - // a custom message, or explicitly opt out (currently the only path that opts - // out is legacy mode; every concurrent path provides an error). - if (recoverableError !== null) { - queueHydrationError(recoverableError); - } // This will add the old fiber to the deletion list - + // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; @@ -16938,9 +16943,7 @@ if (__DEV__) { message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; componentStack = _getSuspenseInstanceF.componentStack; - } - - var capturedValue = null; // TODO: Figure out a better signal than encoding a magic digest value. + } // TODO: Figure out a better signal than encoding a magic digest value. { var error; @@ -16958,17 +16961,17 @@ if (__DEV__) { error.stack = stack || ""; error.digest = digest; - capturedValue = createCapturedValueFromError( + var capturedValue = createCapturedValueFromError( error, componentStack === undefined ? null : componentStack ); + queueHydrationError(capturedValue); } return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - capturedValue + renderLanes ); } @@ -17043,8 +17046,7 @@ if (__DEV__) { return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else if (isSuspenseInstancePending()) { // This component is still pending more data from the server, so we can't hydrate its @@ -17083,22 +17085,13 @@ if (__DEV__) { // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. + // The error should've already been logged in throwException. pushPrimaryTreeSuspenseHandler(workInProgress); workInProgress.flags &= ~ForceClientRender; - - var _capturedValue = createCapturedValueFromError( - new Error( - "There was an error while hydrating this Suspense boundary. " + - "Switched to client rendering." - ), - null - ); - return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - _capturedValue + renderLanes ); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. @@ -26371,11 +26364,12 @@ if (__DEV__) { ); } } - function renderDidError(error) { + function renderDidError() { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } - + } + function queueConcurrentError(error) { if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 5cf709bc2d..660322869e 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -921,7 +921,197 @@ function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } var objectIs = "function" === typeof Object.is ? Object.is : is, - contextStackCursor = createCursor(null), + prefix; +function describeBuiltInComponentFrame(name) { + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + } + return "\n" + prefix + name; +} +var reentry = !1; +function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) return ""; + reentry = !0; + var previousPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$10) { + control = x$10; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x$11) { + control = x$11; + } + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); + } + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; + } + return [null, null]; + } + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { + value: "DetermineComponentFrameRoot" + }); + try { + var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + if (sampleStack && controlStack) { + var sampleLines = sampleStack.split("\n"), + controlLines = controlStack.split("\n"); + for ( + namePropDescriptor = RunInRootFrame = 0; + RunInRootFrame < sampleLines.length && + !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); + + ) + RunInRootFrame++; + for ( + ; + namePropDescriptor < controlLines.length && + !controlLines[namePropDescriptor].includes( + "DetermineComponentFrameRoot" + ); + + ) + namePropDescriptor++; + if ( + RunInRootFrame === sampleLines.length || + namePropDescriptor === controlLines.length + ) + for ( + RunInRootFrame = sampleLines.length - 1, + namePropDescriptor = controlLines.length - 1; + 1 <= RunInRootFrame && + 0 <= namePropDescriptor && + sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; + + ) + namePropDescriptor--; + for ( + ; + 1 <= RunInRootFrame && 0 <= namePropDescriptor; + RunInRootFrame--, namePropDescriptor-- + ) + if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { + if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { + do + if ( + (RunInRootFrame--, + namePropDescriptor--, + 0 > namePropDescriptor || + sampleLines[RunInRootFrame] !== + controlLines[namePropDescriptor]) + ) { + var frame = + "\n" + + sampleLines[RunInRootFrame].replace(" at new ", " at "); + fn.displayName && + frame.includes("") && + (frame = frame.replace("", fn.displayName)); + return frame; + } + while (1 <= RunInRootFrame && 0 <= namePropDescriptor); + } + break; + } + } + } finally { + (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace); + } + return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(previousPrepareStackTrace) + : ""; +} +function describeFiber(fiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return describeBuiltInComponentFrame(fiber.type); + case 16: + return describeBuiltInComponentFrame("Lazy"); + case 13: + return describeBuiltInComponentFrame("Suspense"); + case 19: + return describeBuiltInComponentFrame("SuspenseList"); + case 0: + case 15: + return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + case 11: + return ( + (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber + ); + case 1: + return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + default: + return ""; + } +} +function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + do + (info += describeFiber(workInProgress)), + (workInProgress = workInProgress.return); + while (workInProgress); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } +} +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; +} +var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), @@ -958,8 +1148,9 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue2 = null)); } -var hydrationErrors = null, - concurrentQueues = [], +var hydrationErrors = null; +Error(formatProdErrorMessage(519)); +var concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0; function finishQueueingConcurrentUpdates() { @@ -1062,14 +1253,14 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { if (!onlyLegacy || 0 === root.tag) { - var workInProgressRootRenderLanes$11 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$11 = getNextLanes( + var workInProgressRootRenderLanes$13 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$13 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$11 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$13 : 0 ); - 0 !== (workInProgressRootRenderLanes$11 & 3) && + 0 !== (workInProgressRootRenderLanes$13 & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, workInProgressRootRenderLanes$11)); + performSyncWorkOnRoot(root, workInProgressRootRenderLanes$13)); } root = root.next; } @@ -1503,186 +1694,6 @@ function shallowEqual(objA, objB) { } return !0; } -var prefix; -function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - } - return "\n" + prefix + name; -} -var reentry = !1; -function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - reentry = !0; - var previousPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { - throw Error(); - } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x$16) { - control = x$16; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$17) { - control = x$17; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); - } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; - } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { - value: "DetermineComponentFrameRoot" - }); - try { - var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - if (sampleStack && controlStack) { - var sampleLines = sampleStack.split("\n"), - controlLines = controlStack.split("\n"); - for ( - namePropDescriptor = RunInRootFrame = 0; - RunInRootFrame < sampleLines.length && - !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); - - ) - RunInRootFrame++; - for ( - ; - namePropDescriptor < controlLines.length && - !controlLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - if ( - RunInRootFrame === sampleLines.length || - namePropDescriptor === controlLines.length - ) - for ( - RunInRootFrame = sampleLines.length - 1, - namePropDescriptor = controlLines.length - 1; - 1 <= RunInRootFrame && - 0 <= namePropDescriptor && - sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; - - ) - namePropDescriptor--; - for ( - ; - 1 <= RunInRootFrame && 0 <= namePropDescriptor; - RunInRootFrame--, namePropDescriptor-- - ) - if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { - if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { - do - if ( - (RunInRootFrame--, - namePropDescriptor--, - 0 > namePropDescriptor || - sampleLines[RunInRootFrame] !== - controlLines[namePropDescriptor]) - ) { - var frame = - "\n" + - sampleLines[RunInRootFrame].replace(" at new ", " at "); - fn.displayName && - frame.includes("") && - (frame = frame.replace("", fn.displayName)); - return frame; - } - while (1 <= RunInRootFrame && 0 <= namePropDescriptor); - } - break; - } - } - } finally { - (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace); - } - return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(previousPrepareStackTrace) - : ""; -} -function describeFiber(fiber) { - switch (fiber.tag) { - case 26: - case 27: - case 5: - return describeBuiltInComponentFrame(fiber.type); - case 16: - return describeBuiltInComponentFrame("Lazy"); - case 13: - return describeBuiltInComponentFrame("Suspense"); - case 19: - return describeBuiltInComponentFrame("SuspenseList"); - case 0: - case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; - case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); - case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; - default: - return ""; - } -} -function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = ""; - do - (info += describeFiber(workInProgress)), - (workInProgress = workInProgress.return); - while (workInProgress); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } -} var SuspenseException = Error(formatProdErrorMessage(460)), SuspenseyCommitException = Error(formatProdErrorMessage(474)), noopSuspenseyCommitThenable = { then: function () {} }; @@ -3974,20 +3985,6 @@ function resolveDefaultProps(Component, baseProps) { } return baseProps; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; -} -function createCapturedValueFromError(value, stack) { - "string" === typeof stack && CapturedStacks.set(value, stack); - return { value: value, source: null, stack: stack }; -} "function" === typeof reportError ? reportError : function (error) { @@ -4092,36 +4089,43 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - var wakeable = value; - enableLazyContextPropagation && - ((value = sourceFiber.alternate), - null !== value && - propagateParentContextChanges(value, sourceFiber, rootRenderLanes, !0)); - value = sourceFiber.tag; + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + } + currentSourceFiber = sourceFiber.tag; 0 !== (sourceFiber.mode & 1) || - (0 !== value && 11 !== value && 15 !== value) || - ((value = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = value.updateQueue), - (sourceFiber.memoizedState = value.memoizedState), - (sourceFiber.lanes = value.lanes)) + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) : ((sourceFiber.updateQueue = null), (sourceFiber.memoizedState = null))); - value = suspenseHandlerStackCursor.current; - if (null !== value) { - switch (value.tag) { + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: return ( sourceFiber.mode & 1 && (null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === value.alternate && + : null === currentSourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3)), - (value.flags &= -257), - 0 === (value.mode & 1) - ? value === returnFiber - ? (value.flags |= 65536) - : ((value.flags |= 128), + (currentSourceFiber.flags &= -257), + 0 === (currentSourceFiber.mode & 1) + ? currentSourceFiber === returnFiber + ? (currentSourceFiber.flags |= 65536) + : ((currentSourceFiber.flags |= 128), (sourceFiber.flags |= 131072), (sourceFiber.flags &= -52805), 1 === sourceFiber.tag @@ -4134,101 +4138,102 @@ function throwException( null === sourceFiber.alternate && (sourceFiber.tag = 28), (sourceFiber.lanes |= 2)) - : ((value.flags |= 65536), (value.lanes = rootRenderLanes)), - wakeable === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), + : ((currentSourceFiber.flags |= 65536), + (currentSourceFiber.lanes = rootRenderLanes)), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((returnFiber = currentSourceFiber.updateQueue), null === returnFiber - ? (value.updateQueue = new Set([wakeable])) - : returnFiber.add(wakeable), - value.mode & 1 && - attachPingListener(root, wakeable, rootRenderLanes)), + ? (currentSourceFiber.updateQueue = new Set([value])) + : returnFiber.add(value), + currentSourceFiber.mode & 1 && + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: - if (value.mode & 1) + if (currentSourceFiber.mode & 1) return ( - (value.flags |= 65536), - wakeable === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((returnFiber = value.updateQueue), + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((returnFiber = currentSourceFiber.updateQueue), null === returnFiber ? ((returnFiber = { transitions: null, markerInstances: null, - retryQueue: new Set([wakeable]) + retryQueue: new Set([value]) }), - (value.updateQueue = returnFiber)) + (currentSourceFiber.updateQueue = returnFiber)) : ((sourceFiber = returnFiber.retryQueue), null === sourceFiber - ? (returnFiber.retryQueue = new Set([wakeable])) - : sourceFiber.add(wakeable)), - attachPingListener(root, wakeable, rootRenderLanes)), + ? (returnFiber.retryQueue = new Set([value])) + : sourceFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), !1 ); } - throw Error(formatProdErrorMessage(435, value.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } if (1 === root.tag) return ( - attachPingListener(root, wakeable, rootRenderLanes), + attachPingListener(root, value, rootRenderLanes), renderDidSuspendDelayIfPossible(), !1 ); value = Error(formatProdErrorMessage(426)); } - wakeable = value = createCapturedValueAtFiber(value, sourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wakeable]) - : workInProgressRootConcurrentErrors.push(wakeable); + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); if (null === returnFiber) return !0; - wakeable = returnFiber; + value = createCapturedValueAtFiber(value, sourceFiber); do { - switch (wakeable.tag) { + switch (returnFiber.tag) { case 3: return ( - (root = value), - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (root = createRootErrorUpdate( - wakeable.stateNode, - root, - rootRenderLanes - )), - enqueueCapturedUpdate(wakeable, root), + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate(returnFiber.stateNode, value, root)), + enqueueCapturedUpdate(returnFiber, root), !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)))) + ((sourceFiber = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof sourceFiber.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) ) return ( - (wakeable.flags |= 65536), + (returnFiber.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), initializeClassErrorUpdate( rootRenderLanes, root, - wakeable, - returnFiber + returnFiber, + value ), - enqueueCapturedUpdate(wakeable, rootRenderLanes), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 ); } - wakeable = wakeable.return; - } while (null !== wakeable); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -5028,15 +5033,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags &= -257), - (JSCompiler_temp = createCapturedValueFromError( - Error(formatProdErrorMessage(422)), - null - )), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ))) : null !== workInProgress.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress), @@ -5084,12 +5084,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (nextProps = Error(formatProdErrorMessage(419))), (nextProps.stack = ""), (nextProps.digest = JSCompiler_temp), - (JSCompiler_temp = createCapturedValueFromError(nextProps, null)), + (JSCompiler_temp = { value: nextProps, source: null, stack: null }), + null === hydrationErrors + ? (hydrationErrors = [JSCompiler_temp]) + : hydrationErrors.push(JSCompiler_temp), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes )); else if ( (enableLazyContextPropagation && @@ -5157,8 +5159,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else shim$2() @@ -5320,13 +5321,8 @@ function mountSuspenseFallbackChildren( function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { - null !== recoverableError && - (null === hydrationErrors - ? (hydrationErrors = [recoverableError]) - : hydrationErrors.push(recoverableError)); reconcileChildFibers(workInProgress, current.child, null, renderLanes); current = mountSuspensePrimaryChildren( workInProgress, @@ -6522,14 +6518,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$83 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$83 = lastTailNode), + for (var lastTailNode$81 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$81 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$83 + null === lastTailNode$81 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$83.sibling = null); + : (lastTailNode$81.sibling = null); } } function bubbleProperties(completedWork) { @@ -6539,19 +6535,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$84 = completedWork.child; null !== child$84; ) - (newChildLanes |= child$84.lanes | child$84.childLanes), - (subtreeFlags |= child$84.subtreeFlags & 31457280), - (subtreeFlags |= child$84.flags & 31457280), - (child$84.return = completedWork), - (child$84 = child$84.sibling); + for (var child$82 = completedWork.child; null !== child$82; ) + (newChildLanes |= child$82.lanes | child$82.childLanes), + (subtreeFlags |= child$82.subtreeFlags & 31457280), + (subtreeFlags |= child$82.flags & 31457280), + (child$82.return = completedWork), + (child$82 = child$82.sibling); else - for (child$84 = completedWork.child; null !== child$84; ) - (newChildLanes |= child$84.lanes | child$84.childLanes), - (subtreeFlags |= child$84.subtreeFlags), - (subtreeFlags |= child$84.flags), - (child$84.return = completedWork), - (child$84 = child$84.sibling); + for (child$82 = completedWork.child; null !== child$82; ) + (newChildLanes |= child$82.lanes | child$82.childLanes), + (subtreeFlags |= child$82.subtreeFlags), + (subtreeFlags |= child$82.flags), + (child$82.return = completedWork), + (child$82 = child$82.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6729,11 +6725,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$88 = null; + var cache$86 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$88 = newProps.memoizedState.cachePool.pool); - cache$88 !== instance && (newProps.flags |= 2048); + (cache$86 = newProps.memoizedState.cachePool.pool); + cache$86 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6767,8 +6763,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$88 = instance.rendering; - if (null === cache$88) + cache$86 = instance.rendering; + if (null === cache$86) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6776,11 +6772,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$88 = findFirstSuspended(current); - if (null !== cache$88) { + cache$86 = findFirstSuspended(current); + if (null !== cache$86) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$88.updateQueue; + current = cache$86.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6805,7 +6801,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$88)), null !== current)) { + if (((current = findFirstSuspended(cache$86)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6815,7 +6811,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$88.alternate) + !cache$86.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6827,13 +6823,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$88.sibling = workInProgress.child), - (workInProgress.child = cache$88)) + ? ((cache$86.sibling = workInProgress.child), + (workInProgress.child = cache$86)) : ((current = instance.last), null !== current - ? (current.sibling = cache$88) - : (workInProgress.child = cache$88), - (instance.last = cache$88)); + ? (current.sibling = cache$86) + : (workInProgress.child = cache$86), + (instance.last = cache$86)); } if (null !== instance.tail) return ( @@ -7105,8 +7101,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$106) { - captureCommitPhaseError(current, nearestMountedAncestor, error$106); + } catch (error$104) { + captureCommitPhaseError(current, nearestMountedAncestor, error$104); } else ref.current = null; } @@ -7310,11 +7306,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$107) { + } catch (error$105) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$107 + error$105 ); } } @@ -7905,8 +7901,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$115) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$115); + } catch (error$113) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$113); } } break; @@ -7940,8 +7936,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { finishedWork.updateQueue = null; try { flags._applyProps(flags, newProps, current); - } catch (error$118) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$118); + } catch (error$116) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$116); } } break; @@ -7977,8 +7973,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$120) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$120); + } catch (error$118) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$118); } flags = finishedWork.updateQueue; null !== flags && @@ -8118,12 +8114,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$110 = JSCompiler_inline_result.stateNode.containerInfo, - before$111 = getHostSibling(finishedWork); + var parent$108 = JSCompiler_inline_result.stateNode.containerInfo, + before$109 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$111, - parent$110 + before$109, + parent$108 ); break; default: @@ -8581,9 +8577,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$126 = finishedWork.stateNode; + var instance$124 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$126._visibility & 4 + ? instance$124._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8596,7 +8592,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$126._visibility |= 4), + : ((instance$124._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8604,7 +8600,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$126._visibility |= 4), + : ((instance$124._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8617,7 +8613,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$126 + instance$124 ); break; case 24: @@ -9538,8 +9534,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$134) { - handleThrow(root, thrownValue$134); + } catch (thrownValue$132) { + handleThrow(root, thrownValue$132); } while (1); lanes && root.shellSuspendCounter++; @@ -9644,8 +9640,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$136) { - handleThrow(root, thrownValue$136); + } catch (thrownValue$134) { + handleThrow(root, thrownValue$134); } while (1); resetContextDependencies(); @@ -10672,19 +10668,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1125 = { + devToolsConfig$jscomp$inline_1121 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "19.0.0-www-classic-ed4c2158", + version: "19.0.0-www-classic-55d59959", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1315 = { - bundleType: devToolsConfig$jscomp$inline_1125.bundleType, - version: devToolsConfig$jscomp$inline_1125.version, - rendererPackageName: devToolsConfig$jscomp$inline_1125.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1125.rendererConfig, +var internals$jscomp$inline_1317 = { + bundleType: devToolsConfig$jscomp$inline_1121.bundleType, + version: devToolsConfig$jscomp$inline_1121.version, + rendererPackageName: devToolsConfig$jscomp$inline_1121.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1121.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10701,26 +10697,26 @@ var internals$jscomp$inline_1315 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1125.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1121.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-ed4c2158" + reconcilerVersion: "19.0.0-www-classic-55d59959" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1316 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1318 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1316.isDisabled && - hook$jscomp$inline_1316.supportsFiber + !hook$jscomp$inline_1318.isDisabled && + hook$jscomp$inline_1318.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1316.inject( - internals$jscomp$inline_1315 + (rendererID = hook$jscomp$inline_1318.inject( + internals$jscomp$inline_1317 )), - (injectedHook = hook$jscomp$inline_1316); + (injectedHook = hook$jscomp$inline_1318); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 77cc1996dd..dbbb82279f 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -719,7 +719,197 @@ function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } var objectIs = "function" === typeof Object.is ? Object.is : is, - contextStackCursor = createCursor(null), + prefix; +function describeBuiltInComponentFrame(name) { + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + } + return "\n" + prefix + name; +} +var reentry = !1; +function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) return ""; + reentry = !0; + var previousPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$10) { + control = x$10; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x$11) { + control = x$11; + } + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); + } + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; + } + return [null, null]; + } + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { + value: "DetermineComponentFrameRoot" + }); + try { + var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + if (sampleStack && controlStack) { + var sampleLines = sampleStack.split("\n"), + controlLines = controlStack.split("\n"); + for ( + namePropDescriptor = RunInRootFrame = 0; + RunInRootFrame < sampleLines.length && + !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); + + ) + RunInRootFrame++; + for ( + ; + namePropDescriptor < controlLines.length && + !controlLines[namePropDescriptor].includes( + "DetermineComponentFrameRoot" + ); + + ) + namePropDescriptor++; + if ( + RunInRootFrame === sampleLines.length || + namePropDescriptor === controlLines.length + ) + for ( + RunInRootFrame = sampleLines.length - 1, + namePropDescriptor = controlLines.length - 1; + 1 <= RunInRootFrame && + 0 <= namePropDescriptor && + sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; + + ) + namePropDescriptor--; + for ( + ; + 1 <= RunInRootFrame && 0 <= namePropDescriptor; + RunInRootFrame--, namePropDescriptor-- + ) + if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { + if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { + do + if ( + (RunInRootFrame--, + namePropDescriptor--, + 0 > namePropDescriptor || + sampleLines[RunInRootFrame] !== + controlLines[namePropDescriptor]) + ) { + var frame = + "\n" + + sampleLines[RunInRootFrame].replace(" at new ", " at "); + fn.displayName && + frame.includes("") && + (frame = frame.replace("", fn.displayName)); + return frame; + } + while (1 <= RunInRootFrame && 0 <= namePropDescriptor); + } + break; + } + } + } finally { + (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace); + } + return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(previousPrepareStackTrace) + : ""; +} +function describeFiber(fiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return describeBuiltInComponentFrame(fiber.type); + case 16: + return describeBuiltInComponentFrame("Lazy"); + case 13: + return describeBuiltInComponentFrame("Suspense"); + case 19: + return describeBuiltInComponentFrame("SuspenseList"); + case 0: + case 15: + return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + case 11: + return ( + (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber + ); + case 1: + return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + default: + return ""; + } +} +function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + do + (info += describeFiber(workInProgress)), + (workInProgress = workInProgress.return); + while (workInProgress); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } +} +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; +} +var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), @@ -756,8 +946,9 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue2 = null)); } -var hydrationErrors = null, - concurrentQueues = [], +var hydrationErrors = null; +Error(formatProdErrorMessage(519)); +var concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0; function finishQueueingConcurrentUpdates() { @@ -860,14 +1051,14 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { if (!onlyLegacy) { - var workInProgressRootRenderLanes$11 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$11 = getNextLanes( + var workInProgressRootRenderLanes$13 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$13 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$11 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$13 : 0 ); - 0 !== (workInProgressRootRenderLanes$11 & 3) && + 0 !== (workInProgressRootRenderLanes$13 & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, workInProgressRootRenderLanes$11)); + performSyncWorkOnRoot(root, workInProgressRootRenderLanes$13)); } root = root.next; } @@ -1301,186 +1492,6 @@ function shallowEqual(objA, objB) { } return !0; } -var prefix; -function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - } - return "\n" + prefix + name; -} -var reentry = !1; -function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - reentry = !0; - var previousPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { - throw Error(); - } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x$16) { - control = x$16; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$17) { - control = x$17; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); - } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; - } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { - value: "DetermineComponentFrameRoot" - }); - try { - var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - if (sampleStack && controlStack) { - var sampleLines = sampleStack.split("\n"), - controlLines = controlStack.split("\n"); - for ( - namePropDescriptor = RunInRootFrame = 0; - RunInRootFrame < sampleLines.length && - !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); - - ) - RunInRootFrame++; - for ( - ; - namePropDescriptor < controlLines.length && - !controlLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - if ( - RunInRootFrame === sampleLines.length || - namePropDescriptor === controlLines.length - ) - for ( - RunInRootFrame = sampleLines.length - 1, - namePropDescriptor = controlLines.length - 1; - 1 <= RunInRootFrame && - 0 <= namePropDescriptor && - sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; - - ) - namePropDescriptor--; - for ( - ; - 1 <= RunInRootFrame && 0 <= namePropDescriptor; - RunInRootFrame--, namePropDescriptor-- - ) - if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { - if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { - do - if ( - (RunInRootFrame--, - namePropDescriptor--, - 0 > namePropDescriptor || - sampleLines[RunInRootFrame] !== - controlLines[namePropDescriptor]) - ) { - var frame = - "\n" + - sampleLines[RunInRootFrame].replace(" at new ", " at "); - fn.displayName && - frame.includes("") && - (frame = frame.replace("", fn.displayName)); - return frame; - } - while (1 <= RunInRootFrame && 0 <= namePropDescriptor); - } - break; - } - } - } finally { - (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace); - } - return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(previousPrepareStackTrace) - : ""; -} -function describeFiber(fiber) { - switch (fiber.tag) { - case 26: - case 27: - case 5: - return describeBuiltInComponentFrame(fiber.type); - case 16: - return describeBuiltInComponentFrame("Lazy"); - case 13: - return describeBuiltInComponentFrame("Suspense"); - case 19: - return describeBuiltInComponentFrame("SuspenseList"); - case 0: - case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; - case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); - case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; - default: - return ""; - } -} -function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = ""; - do - (info += describeFiber(workInProgress)), - (workInProgress = workInProgress.return); - while (workInProgress); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } -} var SuspenseException = Error(formatProdErrorMessage(460)), SuspenseyCommitException = Error(formatProdErrorMessage(474)), noopSuspenseyCommitThenable = { then: function () {} }; @@ -3710,20 +3721,6 @@ function resolveDefaultProps(Component, baseProps) { } return baseProps; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; -} -function createCapturedValueFromError(value, stack) { - "string" === typeof stack && CapturedStacks.set(value, stack); - return { value: value, source: null, stack: stack }; -} "function" === typeof reportError ? reportError : function (error) { @@ -3828,93 +3825,93 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - returnFiber = value; enableLazyContextPropagation && - ((value = sourceFiber.alternate), - null !== value && - propagateParentContextChanges(value, sourceFiber, rootRenderLanes, !0)); - value = suspenseHandlerStackCursor.current; - if (null !== value) { - switch (value.tag) { + ((returnFiber = sourceFiber.alternate), + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + )); + returnFiber = suspenseHandlerStackCursor.current; + if (null !== returnFiber) { + switch (returnFiber.tag) { case 13: return ( null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === value.alternate && + : null === returnFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3), - (value.flags &= -257), - (value.flags |= 65536), - (value.lanes = rootRenderLanes), - returnFiber === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((sourceFiber = value.updateQueue), + (returnFiber.flags &= -257), + (returnFiber.flags |= 65536), + (returnFiber.lanes = rootRenderLanes), + value === noopSuspenseyCommitThenable + ? (returnFiber.flags |= 16384) + : ((sourceFiber = returnFiber.updateQueue), null === sourceFiber - ? (value.updateQueue = new Set([returnFiber])) - : sourceFiber.add(returnFiber), - attachPingListener(root, returnFiber, rootRenderLanes)), + ? (returnFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: return ( - (value.flags |= 65536), - returnFiber === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((sourceFiber = value.updateQueue), + (returnFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (returnFiber.flags |= 16384) + : ((sourceFiber = returnFiber.updateQueue), null === sourceFiber ? ((sourceFiber = { transitions: null, markerInstances: null, - retryQueue: new Set([returnFiber]) + retryQueue: new Set([value]) }), - (value.updateQueue = sourceFiber)) - : ((value = sourceFiber.retryQueue), - null === value - ? (sourceFiber.retryQueue = new Set([returnFiber])) - : value.add(returnFiber)), - attachPingListener(root, returnFiber, rootRenderLanes)), + (returnFiber.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), !1 ); } - throw Error(formatProdErrorMessage(435, value.tag)); + throw Error(formatProdErrorMessage(435, returnFiber.tag)); } - attachPingListener(root, returnFiber, rootRenderLanes); + attachPingListener(root, value, rootRenderLanes); renderDidSuspendDelayIfPossible(); return !1; } - sourceFiber = value = createCapturedValueAtFiber(value, sourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); + wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [sourceFiber]) - : workInProgressRootConcurrentErrors.push(sourceFiber); + ? (workInProgressRootConcurrentErrors = [wrapperError]) + : workInProgressRootConcurrentErrors.push(wrapperError); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); if (null === returnFiber) return !0; + value = createCapturedValueAtFiber(value, sourceFiber); do { switch (returnFiber.tag) { case 3: return ( - (root = value), (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (root = createRootErrorUpdate( - returnFiber.stateNode, - root, - rootRenderLanes - )), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate(returnFiber.stateNode, value, root)), enqueueCapturedUpdate(returnFiber, root), !1 ); case 1: - sourceFiber = value; - var ctor = returnFiber.type, - instance = returnFiber.stateNode; if ( + ((sourceFiber = returnFiber.type), + (wrapperError = returnFiber.stateNode), 0 === (returnFiber.flags & 128) && - ("function" === typeof ctor.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) + ("function" === typeof sourceFiber.getDerivedStateFromError || + (null !== wrapperError && + "function" === typeof wrapperError.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) ) return ( (returnFiber.flags |= 65536), @@ -3925,7 +3922,7 @@ function throwException( rootRenderLanes, root, returnFiber, - sourceFiber + value ), enqueueCapturedUpdate(returnFiber, rootRenderLanes), !1 @@ -4728,15 +4725,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags &= -257), - (JSCompiler_temp = createCapturedValueFromError( - Error(formatProdErrorMessage(422)), - null - )), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ))) : null !== workInProgress.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress), @@ -4781,12 +4773,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (nextProps = Error(formatProdErrorMessage(419))), (nextProps.stack = ""), (nextProps.digest = JSCompiler_temp), - (JSCompiler_temp = createCapturedValueFromError(nextProps, null)), + (JSCompiler_temp = { value: nextProps, source: null, stack: null }), + null === hydrationErrors + ? (hydrationErrors = [JSCompiler_temp]) + : hydrationErrors.push(JSCompiler_temp), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes )); else if ( (enableLazyContextPropagation && @@ -4854,8 +4848,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else shim$2() @@ -5010,13 +5003,8 @@ function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { - null !== recoverableError && - (null === hydrationErrors - ? (hydrationErrors = [recoverableError]) - : hydrationErrors.push(recoverableError)); reconcileChildFibers(workInProgress, current.child, null, renderLanes); current = mountSuspensePrimaryChildren( workInProgress, @@ -6118,14 +6106,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$75 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$75 = lastTailNode), + for (var lastTailNode$73 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$73 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$75 + null === lastTailNode$73 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$75.sibling = null); + : (lastTailNode$73.sibling = null); } } function bubbleProperties(completedWork) { @@ -6135,19 +6123,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$76 = completedWork.child; null !== child$76; ) - (newChildLanes |= child$76.lanes | child$76.childLanes), - (subtreeFlags |= child$76.subtreeFlags & 31457280), - (subtreeFlags |= child$76.flags & 31457280), - (child$76.return = completedWork), - (child$76 = child$76.sibling); + for (var child$74 = completedWork.child; null !== child$74; ) + (newChildLanes |= child$74.lanes | child$74.childLanes), + (subtreeFlags |= child$74.subtreeFlags & 31457280), + (subtreeFlags |= child$74.flags & 31457280), + (child$74.return = completedWork), + (child$74 = child$74.sibling); else - for (child$76 = completedWork.child; null !== child$76; ) - (newChildLanes |= child$76.lanes | child$76.childLanes), - (subtreeFlags |= child$76.subtreeFlags), - (subtreeFlags |= child$76.flags), - (child$76.return = completedWork), - (child$76 = child$76.sibling); + for (child$74 = completedWork.child; null !== child$74; ) + (newChildLanes |= child$74.lanes | child$74.childLanes), + (subtreeFlags |= child$74.subtreeFlags), + (subtreeFlags |= child$74.flags), + (child$74.return = completedWork), + (child$74 = child$74.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6318,11 +6306,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$80 = null; + var cache$78 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$80 = newProps.memoizedState.cachePool.pool); - cache$80 !== instance && (newProps.flags |= 2048); + (cache$78 = newProps.memoizedState.cachePool.pool); + cache$78 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6350,8 +6338,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$80 = instance.rendering; - if (null === cache$80) + cache$78 = instance.rendering; + if (null === cache$78) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6359,11 +6347,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$80 = findFirstSuspended(current); - if (null !== cache$80) { + cache$78 = findFirstSuspended(current); + if (null !== cache$78) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$80.updateQueue; + current = cache$78.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6388,7 +6376,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$80)), null !== current)) { + if (((current = findFirstSuspended(cache$78)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6398,7 +6386,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$80.alternate) + !cache$78.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6410,13 +6398,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$80.sibling = workInProgress.child), - (workInProgress.child = cache$80)) + ? ((cache$78.sibling = workInProgress.child), + (workInProgress.child = cache$78)) : ((current = instance.last), null !== current - ? (current.sibling = cache$80) - : (workInProgress.child = cache$80), - (instance.last = cache$80)); + ? (current.sibling = cache$78) + : (workInProgress.child = cache$78), + (instance.last = cache$78)); } if (null !== instance.tail) return ( @@ -6679,8 +6667,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$97) { - captureCommitPhaseError(current, nearestMountedAncestor, error$97); + } catch (error$95) { + captureCommitPhaseError(current, nearestMountedAncestor, error$95); } else ref.current = null; } @@ -6884,11 +6872,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$98) { + } catch (error$96) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$98 + error$96 ); } } @@ -7468,8 +7456,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$106) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$106); + } catch (error$104) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$104); } } break; @@ -7503,8 +7491,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { finishedWork.updateQueue = null; try { flags._applyProps(flags, newProps, current); - } catch (error$109) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$109); + } catch (error$107) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$107); } } break; @@ -7540,8 +7528,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$111) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$111); + } catch (error$109) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$109); } flags = finishedWork.updateQueue; null !== flags && @@ -7678,12 +7666,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$101 = JSCompiler_inline_result.stateNode.containerInfo, - before$102 = getHostSibling(finishedWork); + var parent$99 = JSCompiler_inline_result.stateNode.containerInfo, + before$100 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$102, - parent$101 + before$100, + parent$99 ); break; default: @@ -8133,9 +8121,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$117 = finishedWork.stateNode; + var instance$115 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$117._visibility & 4 + ? instance$115._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8147,7 +8135,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$117._visibility |= 4), + : ((instance$115._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8160,7 +8148,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$117 + instance$115 ); break; case 24: @@ -9069,8 +9057,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$125) { - handleThrow(root, thrownValue$125); + } catch (thrownValue$123) { + handleThrow(root, thrownValue$123); } while (1); lanes && root.shellSuspendCounter++; @@ -9175,8 +9163,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$127) { - handleThrow(root, thrownValue$127); + } catch (thrownValue$125) { + handleThrow(root, thrownValue$125); } while (1); resetContextDependencies(); @@ -10152,19 +10140,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1090 = { + devToolsConfig$jscomp$inline_1086 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "19.0.0-www-modern-b87e0d5e", + version: "19.0.0-www-modern-c8d23bec", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1296 = { - bundleType: devToolsConfig$jscomp$inline_1090.bundleType, - version: devToolsConfig$jscomp$inline_1090.version, - rendererPackageName: devToolsConfig$jscomp$inline_1090.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1090.rendererConfig, +var internals$jscomp$inline_1298 = { + bundleType: devToolsConfig$jscomp$inline_1086.bundleType, + version: devToolsConfig$jscomp$inline_1086.version, + rendererPackageName: devToolsConfig$jscomp$inline_1086.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1086.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10181,26 +10169,26 @@ var internals$jscomp$inline_1296 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1090.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1086.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-b87e0d5e" + reconcilerVersion: "19.0.0-www-modern-c8d23bec" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1297 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1299 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1297.isDisabled && - hook$jscomp$inline_1297.supportsFiber + !hook$jscomp$inline_1299.isDisabled && + hook$jscomp$inline_1299.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1297.inject( - internals$jscomp$inline_1296 + (rendererID = hook$jscomp$inline_1299.inject( + internals$jscomp$inline_1298 )), - (injectedHook = hook$jscomp$inline_1297); + (injectedHook = hook$jscomp$inline_1299); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 5b986e2066..0ed1a3295d 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -7875,6 +7875,43 @@ if (__DEV__) { return currentState.isDehydrated; } + var CapturedStacks = new WeakMap(); + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + var stack; + + if (typeof value === "object" && value !== null) { + var capturedStack = CapturedStacks.get(value); + + if (typeof capturedStack === "string") { + stack = capturedStack; + } else { + stack = getStackByFiberInDevAndProd(source); + CapturedStacks.set(value, stack); + } + } else { + stack = getStackByFiberInDevAndProd(source); + } + + return { + value: value, + source: source, + stack: stack + }; + } + function createCapturedValueFromError(value, stack) { + if (typeof stack === "string") { + CapturedStacks.set(value, stack); + } + + return { + value: value, + source: null, + stack: stack + }; + } + // Intentionally not using it yet to derisk the initial implementation, because // the way we push/pop these values is a bit unusual. If there's a mistake, I'd // rather the ids be wrong than crash the whole reconciler. @@ -8943,6 +8980,11 @@ if (__DEV__) { return false; } + var HydrationMismatchException = new Error( + "Hydration Mismatch Exception: This is not a real error, and should not leak into " + + "userspace. If you're seeing this, it's likely a bug in React." + ); + function throwOnHydrationMismatch(fiber) { var diff = ""; @@ -8957,7 +8999,7 @@ if (__DEV__) { } } - throw new Error( + var error = new Error( "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n" + "\n" + "- A server/client branch `if (typeof window !== 'undefined')`.\n" + @@ -8971,6 +9013,8 @@ if (__DEV__) { "https://react.dev/link/hydration-mismatch" + diff ); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function claimHydratableSingleton(fiber) { @@ -9032,7 +9076,7 @@ if (__DEV__) { warnNonHydratedInstance(fiber, nextInstance); } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9056,7 +9100,7 @@ if (__DEV__) { warnNonHydratedInstance(fiber, nextInstance); } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9069,7 +9113,7 @@ if (__DEV__) { if (!nextInstance || !tryHydrateSuspense(fiber, nextInstance)) { warnNonHydratedInstance(fiber, nextInstance); - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9097,7 +9141,7 @@ if (__DEV__) { // rendering. We don't bother to check if we're in a concurrent root because // useActionState is a new API, so backwards compat is not an issue. - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); return false; } @@ -9112,7 +9156,7 @@ if (__DEV__) { ); if (!didHydrate && favorSafetyOverHydrationPerf) { - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9179,7 +9223,7 @@ if (__DEV__) { ); if (!didHydrate && favorSafetyOverHydrationPerf) { - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9273,7 +9317,7 @@ if (__DEV__) { if (nextInstance) { warnIfUnhydratedTailNodes(fiber); - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -15231,7 +15275,9 @@ if (__DEV__) { // matches this hook instance. if (ssrFormState !== null) { - var isMatching = tryToClaimNextHydratableFormMarkerInstance(); + var isMatching = tryToClaimNextHydratableFormMarkerInstance( + currentlyRenderingFiber$1 + ); if (isMatching) { initialState = ssrFormState[0]; @@ -19147,43 +19193,6 @@ if (__DEV__) { return baseProps; } - var CapturedStacks = new WeakMap(); - function createCapturedValueAtFiber(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - var stack; - - if (typeof value === "object" && value !== null) { - var capturedStack = CapturedStacks.get(value); - - if (typeof capturedStack === "string") { - stack = capturedStack; - } else { - stack = getStackByFiberInDevAndProd(source); - CapturedStacks.set(value, stack); - } - } else { - stack = getStackByFiberInDevAndProd(source); - } - - return { - value: value, - source: source, - stack: stack - }; - } - function createCapturedValueFromError(value, stack) { - if (typeof stack === "string") { - CapturedStacks.set(value, stack); - } - - return { - value: value, - source: null, - stack: stack - }; - } - var reportGlobalError = typeof reportError === "function" // In modern browsers, reportError will dispatch an error event, ? // emulating an uncaught JavaScript error. @@ -19809,13 +19818,65 @@ if (__DEV__) { ); // Even though the user may not be affected by this error, we should // still log it so it can be fixed. - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)); + if (value !== HydrationMismatchException) { + var _wrapperError = new Error( + "There was an error while hydrating but React was able to recover by " + + "instead client rendering from the nearest Suspense boundary.", + { + cause: value + } + ); + + queueHydrationError( + createCapturedValueAtFiber(_wrapperError, sourceFiber) + ); + } + + return false; + } else { + if (value !== HydrationMismatchException) { + var _wrapperError2 = new Error( + "There was an error while hydrating but React was able to recover by " + + "instead client rendering the entire root.", + { + cause: value + } + ); + + queueHydrationError( + createCapturedValueAtFiber(_wrapperError2, sourceFiber) + ); + } + + var _workInProgress = root.current.alternate; // Schedule an update at the root to log the error but this shouldn't + // actually happen because we should recover. + + _workInProgress.flags |= ShouldCapture; + var lane = pickArbitraryLane(rootRenderLanes); + _workInProgress.lanes = mergeLanes(_workInProgress.lanes, lane); + var rootErrorInfo = createCapturedValueAtFiber(value, sourceFiber); + var update = createRootErrorUpdate( + _workInProgress.stateNode, + rootErrorInfo, // This should never actually get logged due to the recovery. + lane + ); + enqueueCapturedUpdate(_workInProgress, update); + renderDidError(); return false; } } - value = createCapturedValueAtFiber(value, sourceFiber); - renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + var wrapperError = new Error( + "There was an error during concurrent rendering but React was able to recover by " + + "instead synchronously rendering the entire root.", + { + cause: value + } + ); + queueConcurrentError( + createCapturedValueAtFiber(wrapperError, sourceFiber) + ); + renderDidError(); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. @@ -19825,34 +19886,30 @@ if (__DEV__) { return true; } + var errorInfo = createCapturedValueAtFiber(value, sourceFiber); var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { - var _errorInfo = value; workInProgress.flags |= ShouldCapture; - var lane = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); - var update = createRootErrorUpdate( + + var _lane = pickArbitraryLane(rootRenderLanes); + + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); + + var _update = createRootErrorUpdate( workInProgress.stateNode, - _errorInfo, - lane + errorInfo, + _lane ); - enqueueCapturedUpdate(workInProgress, update); + + enqueueCapturedUpdate(workInProgress, _update); return false; } case ClassComponent: - 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; + // Capture and retry var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -19865,19 +19922,19 @@ if (__DEV__) { ) { workInProgress.flags |= ShouldCapture; - var _lane = pickArbitraryLane(rootRenderLanes); + var _lane2 = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane2); // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(_lane); + var _update2 = createClassErrorUpdate(_lane2); initializeClassErrorUpdate( - _update, + _update2, root, workInProgress, errorInfo ); - enqueueCapturedUpdate(workInProgress, _update); + enqueueCapturedUpdate(workInProgress, _update2); return false; } @@ -21287,37 +21344,27 @@ if (__DEV__) { if (workInProgress.flags & ForceClientRender) { // Something errored during a previous attempt to hydrate the shell, so we - // forced a client render. - var recoverableError = createCapturedValueAtFiber( - new Error( - "There was an error while hydrating. Because the error happened outside " + - "of a Suspense boundary, the entire root will switch to " + - "client rendering." - ), - workInProgress - ); + // forced a client render. We should have a recoverable error already scheduled. return mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ); } else if (nextChildren !== prevChildren) { - var _recoverableError = createCapturedValueAtFiber( + var recoverableError = createCapturedValueAtFiber( new Error( "This root received an early update, before anything was able " + "hydrate. Switched the entire root to client rendering." ), workInProgress ); - + queueHydrationError(recoverableError); return mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - _recoverableError + renderLanes ); } else { // The outermost shell has not hydrated yet. Start hydrating. @@ -21365,12 +21412,10 @@ if (__DEV__) { current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { // Revert to client rendering. resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= ForceClientRender; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -22330,20 +22375,12 @@ if (__DEV__) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. - // - // The error is passed in as an argument to enforce that every caller provide - // a custom message, or explicitly opt out (currently the only path that opts - // out is legacy mode; every concurrent path provides an error). - if (recoverableError !== null) { - queueHydrationError(recoverableError); - } // This will add the old fiber to the deletion list - + // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; @@ -22461,9 +22498,7 @@ if (__DEV__) { message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; componentStack = _getSuspenseInstanceF.componentStack; - } - - var capturedValue = null; // TODO: Figure out a better signal than encoding a magic digest value. + } // TODO: Figure out a better signal than encoding a magic digest value. { var error; @@ -22481,17 +22516,17 @@ if (__DEV__) { error.stack = stack || ""; error.digest = digest; - capturedValue = createCapturedValueFromError( + var capturedValue = createCapturedValueFromError( error, componentStack === undefined ? null : componentStack ); + queueHydrationError(capturedValue); } return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - capturedValue + renderLanes ); } @@ -22566,8 +22601,7 @@ if (__DEV__) { return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else if (isSuspenseInstancePending(suspenseInstance)) { // This component is still pending more data from the server, so we can't hydrate its @@ -22612,22 +22646,13 @@ if (__DEV__) { // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. + // The error should've already been logged in throwException. pushPrimaryTreeSuspenseHandler(workInProgress); workInProgress.flags &= ~ForceClientRender; - - var _capturedValue = createCapturedValueFromError( - new Error( - "There was an error while hydrating this Suspense boundary. " + - "Switched to client rendering." - ), - null - ); - return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - _capturedValue + renderLanes ); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. @@ -32779,11 +32804,12 @@ if (__DEV__) { ); } } - function renderDidError(error) { + function renderDidError() { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } - + } + function queueConcurrentError(error) { if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { @@ -36187,7 +36213,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-bf989094"; + var ReactVersion = "19.0.0-www-classic-cd5ebeba"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 8a2d3055a0..ebe081f39b 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -18129,6 +18129,43 @@ if (__DEV__) { return currentState.isDehydrated; } + var CapturedStacks = new WeakMap(); + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + var stack; + + if (typeof value === "object" && value !== null) { + var capturedStack = CapturedStacks.get(value); + + if (typeof capturedStack === "string") { + stack = capturedStack; + } else { + stack = getStackByFiberInDevAndProd(source); + CapturedStacks.set(value, stack); + } + } else { + stack = getStackByFiberInDevAndProd(source); + } + + return { + value: value, + source: source, + stack: stack + }; + } + function createCapturedValueFromError(value, stack) { + if (typeof stack === "string") { + CapturedStacks.set(value, stack); + } + + return { + value: value, + source: null, + stack: stack + }; + } + // Intentionally not using it yet to derisk the initial implementation, because // the way we push/pop these values is a bit unusual. If there's a mistake, I'd // rather the ids be wrong than crash the whole reconciler. @@ -19197,6 +19234,11 @@ if (__DEV__) { return false; } + var HydrationMismatchException = new Error( + "Hydration Mismatch Exception: This is not a real error, and should not leak into " + + "userspace. If you're seeing this, it's likely a bug in React." + ); + function throwOnHydrationMismatch(fiber) { var diff = ""; @@ -19211,7 +19253,7 @@ if (__DEV__) { } } - throw new Error( + var error = new Error( "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n" + "\n" + "- A server/client branch `if (typeof window !== 'undefined')`.\n" + @@ -19225,6 +19267,8 @@ if (__DEV__) { "https://react.dev/link/hydration-mismatch" + diff ); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function claimHydratableSingleton(fiber) { @@ -19286,7 +19330,7 @@ if (__DEV__) { warnNonHydratedInstance(fiber, nextInstance); } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19310,7 +19354,7 @@ if (__DEV__) { warnNonHydratedInstance(fiber, nextInstance); } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19323,7 +19367,7 @@ if (__DEV__) { if (!nextInstance || !tryHydrateSuspense(fiber, nextInstance)) { warnNonHydratedInstance(fiber, nextInstance); - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19351,7 +19395,7 @@ if (__DEV__) { // rendering. We don't bother to check if we're in a concurrent root because // useActionState is a new API, so backwards compat is not an issue. - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); return false; } @@ -19366,7 +19410,7 @@ if (__DEV__) { ); if (!didHydrate && favorSafetyOverHydrationPerf) { - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19433,7 +19477,7 @@ if (__DEV__) { ); if (!didHydrate && favorSafetyOverHydrationPerf) { - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19527,7 +19571,7 @@ if (__DEV__) { if (nextInstance) { warnIfUnhydratedTailNodes(fiber); - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -25432,7 +25476,9 @@ if (__DEV__) { // matches this hook instance. if (ssrFormState !== null) { - var isMatching = tryToClaimNextHydratableFormMarkerInstance(); + var isMatching = tryToClaimNextHydratableFormMarkerInstance( + currentlyRenderingFiber$1 + ); if (isMatching) { initialState = ssrFormState[0]; @@ -29307,43 +29353,6 @@ if (__DEV__) { return baseProps; } - var CapturedStacks = new WeakMap(); - function createCapturedValueAtFiber(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - var stack; - - if (typeof value === "object" && value !== null) { - var capturedStack = CapturedStacks.get(value); - - if (typeof capturedStack === "string") { - stack = capturedStack; - } else { - stack = getStackByFiberInDevAndProd(source); - CapturedStacks.set(value, stack); - } - } else { - stack = getStackByFiberInDevAndProd(source); - } - - return { - value: value, - source: source, - stack: stack - }; - } - function createCapturedValueFromError(value, stack) { - if (typeof stack === "string") { - CapturedStacks.set(value, stack); - } - - return { - value: value, - source: null, - stack: stack - }; - } - var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // Side-channel since I'm not sure we want to make this part of the public API var componentName = null; @@ -29834,13 +29843,65 @@ if (__DEV__) { ); // Even though the user may not be affected by this error, we should // still log it so it can be fixed. - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)); + if (value !== HydrationMismatchException) { + var _wrapperError = new Error( + "There was an error while hydrating but React was able to recover by " + + "instead client rendering from the nearest Suspense boundary.", + { + cause: value + } + ); + + queueHydrationError( + createCapturedValueAtFiber(_wrapperError, sourceFiber) + ); + } + + return false; + } else { + if (value !== HydrationMismatchException) { + var _wrapperError2 = new Error( + "There was an error while hydrating but React was able to recover by " + + "instead client rendering the entire root.", + { + cause: value + } + ); + + queueHydrationError( + createCapturedValueAtFiber(_wrapperError2, sourceFiber) + ); + } + + var _workInProgress = root.current.alternate; // Schedule an update at the root to log the error but this shouldn't + // actually happen because we should recover. + + _workInProgress.flags |= ShouldCapture; + var lane = pickArbitraryLane(rootRenderLanes); + _workInProgress.lanes = mergeLanes(_workInProgress.lanes, lane); + var rootErrorInfo = createCapturedValueAtFiber(value, sourceFiber); + var update = createRootErrorUpdate( + _workInProgress.stateNode, + rootErrorInfo, // This should never actually get logged due to the recovery. + lane + ); + enqueueCapturedUpdate(_workInProgress, update); + renderDidError(); return false; } } - value = createCapturedValueAtFiber(value, sourceFiber); - renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + var wrapperError = new Error( + "There was an error during concurrent rendering but React was able to recover by " + + "instead synchronously rendering the entire root.", + { + cause: value + } + ); + queueConcurrentError( + createCapturedValueAtFiber(wrapperError, sourceFiber) + ); + renderDidError(); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. @@ -29850,34 +29911,30 @@ if (__DEV__) { return true; } + var errorInfo = createCapturedValueAtFiber(value, sourceFiber); var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { - var _errorInfo = value; workInProgress.flags |= ShouldCapture; - var lane = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); - var update = createRootErrorUpdate( + + var _lane = pickArbitraryLane(rootRenderLanes); + + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); + + var _update = createRootErrorUpdate( workInProgress.stateNode, - _errorInfo, - lane + errorInfo, + _lane ); - enqueueCapturedUpdate(workInProgress, update); + + enqueueCapturedUpdate(workInProgress, _update); return false; } case ClassComponent: - 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; + // Capture and retry var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -29890,19 +29947,19 @@ if (__DEV__) { ) { workInProgress.flags |= ShouldCapture; - var _lane = pickArbitraryLane(rootRenderLanes); + var _lane2 = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane2); // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(_lane); + var _update2 = createClassErrorUpdate(_lane2); initializeClassErrorUpdate( - _update, + _update2, root, workInProgress, errorInfo ); - enqueueCapturedUpdate(workInProgress, _update); + enqueueCapturedUpdate(workInProgress, _update2); return false; } @@ -31251,37 +31308,27 @@ if (__DEV__) { if (workInProgress.flags & ForceClientRender) { // Something errored during a previous attempt to hydrate the shell, so we - // forced a client render. - var recoverableError = createCapturedValueAtFiber( - new Error( - "There was an error while hydrating. Because the error happened outside " + - "of a Suspense boundary, the entire root will switch to " + - "client rendering." - ), - workInProgress - ); + // forced a client render. We should have a recoverable error already scheduled. return mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ); } else if (nextChildren !== prevChildren) { - var _recoverableError = createCapturedValueAtFiber( + var recoverableError = createCapturedValueAtFiber( new Error( "This root received an early update, before anything was able " + "hydrate. Switched the entire root to client rendering." ), workInProgress ); - + queueHydrationError(recoverableError); return mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - _recoverableError + renderLanes ); } else { // The outermost shell has not hydrated yet. Start hydrating. @@ -31329,12 +31376,10 @@ if (__DEV__) { current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { // Revert to client rendering. resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= ForceClientRender; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -32192,20 +32237,12 @@ if (__DEV__) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. - // - // The error is passed in as an argument to enforce that every caller provide - // a custom message, or explicitly opt out (currently the only path that opts - // out is legacy mode; every concurrent path provides an error). - if (recoverableError !== null) { - queueHydrationError(recoverableError); - } // This will add the old fiber to the deletion list - + // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; @@ -32323,9 +32360,7 @@ if (__DEV__) { message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; componentStack = _getSuspenseInstanceF.componentStack; - } - - var capturedValue = null; // TODO: Figure out a better signal than encoding a magic digest value. + } // TODO: Figure out a better signal than encoding a magic digest value. { var error; @@ -32343,17 +32378,17 @@ if (__DEV__) { error.stack = stack || ""; error.digest = digest; - capturedValue = createCapturedValueFromError( + var capturedValue = createCapturedValueFromError( error, componentStack === undefined ? null : componentStack ); + queueHydrationError(capturedValue); } return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - capturedValue + renderLanes ); } @@ -32428,8 +32463,7 @@ if (__DEV__) { return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else if (isSuspenseInstancePending(suspenseInstance)) { // This component is still pending more data from the server, so we can't hydrate its @@ -32474,22 +32508,13 @@ if (__DEV__) { // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. + // The error should've already been logged in throwException. pushPrimaryTreeSuspenseHandler(workInProgress); workInProgress.flags &= ~ForceClientRender; - - var _capturedValue = createCapturedValueFromError( - new Error( - "There was an error while hydrating this Suspense boundary. " + - "Switched to client rendering." - ), - null - ); - return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - _capturedValue + renderLanes ); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. @@ -42381,11 +42406,12 @@ if (__DEV__) { ); } } - function renderDidError(error) { + function renderDidError() { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } - + } + function queueConcurrentError(error) { if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { @@ -45681,7 +45707,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-232b2124"; + var ReactVersion = "19.0.0-www-modern-b12aa191"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 9fe17602f4..91d4449cd8 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -1613,7 +1613,17 @@ function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } var objectIs = "function" === typeof Object.is ? Object.is : is, - forkStack = [], + CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; +} +var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, @@ -1679,9 +1689,12 @@ var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1, hydrationErrors = null, - rootOrSingletonContext = !1; -function throwOnHydrationMismatch() { - throw Error(formatProdErrorMessage(418, "")); + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function prepareToHydrateHostInstance(fiber) { var instance = fiber.stateNode, @@ -1701,8 +1714,8 @@ function prepareToHydrateHostInstance(fiber) { break; case "video": case "audio": - for (fiber = 0; fiber < mediaEventTypes.length; fiber++) - listenToNonDelegatedEvent(mediaEventTypes[fiber], instance); + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); break; case "source": listenToNonDelegatedEvent("error", instance); @@ -1738,20 +1751,20 @@ function prepareToHydrateHostInstance(fiber) { initTextarea(instance, props.value, props.defaultValue, props.children), track(instance); } - fiber = props.children; - ("string" !== typeof fiber && - "number" !== typeof fiber && - "bigint" !== typeof fiber) || - instance.textContent === "" + fiber || + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, fiber) + checkForUnmatchedText(instance.textContent, type) ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$2), (instance = !0)) : (instance = !1); - !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(); + !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); } function popToNextHostParent(fiber) { for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) @@ -1782,7 +1795,7 @@ function popHydrationState(fiber) { JSCompiler_temp = !JSCompiler_temp; } JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); popToNextHostParent(fiber); if (13 === fiber.tag) { fiber = fiber.memoizedState; @@ -3828,42 +3841,44 @@ function mountActionState(action, initialStateProp) { var ssrFormState = workInProgressRoot.formState; if (null !== ssrFormState) { a: { + var JSCompiler_inline_result = currentlyRenderingFiber$1; if (isHydrating) { if (nextHydratableInstance) { b: { - var JSCompiler_inline_result = nextHydratableInstance; + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; for ( var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result.nodeType; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) { if (!inRootOrSingleton) { - JSCompiler_inline_result = null; + JSCompiler_inline_result$jscomp$0 = null; break b; } - JSCompiler_inline_result = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling ); - if (null === JSCompiler_inline_result) { - JSCompiler_inline_result = null; + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; break b; } } - inRootOrSingleton = JSCompiler_inline_result.data; - JSCompiler_inline_result = + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result + ? JSCompiler_inline_result$jscomp$0 : null; } - if (JSCompiler_inline_result) { + if (JSCompiler_inline_result$jscomp$0) { nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0.nextSibling ); - JSCompiler_inline_result = "F!" === JSCompiler_inline_result.data; + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; break a; } } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(JSCompiler_inline_result); } JSCompiler_inline_result = !1; } @@ -3887,28 +3902,28 @@ function mountActionState(action, initialStateProp) { ); JSCompiler_inline_result.dispatch = ssrFormState; JSCompiler_inline_result = mountStateImpl(!1); - var setPendingState = dispatchOptimisticSetState.bind( + inRootOrSingleton = dispatchOptimisticSetState.bind( null, currentlyRenderingFiber$1, !1, JSCompiler_inline_result.queue ); JSCompiler_inline_result = mountWorkInProgressHook(); - inRootOrSingleton = { + JSCompiler_inline_result$jscomp$0 = { state: initialStateProp, dispatch: null, action: action, pending: null }; - JSCompiler_inline_result.queue = inRootOrSingleton; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; ssrFormState = dispatchActionState.bind( null, currentlyRenderingFiber$1, + JSCompiler_inline_result$jscomp$0, inRootOrSingleton, - setPendingState, ssrFormState ); - inRootOrSingleton.dispatch = ssrFormState; + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; JSCompiler_inline_result.memoizedState = action; return [initialStateProp, ssrFormState, !1]; } @@ -4811,20 +4826,6 @@ function resolveDefaultProps(Component, baseProps) { } return baseProps; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; -} -function createCapturedValueFromError(value, stack) { - "string" === typeof stack && CapturedStacks.set(value, stack); - return { value: value, source: null, stack: stack }; -} var reportGlobalError = "function" === typeof reportError ? reportError @@ -4969,152 +4970,182 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - var wakeable = value; - enableLazyContextPropagation && - ((value = sourceFiber.alternate), - null !== value && - propagateParentContextChanges(value, sourceFiber, rootRenderLanes, !0)); - value = sourceFiber.tag; + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + } + currentSourceFiber = sourceFiber.tag; 0 !== (sourceFiber.mode & 1) || - (0 !== value && 11 !== value && 15 !== value) || - ((value = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = value.updateQueue), - (sourceFiber.memoizedState = value.memoizedState), - (sourceFiber.lanes = value.lanes)) + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) : ((sourceFiber.updateQueue = null), (sourceFiber.memoizedState = null))); - value = suspenseHandlerStackCursor.current; - if (null !== value) { - switch (value.tag) { + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: return ( sourceFiber.mode & 1 && (null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === value.alternate && + : null === currentSourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3)), - (value.flags &= -257), + (currentSourceFiber.flags &= -257), markSuspenseBoundaryShouldCapture( - value, + currentSourceFiber, returnFiber, sourceFiber, root, rootRenderLanes ), - wakeable === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((sourceFiber = value.updateQueue), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), null === sourceFiber - ? (value.updateQueue = new Set([wakeable])) - : sourceFiber.add(wakeable), - value.mode & 1 && - attachPingListener(root, wakeable, rootRenderLanes)), + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & 1 && + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: - if (value.mode & 1) + if (currentSourceFiber.mode & 1) return ( - (value.flags |= 65536), - wakeable === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((sourceFiber = value.updateQueue), + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), null === sourceFiber ? ((sourceFiber = { transitions: null, markerInstances: null, - retryQueue: new Set([wakeable]) + retryQueue: new Set([value]) }), - (value.updateQueue = sourceFiber)) + (currentSourceFiber.updateQueue = sourceFiber)) : ((returnFiber = sourceFiber.retryQueue), null === returnFiber - ? (sourceFiber.retryQueue = new Set([wakeable])) - : returnFiber.add(wakeable)), - attachPingListener(root, wakeable, rootRenderLanes)), + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), !1 ); } - throw Error(formatProdErrorMessage(435, value.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } if (1 === root.tag) return ( - attachPingListener(root, wakeable, rootRenderLanes), + attachPingListener(root, value, rootRenderLanes), renderDidSuspendDelayIfPossible(), !1 ); value = Error(formatProdErrorMessage(426)); } - if ( - isHydrating && - sourceFiber.mode & 1 && - ((wakeable = suspenseHandlerStackCursor.current), null !== wakeable) - ) + if (isHydrating && sourceFiber.mode & 1) return ( - 0 === (wakeable.flags & 65536) && (wakeable.flags |= 256), - markSuspenseBoundaryShouldCapture( - wakeable, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)), - !1 - ); - wakeable = value = createCapturedValueAtFiber(value, sourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wakeable]) - : workInProgressRootConcurrentErrors.push(wakeable); - if (null === returnFiber) return !0; - wakeable = returnFiber; - do { - switch (wakeable.tag) { - case 3: - return ( - (root = value), - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (root = createRootErrorUpdate( - wakeable.stateNode, + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, root, rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes )), - enqueueCapturedUpdate(wakeable, root), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 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 && + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.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 - ); - } + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); } - wakeable = wakeable.return; - } while (null !== wakeable); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -5224,10 +5255,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$71 = workInProgress.stateNode; + root$75 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$71.incompleteTransitions.has(transition)) { + if (!root$75.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5235,11 +5266,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$71.incompleteTransitions.set(transition, markerInstance); + root$75.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$71.incompleteTransitions.forEach(function (markerInstance) { + root$75.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5828,11 +5859,9 @@ function mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= 256; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -5911,7 +5940,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (JSCompiler_temp$jscomp$0 = !0)) : (JSCompiler_temp$jscomp$0 = !1); } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(); + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } nextInstance = workInProgress.memoizedState; if ( @@ -5997,15 +6026,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags &= -257), - (JSCompiler_temp = createCapturedValueFromError( - Error(formatProdErrorMessage(422)), - null - )), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ))) : null !== workInProgress.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress), @@ -6059,12 +6083,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps = Error(formatProdErrorMessage(419)); nextProps.stack = ""; nextProps.digest = JSCompiler_temp; - JSCompiler_temp = createCapturedValueFromError(nextProps, null); + queueHydrationError({ value: nextProps, source: null, stack: null }); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ); } else if ( (enableLazyContextPropagation && @@ -6132,8 +6155,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else "$?" === nextInstance.data @@ -6312,10 +6334,8 @@ function mountSuspenseFallbackChildren( function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { - null !== recoverableError && queueHydrationError(recoverableError); reconcileChildFibers(workInProgress, current.child, null, renderLanes); current = mountSuspensePrimaryChildren( workInProgress, @@ -6713,55 +6733,50 @@ function beginWork(current, workInProgress, renderLanes) { a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); - elementType = workInProgress.pendingProps; - var prevState = workInProgress.memoizedState; - props = prevState.element; + var nextProps = workInProgress.pendingProps; + elementType = workInProgress.memoizedState; + props = elementType.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, elementType, null, renderLanes); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - elementType = nextState.cache; - pushProvider(workInProgress, CacheContext, elementType); - elementType !== prevState.cache && + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== elementType.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - elementType = nextState.element; - if (prevState.isDehydrated) + nextProps = nextState.element; + if (elementType.isDehydrated) if ( - ((prevState = { - element: elementType, + ((elementType = { + element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = prevState), - (workInProgress.memoizedState = prevState), + (workInProgress.updateQueue.baseState = elementType), + (workInProgress.memoizedState = elementType), workInProgress.flags & 256) ) { - props = createCapturedValueAtFiber( - Error(formatProdErrorMessage(423)), - workInProgress - ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - elementType, - renderLanes, - props + nextProps, + renderLanes ); break a; - } else if (elementType !== props) { + } else if (nextProps !== props) { props = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); + queueHydrationError(props); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - elementType, - renderLanes, - props + nextProps, + renderLanes ); break a; } else @@ -6776,7 +6791,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - elementType, + nextProps, renderLanes ), workInProgress.child = renderLanes; @@ -6787,7 +6802,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (elementType === props) { + if (nextProps === props) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -6795,7 +6810,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, nextProps, renderLanes); } workInProgress = workInProgress.child; } @@ -6866,14 +6881,14 @@ function beginWork(current, workInProgress, renderLanes) { (rootOrSingletonContext = !1), (elementType = !0)) : (elementType = !1); - elementType || throwOnHydrationMismatch(); + elementType || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); elementType = workInProgress.type; - prevState = workInProgress.pendingProps; + nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - props = prevState.children; - shouldSetTextContent(elementType, prevState) + props = nextProps.children; + shouldSetTextContent(elementType, nextProps) ? (props = null) : null !== nextState && shouldSetTextContent(elementType, nextState) && @@ -6914,7 +6929,7 @@ function beginWork(current, workInProgress, renderLanes) { (nextHydratableInstance = null), (current = !0)) : (current = !1); - current || throwOnHydrationMismatch(); + current || throwOnHydrationMismatch(workInProgress); } return null; case 13: @@ -6988,13 +7003,13 @@ function beginWork(current, workInProgress, renderLanes) { ? workInProgress.type : workInProgress.type._context; elementType = workInProgress.pendingProps; - prevState = workInProgress.memoizedProps; + nextProps = workInProgress.memoizedProps; nextState = elementType.value; pushProvider(workInProgress, props, nextState); - if (!enableLazyContextPropagation && null !== prevState) - if (objectIs(prevState.value, nextState)) { + if (!enableLazyContextPropagation && null !== nextProps) + if (objectIs(nextProps.value, nextState)) { if ( - prevState.children === elementType.children && + nextProps.children === elementType.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7112,12 +7127,12 @@ function beginWork(current, workInProgress, renderLanes) { ? ((elementType = peekCacheFromPool()), null === elementType && ((elementType = workInProgressRoot), - (prevState = createCache()), - (elementType.pooledCache = prevState), - prevState.refCount++, - null !== prevState && + (nextProps = createCache()), + (elementType.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (elementType.pooledCacheLanes |= renderLanes), - (elementType = prevState)), + (elementType = nextProps)), (workInProgress.memoizedState = { parent: props, cache: elementType @@ -7129,7 +7144,7 @@ function beginWork(current, workInProgress, renderLanes) { processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), (elementType = current.memoizedState), - (prevState = workInProgress.memoizedState), + (nextProps = workInProgress.memoizedState), elementType.parent !== props ? ((elementType = { parent: props, cache: props }), (workInProgress.memoizedState = elementType), @@ -7138,7 +7153,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.updateQueue.baseState = elementType), pushProvider(workInProgress, CacheContext, props)) - : ((props = prevState.cache), + : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== elementType.cache && propagateContextChange( @@ -7685,14 +7700,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$116 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$116 = lastTailNode), + for (var lastTailNode$118 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$118 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$116 + null === lastTailNode$118 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$116.sibling = null); + : (lastTailNode$118.sibling = null); } } function bubbleProperties(completedWork) { @@ -7702,19 +7717,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$117 = completedWork.child; null !== child$117; ) - (newChildLanes |= child$117.lanes | child$117.childLanes), - (subtreeFlags |= child$117.subtreeFlags & 31457280), - (subtreeFlags |= child$117.flags & 31457280), - (child$117.return = completedWork), - (child$117 = child$117.sibling); + for (var child$119 = completedWork.child; null !== child$119; ) + (newChildLanes |= child$119.lanes | child$119.childLanes), + (subtreeFlags |= child$119.subtreeFlags & 31457280), + (subtreeFlags |= child$119.flags & 31457280), + (child$119.return = completedWork), + (child$119 = child$119.sibling); else - for (child$117 = completedWork.child; null !== child$117; ) - (newChildLanes |= child$117.lanes | child$117.childLanes), - (subtreeFlags |= child$117.subtreeFlags), - (subtreeFlags |= child$117.flags), - (child$117.return = completedWork), - (child$117 = child$117.sibling); + for (child$119 = completedWork.child; null !== child$119; ) + (newChildLanes |= child$119.lanes | child$119.childLanes), + (subtreeFlags |= child$119.subtreeFlags), + (subtreeFlags |= child$119.flags), + (child$119.return = completedWork), + (child$119 = child$119.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7973,7 +7988,7 @@ function completeWork(current, workInProgress, renderLanes) { : !1; !current && favorSafetyOverHydrationPerf && - throwOnHydrationMismatch(); + throwOnHydrationMismatch(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -8030,11 +8045,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (currentResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$129 = null; + var cache$131 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$129 = newProps.memoizedState.cachePool.pool); - cache$129 !== currentResource && (newProps.flags |= 2048); + (cache$131 = newProps.memoizedState.cachePool.pool); + cache$131 !== currentResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8075,8 +8090,8 @@ function completeWork(current, workInProgress, renderLanes) { if (null === currentResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$129 = currentResource.rendering; - if (null === cache$129) + cache$131 = currentResource.rendering; + if (null === cache$131) if (newProps) cutOffTailIfNeeded(currentResource, !1); else { if ( @@ -8084,11 +8099,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$129 = findFirstSuspended(current); - if (null !== cache$129) { + cache$131 = findFirstSuspended(current); + if (null !== cache$131) { workInProgress.flags |= 128; cutOffTailIfNeeded(currentResource, !1); - current = cache$129.updateQueue; + current = cache$131.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8113,7 +8128,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$129)), null !== current)) { + if (((current = findFirstSuspended(cache$131)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8123,7 +8138,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !0), null === currentResource.tail && "hidden" === currentResource.tailMode && - !cache$129.alternate && + !cache$131.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8136,13 +8151,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !1), (workInProgress.lanes = 4194304)); currentResource.isBackwards - ? ((cache$129.sibling = workInProgress.child), - (workInProgress.child = cache$129)) + ? ((cache$131.sibling = workInProgress.child), + (workInProgress.child = cache$131)) : ((current = currentResource.last), null !== current - ? (current.sibling = cache$129) - : (workInProgress.child = cache$129), - (currentResource.last = cache$129)); + ? (current.sibling = cache$131) + : (workInProgress.child = cache$131), + (currentResource.last = cache$131)); } if (null !== currentResource.tail) return ( @@ -8416,8 +8431,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$147) { - captureCommitPhaseError(current, nearestMountedAncestor, error$147); + } catch (error$149) { + captureCommitPhaseError(current, nearestMountedAncestor, error$149); } else ref.current = null; } @@ -8454,7 +8469,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$197) { + } catch (e$199) { JSCompiler_temp = null; break a; } @@ -8722,11 +8737,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$149) { + } catch (error$151) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$149 + error$151 ); } } @@ -9404,8 +9419,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$162) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$162); + } catch (error$164) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$164); } } break; @@ -9577,11 +9592,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$163) { + } catch (error$165) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$165 ); } } @@ -9619,8 +9634,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$164) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$164); + } catch (error$166) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$166); } } if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { @@ -9631,8 +9646,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(flags, hoistableRoot, current, root), (flags[internalPropsKey] = root); - } catch (error$167) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$167); + } catch (error$169) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$169); } } break; @@ -9646,8 +9661,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$168) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$168); + } catch (error$170) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$170); } } break; @@ -9661,8 +9676,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$169) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$169); + } catch (error$171) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$171); } break; case 4: @@ -9692,8 +9707,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$171) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$171); + } catch (error$173) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$173); } current = finishedWork.updateQueue; null !== current && @@ -9771,11 +9786,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$152) { + } catch (error$154) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$152 + error$154 ); } } else if ( @@ -9850,21 +9865,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$153 = JSCompiler_inline_result.stateNode; + var parent$155 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$153, ""), + (setTextContent(parent$155, ""), (JSCompiler_inline_result.flags &= -33)); - var before$154 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$154, parent$153); + var before$156 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$156, parent$155); break; case 3: case 4: - var parent$155 = JSCompiler_inline_result.stateNode.containerInfo, - before$156 = getHostSibling(finishedWork); + var parent$157 = JSCompiler_inline_result.stateNode.containerInfo, + before$158 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$156, - parent$155 + before$158, + parent$157 ); break; default: @@ -10331,9 +10346,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$178 = finishedWork.stateNode; + var instance$180 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$178._visibility & 4 + ? instance$180._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10346,7 +10361,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$178._visibility |= 4), + : ((instance$180._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10354,7 +10369,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$178._visibility |= 4), + : ((instance$180._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10367,7 +10382,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$178 + instance$180 ); break; case 24: @@ -11349,8 +11364,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$186) { - handleThrow(root, thrownValue$186); + } catch (thrownValue$188) { + handleThrow(root, thrownValue$188); } while (1); lanes && root.shellSuspendCounter++; @@ -11455,8 +11470,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$188) { - handleThrow(root, thrownValue$188); + } catch (thrownValue$190) { + handleThrow(root, thrownValue$190); } while (1); resetContextDependencies(); @@ -11683,12 +11698,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$192 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$194 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$192 && + shouldFireAfterActiveInstanceBlur$194 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11760,7 +11775,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$193 = rootWithPendingPassiveEffects, + var root$195 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -11776,7 +11791,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$193, remainingLanes); + releaseRootPooledCache(root$195, remainingLanes); } } return !1; @@ -12479,12 +12494,12 @@ function getPublicRootInstance(container) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$195 = fiber.stateNode; - if (root$195.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$195.pendingLanes); + var root$197 = fiber.stateNode; + if (root$197.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$197.pendingLanes); 0 !== lanes && - (upgradePendingLanesToSync(root$195, lanes), - ensureRootIsScheduled(root$195), + (upgradePendingLanesToSync(root$197, lanes), + ensureRootIsScheduled(root$197), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -13050,19 +13065,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$346; + var JSCompiler_inline_result$jscomp$348; if (canUseDOM) { - var isSupported$jscomp$inline_1485 = "oninput" in document; - if (!isSupported$jscomp$inline_1485) { - var element$jscomp$inline_1486 = document.createElement("div"); - element$jscomp$inline_1486.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1485 = - "function" === typeof element$jscomp$inline_1486.oninput; + var isSupported$jscomp$inline_1487 = "oninput" in document; + if (!isSupported$jscomp$inline_1487) { + var element$jscomp$inline_1488 = document.createElement("div"); + element$jscomp$inline_1488.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1487 = + "function" === typeof element$jscomp$inline_1488.oninput; } - JSCompiler_inline_result$jscomp$346 = isSupported$jscomp$inline_1485; - } else JSCompiler_inline_result$jscomp$346 = !1; + JSCompiler_inline_result$jscomp$348 = isSupported$jscomp$inline_1487; + } else JSCompiler_inline_result$jscomp$348 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$346 && + JSCompiler_inline_result$jscomp$348 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13434,20 +13449,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1526 = 0; - i$jscomp$inline_1526 < simpleEventPluginEvents.length; - i$jscomp$inline_1526++ + var i$jscomp$inline_1528 = 0; + i$jscomp$inline_1528 < simpleEventPluginEvents.length; + i$jscomp$inline_1528++ ) { - var eventName$jscomp$inline_1527 = - simpleEventPluginEvents[i$jscomp$inline_1526], - domEventName$jscomp$inline_1528 = - eventName$jscomp$inline_1527.toLowerCase(), - capitalizedEvent$jscomp$inline_1529 = - eventName$jscomp$inline_1527[0].toUpperCase() + - eventName$jscomp$inline_1527.slice(1); + var eventName$jscomp$inline_1529 = + simpleEventPluginEvents[i$jscomp$inline_1528], + domEventName$jscomp$inline_1530 = + eventName$jscomp$inline_1529.toLowerCase(), + capitalizedEvent$jscomp$inline_1531 = + eventName$jscomp$inline_1529[0].toUpperCase() + + eventName$jscomp$inline_1529.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1528, - "on" + capitalizedEvent$jscomp$inline_1529 + domEventName$jscomp$inline_1530, + "on" + capitalizedEvent$jscomp$inline_1531 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14917,14 +14932,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$224 in nextProps) { - var propKey = nextProps[propKey$224]; - lastProp = lastProps[propKey$224]; + for (var propKey$226 in nextProps) { + var propKey = nextProps[propKey$226]; + lastProp = lastProps[propKey$226]; if ( - nextProps.hasOwnProperty(propKey$224) && + nextProps.hasOwnProperty(propKey$226) && (null != propKey || null != lastProp) ) - switch (propKey$224) { + switch (propKey$226) { case "type": type = propKey; break; @@ -14953,7 +14968,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$224, + propKey$226, propKey, nextProps, lastProp @@ -14972,7 +14987,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$224 = null; + propKey = value = defaultValue = propKey$226 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15003,7 +15018,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$224 = type; + propKey$226 = type; break; case "defaultValue": defaultValue = type; @@ -15024,15 +15039,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$224 - ? updateOptions(domElement, !!lastProps, propKey$224, !1) + null != propKey$226 + ? updateOptions(domElement, !!lastProps, propKey$226, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$224 = null; + propKey = propKey$226 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15056,7 +15071,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$224 = name; + propKey$226 = name; break; case "defaultValue": propKey = name; @@ -15070,17 +15085,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$224, propKey); + updateTextarea(domElement, propKey$226, propKey); return; case "option": - for (var propKey$240 in lastProps) + for (var propKey$242 in lastProps) if ( - ((propKey$224 = lastProps[propKey$240]), - lastProps.hasOwnProperty(propKey$240) && - null != propKey$224 && - !nextProps.hasOwnProperty(propKey$240)) + ((propKey$226 = lastProps[propKey$242]), + lastProps.hasOwnProperty(propKey$242) && + null != propKey$226 && + !nextProps.hasOwnProperty(propKey$242)) ) - switch (propKey$240) { + switch (propKey$242) { case "selected": domElement.selected = !1; break; @@ -15088,33 +15103,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$240, + propKey$242, null, nextProps, - propKey$224 + propKey$226 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$224 = nextProps[lastDefaultValue]), + ((propKey$226 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$224 !== propKey && - (null != propKey$224 || null != propKey)) + propKey$226 !== propKey && + (null != propKey$226 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$224 && - "function" !== typeof propKey$224 && - "symbol" !== typeof propKey$224; + propKey$226 && + "function" !== typeof propKey$226 && + "symbol" !== typeof propKey$226; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$224, + propKey$226, nextProps, propKey ); @@ -15135,24 +15150,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$245 in lastProps) - (propKey$224 = lastProps[propKey$245]), - lastProps.hasOwnProperty(propKey$245) && - null != propKey$224 && - !nextProps.hasOwnProperty(propKey$245) && - setProp(domElement, tag, propKey$245, null, nextProps, propKey$224); + for (var propKey$247 in lastProps) + (propKey$226 = lastProps[propKey$247]), + lastProps.hasOwnProperty(propKey$247) && + null != propKey$226 && + !nextProps.hasOwnProperty(propKey$247) && + setProp(domElement, tag, propKey$247, null, nextProps, propKey$226); for (checked in nextProps) if ( - ((propKey$224 = nextProps[checked]), + ((propKey$226 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$224 !== propKey && - (null != propKey$224 || null != propKey)) + propKey$226 !== propKey && + (null != propKey$226 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$224) + if (null != propKey$226) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15160,7 +15175,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$224, + propKey$226, nextProps, propKey ); @@ -15168,49 +15183,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$250 in lastProps) - (propKey$224 = lastProps[propKey$250]), - lastProps.hasOwnProperty(propKey$250) && - void 0 !== propKey$224 && - !nextProps.hasOwnProperty(propKey$250) && + for (var propKey$252 in lastProps) + (propKey$226 = lastProps[propKey$252]), + lastProps.hasOwnProperty(propKey$252) && + void 0 !== propKey$226 && + !nextProps.hasOwnProperty(propKey$252) && setPropOnCustomElement( domElement, tag, - propKey$250, + propKey$252, void 0, nextProps, - propKey$224 + propKey$226 ); for (defaultChecked in nextProps) - (propKey$224 = nextProps[defaultChecked]), + (propKey$226 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$224 === propKey || - (void 0 === propKey$224 && void 0 === propKey) || + propKey$226 === propKey || + (void 0 === propKey$226 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$224, + propKey$226, nextProps, propKey ); return; } } - for (var propKey$255 in lastProps) - (propKey$224 = lastProps[propKey$255]), - lastProps.hasOwnProperty(propKey$255) && - null != propKey$224 && - !nextProps.hasOwnProperty(propKey$255) && - setProp(domElement, tag, propKey$255, null, nextProps, propKey$224); + for (var propKey$257 in lastProps) + (propKey$226 = lastProps[propKey$257]), + lastProps.hasOwnProperty(propKey$257) && + null != propKey$226 && + !nextProps.hasOwnProperty(propKey$257) && + setProp(domElement, tag, propKey$257, null, nextProps, propKey$226); for (lastProp in nextProps) - (propKey$224 = nextProps[lastProp]), + (propKey$226 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$224 === propKey || - (null == propKey$224 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$224, nextProps, propKey); + propKey$226 === propKey || + (null == propKey$226 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$226, nextProps, propKey); } function noop$1() {} var Internals = { @@ -15799,17 +15814,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$263 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$264 = styles$263.get(type); - resource$264 || + var styles$265 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$266 = styles$265.get(type); + resource$266 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$264 = { + (resource$266 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$263.set(type, resource$264), + styles$265.set(type, resource$266), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15824,9 +15839,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$264.state + resource$266.state )); - return resource$264; + return resource$266; } return null; case "script": @@ -15909,37 +15924,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$268 = hoistableRoot.querySelector( + var instance$270 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$268) + if (instance$270) return ( (resource.state.loading |= 4), - (resource.instance = instance$268), - markNodeAsHoistable(instance$268), - instance$268 + (resource.instance = instance$270), + markNodeAsHoistable(instance$270), + instance$270 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$268 = ( + instance$270 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$268); - var linkInstance = instance$268; + markNodeAsHoistable(instance$270); + var linkInstance = instance$270; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$268, "link", instance); + setInitialProperties(instance$270, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$268, props.precedence, hoistableRoot); - return (resource.instance = instance$268); + insertStylesheet(instance$270, props.precedence, hoistableRoot); + return (resource.instance = instance$270); case "script": - instance$268 = getScriptKey(props.src); + instance$270 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$268) + getScriptSelectorFromKey(instance$270) )) ) return ( @@ -15948,7 +15963,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$268))) + if ((styleProps = preloadPropsMap.get(instance$270))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16975,17 +16990,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1702 = { +var devToolsConfig$jscomp$inline_1704 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-872fa742", + version: "19.0.0-www-classic-83138ece", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2128 = { - bundleType: devToolsConfig$jscomp$inline_1702.bundleType, - version: devToolsConfig$jscomp$inline_1702.version, - rendererPackageName: devToolsConfig$jscomp$inline_1702.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1702.rendererConfig, +var internals$jscomp$inline_2134 = { + bundleType: devToolsConfig$jscomp$inline_1704.bundleType, + version: devToolsConfig$jscomp$inline_1704.version, + rendererPackageName: devToolsConfig$jscomp$inline_1704.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1704.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17001,26 +17016,26 @@ var internals$jscomp$inline_2128 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1702.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1704.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-872fa742" + reconcilerVersion: "19.0.0-www-classic-83138ece" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2129 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2135 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2129.isDisabled && - hook$jscomp$inline_2129.supportsFiber + !hook$jscomp$inline_2135.isDisabled && + hook$jscomp$inline_2135.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2129.inject( - internals$jscomp$inline_2128 + (rendererID = hook$jscomp$inline_2135.inject( + internals$jscomp$inline_2134 )), - (injectedHook = hook$jscomp$inline_2129); + (injectedHook = hook$jscomp$inline_2135); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -17056,11 +17071,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$289); + var instance = getPublicRootInstance(root$291); originalCallback.call(instance); }; } - var root$289 = createHydrationContainer( + var root$291 = createHydrationContainer( initialChildren, callback, container, @@ -17075,23 +17090,23 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$289; - container[internalContainerInstanceKey] = root$289.current; + container._reactRootContainer = root$291; + container[internalContainerInstanceKey] = root$291.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$289; + return root$291; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$290 = callback; + var originalCallback$292 = callback; callback = function () { - var instance = getPublicRootInstance(root$291); - originalCallback$290.call(instance); + var instance = getPublicRootInstance(root$293); + originalCallback$292.call(instance); }; } - var root$291 = createFiberRoot( + var root$293 = createFiberRoot( container, 0, !1, @@ -17106,15 +17121,15 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$291; - container[internalContainerInstanceKey] = root$291.current; + container._reactRootContainer = root$293; + container[internalContainerInstanceKey] = root$293.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$291, parentComponent, callback); + updateContainer(initialChildren, root$293, parentComponent, callback); }); - return root$291; + return root$293; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -17464,4 +17479,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-872fa742"; +exports.version = "19.0.0-www-classic-83138ece"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 5e5351c405..d4a4a83d51 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -2069,19 +2069,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$292; + var JSCompiler_inline_result$jscomp$294; if (canUseDOM) { - var isSupported$jscomp$inline_421 = "oninput" in document; - if (!isSupported$jscomp$inline_421) { - var element$jscomp$inline_422 = document.createElement("div"); - element$jscomp$inline_422.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_421 = - "function" === typeof element$jscomp$inline_422.oninput; + var isSupported$jscomp$inline_423 = "oninput" in document; + if (!isSupported$jscomp$inline_423) { + var element$jscomp$inline_424 = document.createElement("div"); + element$jscomp$inline_424.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_423 = + "function" === typeof element$jscomp$inline_424.oninput; } - JSCompiler_inline_result$jscomp$292 = isSupported$jscomp$inline_421; - } else JSCompiler_inline_result$jscomp$292 = !1; + JSCompiler_inline_result$jscomp$294 = isSupported$jscomp$inline_423; + } else JSCompiler_inline_result$jscomp$294 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$292 && + JSCompiler_inline_result$jscomp$294 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2508,19 +2508,19 @@ for ( } console.error(error); }, - i$jscomp$inline_462 = 0; - i$jscomp$inline_462 < simpleEventPluginEvents.length; - i$jscomp$inline_462++ + i$jscomp$inline_464 = 0; + i$jscomp$inline_464 < simpleEventPluginEvents.length; + i$jscomp$inline_464++ ) { - var eventName$jscomp$inline_463 = - simpleEventPluginEvents[i$jscomp$inline_462], - domEventName$jscomp$inline_464 = eventName$jscomp$inline_463.toLowerCase(), - capitalizedEvent$jscomp$inline_465 = - eventName$jscomp$inline_463[0].toUpperCase() + - eventName$jscomp$inline_463.slice(1); + var eventName$jscomp$inline_465 = + simpleEventPluginEvents[i$jscomp$inline_464], + domEventName$jscomp$inline_466 = eventName$jscomp$inline_465.toLowerCase(), + capitalizedEvent$jscomp$inline_467 = + eventName$jscomp$inline_465[0].toUpperCase() + + eventName$jscomp$inline_465.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_464, - "on" + capitalizedEvent$jscomp$inline_465 + domEventName$jscomp$inline_466, + "on" + capitalizedEvent$jscomp$inline_467 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -5250,7 +5250,17 @@ function insertStylesheetIntoRoot(root, resource) { } } var emptyContextObject = {}, - forkStack = [], + CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; +} +var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, @@ -5316,9 +5326,12 @@ var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1, hydrationErrors = null, - rootOrSingletonContext = !1; -function throwOnHydrationMismatch() { - throw Error(formatProdErrorMessage(418, "")); + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function prepareToHydrateHostInstance(fiber) { var instance = fiber.stateNode, @@ -5338,8 +5351,8 @@ function prepareToHydrateHostInstance(fiber) { break; case "video": case "audio": - for (fiber = 0; fiber < mediaEventTypes.length; fiber++) - listenToNonDelegatedEvent(mediaEventTypes[fiber], instance); + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); break; case "source": listenToNonDelegatedEvent("error", instance); @@ -5375,20 +5388,20 @@ function prepareToHydrateHostInstance(fiber) { initTextarea(instance, props.value, props.defaultValue), track(instance); } - fiber = props.children; - ("string" !== typeof fiber && - "number" !== typeof fiber && - "bigint" !== typeof fiber) || - instance.textContent === "" + fiber || + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, fiber) + checkForUnmatchedText(instance.textContent, type) ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$2), (instance = !0)) : (instance = !1); - !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(); + !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); } function popToNextHostParent(fiber) { for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) @@ -5419,7 +5432,7 @@ function popHydrationState(fiber) { JSCompiler_temp = !JSCompiler_temp; } JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); popToNextHostParent(fiber); if (13 === fiber.tag) { fiber = fiber.memoizedState; @@ -7443,42 +7456,44 @@ function mountActionState(action, initialStateProp) { var ssrFormState = workInProgressRoot.formState; if (null !== ssrFormState) { a: { + var JSCompiler_inline_result = currentlyRenderingFiber$1; if (isHydrating) { if (nextHydratableInstance) { b: { - var JSCompiler_inline_result = nextHydratableInstance; + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; for ( var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result.nodeType; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) { if (!inRootOrSingleton) { - JSCompiler_inline_result = null; + JSCompiler_inline_result$jscomp$0 = null; break b; } - JSCompiler_inline_result = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling ); - if (null === JSCompiler_inline_result) { - JSCompiler_inline_result = null; + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; break b; } } - inRootOrSingleton = JSCompiler_inline_result.data; - JSCompiler_inline_result = + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result + ? JSCompiler_inline_result$jscomp$0 : null; } - if (JSCompiler_inline_result) { + if (JSCompiler_inline_result$jscomp$0) { nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0.nextSibling ); - JSCompiler_inline_result = "F!" === JSCompiler_inline_result.data; + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; break a; } } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(JSCompiler_inline_result); } JSCompiler_inline_result = !1; } @@ -7502,28 +7517,28 @@ function mountActionState(action, initialStateProp) { ); JSCompiler_inline_result.dispatch = ssrFormState; JSCompiler_inline_result = mountStateImpl(!1); - var setPendingState = dispatchOptimisticSetState.bind( + inRootOrSingleton = dispatchOptimisticSetState.bind( null, currentlyRenderingFiber$1, !1, JSCompiler_inline_result.queue ); JSCompiler_inline_result = mountWorkInProgressHook(); - inRootOrSingleton = { + JSCompiler_inline_result$jscomp$0 = { state: initialStateProp, dispatch: null, action: action, pending: null }; - JSCompiler_inline_result.queue = inRootOrSingleton; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; ssrFormState = dispatchActionState.bind( null, currentlyRenderingFiber$1, + JSCompiler_inline_result$jscomp$0, inRootOrSingleton, - setPendingState, ssrFormState ); - inRootOrSingleton.dispatch = ssrFormState; + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; JSCompiler_inline_result.memoizedState = action; return [initialStateProp, ssrFormState, !1]; } @@ -8364,20 +8379,6 @@ function resolveDefaultProps(Component, baseProps) { } return baseProps; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; -} -function createCapturedValueFromError(value, stack) { - "string" === typeof stack && CapturedStacks.set(value, stack); - return { value: value, source: null, stack: stack }; -} function defaultOnUncaughtError(error) { reportGlobalError(error); } @@ -8463,11 +8464,15 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - returnFiber = value; enableLazyContextPropagation && - ((value = sourceFiber.alternate), - null !== value && - propagateParentContextChanges(value, sourceFiber, rootRenderLanes, !0)); + ((returnFiber = sourceFiber.alternate), + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + )); sourceFiber = suspenseHandlerStackCursor.current; if (null !== sourceFiber) { switch (sourceFiber.tag) { @@ -8481,107 +8486,122 @@ function throwException( (sourceFiber.flags &= -257), (sourceFiber.flags |= 65536), (sourceFiber.lanes = rootRenderLanes), - returnFiber === noopSuspenseyCommitThenable + value === noopSuspenseyCommitThenable ? (sourceFiber.flags |= 16384) - : ((value = sourceFiber.updateQueue), - null === value - ? (sourceFiber.updateQueue = new Set([returnFiber])) - : value.add(returnFiber), - attachPingListener(root, returnFiber, rootRenderLanes)), + : ((returnFiber = sourceFiber.updateQueue), + null === returnFiber + ? (sourceFiber.updateQueue = new Set([value])) + : returnFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: return ( (sourceFiber.flags |= 65536), - returnFiber === noopSuspenseyCommitThenable + value === noopSuspenseyCommitThenable ? (sourceFiber.flags |= 16384) - : ((value = sourceFiber.updateQueue), - null === value - ? ((value = { + : ((returnFiber = sourceFiber.updateQueue), + null === returnFiber + ? ((returnFiber = { transitions: null, markerInstances: null, - retryQueue: new Set([returnFiber]) + retryQueue: new Set([value]) }), - (sourceFiber.updateQueue = value)) - : ((sourceFiber = value.retryQueue), + (sourceFiber.updateQueue = returnFiber)) + : ((sourceFiber = returnFiber.retryQueue), null === sourceFiber - ? (value.retryQueue = new Set([returnFiber])) - : sourceFiber.add(returnFiber)), - attachPingListener(root, returnFiber, rootRenderLanes)), + ? (returnFiber.retryQueue = new Set([value])) + : sourceFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), !1 ); } throw Error(formatProdErrorMessage(435, sourceFiber.tag)); } - attachPingListener(root, returnFiber, rootRenderLanes); + attachPingListener(root, value, rootRenderLanes); renderDidSuspendDelayIfPossible(); return !1; } - if (isHydrating) { - var suspenseBoundary$155 = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary$155) - return ( - 0 === (suspenseBoundary$155.flags & 65536) && - (suspenseBoundary$155.flags |= 256), - (suspenseBoundary$155.flags |= 65536), - (suspenseBoundary$155.lanes = rootRenderLanes), - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)), - !1 - ); - } - suspenseBoundary$155 = value = createCapturedValueAtFiber(value, sourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [suspenseBoundary$155]) - : workInProgressRootConcurrentErrors.push(suspenseBoundary$155); - if (null === returnFiber) return !0; - do { - switch (returnFiber.tag) { - case 3: - return ( - (root = value), + if (isHydrating) + return ( + (returnFiber = suspenseHandlerStackCursor.current), + null !== returnFiber + ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), (returnFiber.flags |= 65536), + (returnFiber.lanes = rootRenderLanes), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (root = createRootErrorUpdate( - returnFiber.stateNode, - root, + (root.lanes |= rootRenderLanes), + (value = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + value, rootRenderLanes )), - enqueueCapturedUpdate(returnFiber, root), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); + wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [wrapperError]) + : workInProgressRootConcurrentErrors.push(wrapperError); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + value = createCapturedValueAtFiber(value, sourceFiber); + sourceFiber = returnFiber; + do { + switch (sourceFiber.tag) { + case 3: + return ( + (sourceFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (sourceFiber.lanes |= root), + (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)), + enqueueCapturedUpdate(sourceFiber, root), !1 ); case 1: - if (!(isHydrating && sourceFiber.mode & 1)) { - suspenseBoundary$155 = value; - var ctor = returnFiber.type, - instance = returnFiber.stateNode; - if ( - 0 === (returnFiber.flags & 128) && - ("function" === typeof ctor.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && + if ( + ((returnFiber = sourceFiber.type), + (wrapperError = sourceFiber.stateNode), + 0 === (sourceFiber.flags & 128) && + ("function" === typeof returnFiber.getDerivedStateFromError || + (null !== wrapperError && + "function" === typeof wrapperError.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - suspenseBoundary$155 - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } + !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) + ) + return ( + (sourceFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (sourceFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + sourceFiber, + value + ), + enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + !1 + ); } - returnFiber = returnFiber.return; - } while (null !== returnFiber); + sourceFiber = sourceFiber.return; + } while (null !== sourceFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -8691,10 +8711,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$159 = workInProgress.stateNode; + root$163 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$159.incompleteTransitions.has(transition)) { + if (!root$163.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -8702,11 +8722,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$159.incompleteTransitions.set(transition, markerInstance); + root$163.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$159.incompleteTransitions.forEach(function (markerInstance) { + root$163.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -9291,11 +9311,9 @@ function mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= 256; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -9374,7 +9392,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (JSCompiler_temp$jscomp$0 = !0)) : (JSCompiler_temp$jscomp$0 = !1); } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(); + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } nextInstance = workInProgress.memoizedState; if ( @@ -9460,15 +9478,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags &= -257), - (JSCompiler_temp = createCapturedValueFromError( - Error(formatProdErrorMessage(422)), - null - )), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ))) : null !== workInProgress.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress), @@ -9519,12 +9532,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps = Error(formatProdErrorMessage(419)); nextProps.stack = ""; nextProps.digest = JSCompiler_temp; - JSCompiler_temp = createCapturedValueFromError(nextProps, null); + queueHydrationError({ value: nextProps, source: null, stack: null }); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ); } else if ( (enableLazyContextPropagation && @@ -9592,8 +9604,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else "$?" === nextInstance.data @@ -9758,10 +9769,8 @@ function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { - null !== recoverableError && queueHydrationError(recoverableError); reconcileChildFibers(workInProgress, current.child, null, renderLanes); current = mountSuspensePrimaryChildren( workInProgress, @@ -10135,55 +10144,50 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.stateNode.containerInfo ); if (null === current) throw Error(formatProdErrorMessage(387)); - init = workInProgress.pendingProps; - var prevState = workInProgress.memoizedState; - props = prevState.element; + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + props = init.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, init, null, renderLanes); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - init = nextState.cache; - pushProvider(workInProgress, CacheContext, init); - init !== prevState.cache && + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextState.element; - if (prevState.isDehydrated) + nextProps = nextState.element; + if (init.isDehydrated) if ( - ((prevState = { - element: init, + ((init = { + element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = prevState), - (workInProgress.memoizedState = prevState), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), workInProgress.flags & 256) ) { - props = createCapturedValueAtFiber( - Error(formatProdErrorMessage(423)), - workInProgress - ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - init, - renderLanes, - props + nextProps, + renderLanes ); break a; - } else if (init !== props) { + } else if (nextProps !== props) { props = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); + queueHydrationError(props); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - init, - renderLanes, - props + nextProps, + renderLanes ); break a; } else @@ -10198,7 +10202,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - init, + nextProps, renderLanes ), workInProgress.child = renderLanes; @@ -10209,7 +10213,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (init === props) { + if (nextProps === props) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -10217,7 +10221,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, init, renderLanes); + reconcileChildren(current, workInProgress, nextProps, renderLanes); } workInProgress = workInProgress.child; } @@ -10288,14 +10292,14 @@ function beginWork(current, workInProgress, renderLanes) { (rootOrSingletonContext = !1), (init = !0)) : (init = !1); - init || throwOnHydrationMismatch(); + init || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); init = workInProgress.type; - prevState = workInProgress.pendingProps; + nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - props = prevState.children; - shouldSetTextContent(init, prevState) + props = nextProps.children; + shouldSetTextContent(init, nextProps) ? (props = null) : null !== nextState && shouldSetTextContent(init, nextState) && @@ -10336,7 +10340,7 @@ function beginWork(current, workInProgress, renderLanes) { (nextHydratableInstance = null), (current = !0)) : (current = !1); - current || throwOnHydrationMismatch(); + current || throwOnHydrationMismatch(workInProgress); } return null; case 13: @@ -10404,12 +10408,12 @@ function beginWork(current, workInProgress, renderLanes) { ? workInProgress.type : workInProgress.type._context; init = workInProgress.pendingProps; - prevState = workInProgress.memoizedProps; + nextProps = workInProgress.memoizedProps; nextState = init.value; pushProvider(workInProgress, props, nextState); - if (!enableLazyContextPropagation && null !== prevState) - if (objectIs(prevState.value, nextState)) { - if (prevState.children === init.children) { + if (!enableLazyContextPropagation && null !== nextProps) + if (objectIs(nextProps.value, nextState)) { + if (nextProps.children === init.children) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -10471,11 +10475,11 @@ function beginWork(current, workInProgress, renderLanes) { ? ((init = peekCacheFromPool()), null === init && ((init = workInProgressRoot), - (prevState = createCache()), - (init.pooledCache = prevState), - prevState.refCount++, - null !== prevState && (init.pooledCacheLanes |= renderLanes), - (init = prevState)), + (nextProps = createCache()), + (init.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), (workInProgress.memoizedState = { parent: props, cache: init }), initializeUpdateQueue(workInProgress), pushProvider(workInProgress, CacheContext, init)) @@ -10484,7 +10488,7 @@ function beginWork(current, workInProgress, renderLanes) { processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), (init = current.memoizedState), - (prevState = workInProgress.memoizedState), + (nextProps = workInProgress.memoizedState), init.parent !== props ? ((init = { parent: props, cache: props }), (workInProgress.memoizedState = init), @@ -10493,7 +10497,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.updateQueue.baseState = init), pushProvider(workInProgress, CacheContext, props)) - : ((props = prevState.cache), + : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== init.cache && propagateContextChange( @@ -11040,14 +11044,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$197 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$197 = lastTailNode), + for (var lastTailNode$199 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$199 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$197 + null === lastTailNode$199 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$197.sibling = null); + : (lastTailNode$199.sibling = null); } } function bubbleProperties(completedWork) { @@ -11057,19 +11061,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$198 = completedWork.child; null !== child$198; ) - (newChildLanes |= child$198.lanes | child$198.childLanes), - (subtreeFlags |= child$198.subtreeFlags & 31457280), - (subtreeFlags |= child$198.flags & 31457280), - (child$198.return = completedWork), - (child$198 = child$198.sibling); + for (var child$200 = completedWork.child; null !== child$200; ) + (newChildLanes |= child$200.lanes | child$200.childLanes), + (subtreeFlags |= child$200.subtreeFlags & 31457280), + (subtreeFlags |= child$200.flags & 31457280), + (child$200.return = completedWork), + (child$200 = child$200.sibling); else - for (child$198 = completedWork.child; null !== child$198; ) - (newChildLanes |= child$198.lanes | child$198.childLanes), - (subtreeFlags |= child$198.subtreeFlags), - (subtreeFlags |= child$198.flags), - (child$198.return = completedWork), - (child$198 = child$198.sibling); + for (child$200 = completedWork.child; null !== child$200; ) + (newChildLanes |= child$200.lanes | child$200.childLanes), + (subtreeFlags |= child$200.subtreeFlags), + (subtreeFlags |= child$200.flags), + (child$200.return = completedWork), + (child$200 = child$200.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -11317,7 +11321,7 @@ function completeWork(current, workInProgress, renderLanes) { (null !== newProps && !0 === newProps.suppressHydrationWarning) || checkForUnmatchedText(current.nodeValue, renderLanes) || !favorSafetyOverHydrationPerf || - throwOnHydrationMismatch(); + throwOnHydrationMismatch(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -11374,11 +11378,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (currentResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$210 = null; + var cache$212 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$210 = newProps.memoizedState.cachePool.pool); - cache$210 !== currentResource && (newProps.flags |= 2048); + (cache$212 = newProps.memoizedState.cachePool.pool); + cache$212 !== currentResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -11413,8 +11417,8 @@ function completeWork(current, workInProgress, renderLanes) { if (null === currentResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$210 = currentResource.rendering; - if (null === cache$210) + cache$212 = currentResource.rendering; + if (null === cache$212) if (newProps) cutOffTailIfNeeded(currentResource, !1); else { if ( @@ -11422,11 +11426,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$210 = findFirstSuspended(current); - if (null !== cache$210) { + cache$212 = findFirstSuspended(current); + if (null !== cache$212) { workInProgress.flags |= 128; cutOffTailIfNeeded(currentResource, !1); - current = cache$210.updateQueue; + current = cache$212.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -11451,7 +11455,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$210)), null !== current)) { + if (((current = findFirstSuspended(cache$212)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -11461,7 +11465,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !0), null === currentResource.tail && "hidden" === currentResource.tailMode && - !cache$210.alternate && + !cache$212.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -11474,13 +11478,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !1), (workInProgress.lanes = 4194304)); currentResource.isBackwards - ? ((cache$210.sibling = workInProgress.child), - (workInProgress.child = cache$210)) + ? ((cache$212.sibling = workInProgress.child), + (workInProgress.child = cache$212)) : ((current = currentResource.last), null !== current - ? (current.sibling = cache$210) - : (workInProgress.child = cache$210), - (currentResource.last = cache$210)); + ? (current.sibling = cache$212) + : (workInProgress.child = cache$212), + (currentResource.last = cache$212)); } if (null !== currentResource.tail) return ( @@ -11745,8 +11749,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$227) { - captureCommitPhaseError(current, nearestMountedAncestor, error$227); + } catch (error$229) { + captureCommitPhaseError(current, nearestMountedAncestor, error$229); } else ref.current = null; } @@ -12071,11 +12075,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$229) { + } catch (error$231) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$229 + error$231 ); } } @@ -12742,8 +12746,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$242) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$242); + } catch (error$244) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$244); } } break; @@ -12915,11 +12919,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$243) { + } catch (error$245) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$243 + error$245 ); } } @@ -12957,8 +12961,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$244) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$244); + } catch (error$246) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$246); } } if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { @@ -12969,8 +12973,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(flags, hoistableRoot, current, root), (flags[internalPropsKey] = root); - } catch (error$247) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$247); + } catch (error$249) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$249); } } break; @@ -12984,8 +12988,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$248) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$248); + } catch (error$250) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$250); } } break; @@ -12999,8 +13003,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$249) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$249); + } catch (error$251) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$251); } break; case 4: @@ -13030,8 +13034,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$251) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$251); + } catch (error$253) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$253); } current = finishedWork.updateQueue; null !== current && @@ -13106,11 +13110,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$232) { + } catch (error$234) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$232 + error$234 ); } } else if ( @@ -13185,21 +13189,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$233 = JSCompiler_inline_result.stateNode; + var parent$235 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$233, ""), + (setTextContent(parent$235, ""), (JSCompiler_inline_result.flags &= -33)); - var before$234 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$234, parent$233); + var before$236 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$236, parent$235); break; case 3: case 4: - var parent$235 = JSCompiler_inline_result.stateNode.containerInfo, - before$236 = getHostSibling(finishedWork); + var parent$237 = JSCompiler_inline_result.stateNode.containerInfo, + before$238 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$236, - parent$235 + before$238, + parent$237 ); break; default: @@ -13658,9 +13662,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$258 = finishedWork.stateNode; + var instance$260 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$258._visibility & 4 + ? instance$260._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -13672,7 +13676,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$258._visibility |= 4), + : ((instance$260._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -13685,7 +13689,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$258 + instance$260 ); break; case 24: @@ -14644,8 +14648,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$266) { - handleThrow(root, thrownValue$266); + } catch (thrownValue$268) { + handleThrow(root, thrownValue$268); } while (1); lanes && root.shellSuspendCounter++; @@ -14750,8 +14754,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$268) { - handleThrow(root, thrownValue$268); + } catch (thrownValue$270) { + handleThrow(root, thrownValue$270); } while (1); resetContextDependencies(); @@ -14974,12 +14978,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$272 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$274 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$272 && + shouldFireAfterActiveInstanceBlur$274 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -15049,7 +15053,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$273 = rootWithPendingPassiveEffects, + var root$275 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -15065,7 +15069,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$273, remainingLanes); + releaseRootPooledCache(root$275, remainingLanes); } } return !1; @@ -15666,12 +15670,12 @@ function updateContainer(element, container, parentComponent, callback) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$275 = fiber.stateNode; - if (root$275.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$275.pendingLanes); + var root$277 = fiber.stateNode; + if (root$277.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$277.pendingLanes); 0 !== lanes && - (upgradePendingLanesToSync(root$275, lanes), - ensureRootIsScheduled(root$275), + (upgradePendingLanesToSync(root$277, lanes), + ensureRootIsScheduled(root$277), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -16361,17 +16365,17 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1685 = { +var devToolsConfig$jscomp$inline_1687 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-6ff17b9a", + version: "19.0.0-www-modern-8cca1f01", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2108 = { - bundleType: devToolsConfig$jscomp$inline_1685.bundleType, - version: devToolsConfig$jscomp$inline_1685.version, - rendererPackageName: devToolsConfig$jscomp$inline_1685.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1685.rendererConfig, +var internals$jscomp$inline_2114 = { + bundleType: devToolsConfig$jscomp$inline_1687.bundleType, + version: devToolsConfig$jscomp$inline_1687.version, + rendererPackageName: devToolsConfig$jscomp$inline_1687.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1687.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16387,26 +16391,26 @@ var internals$jscomp$inline_2108 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1685.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1687.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-6ff17b9a" + reconcilerVersion: "19.0.0-www-modern-8cca1f01" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2109 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2115 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2109.isDisabled && - hook$jscomp$inline_2109.supportsFiber + !hook$jscomp$inline_2115.isDisabled && + hook$jscomp$inline_2115.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2109.inject( - internals$jscomp$inline_2108 + (rendererID = hook$jscomp$inline_2115.inject( + internals$jscomp$inline_2114 )), - (injectedHook = hook$jscomp$inline_2109); + (injectedHook = hook$jscomp$inline_2115); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -16697,4 +16701,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-6ff17b9a"; +exports.version = "19.0.0-www-modern-8cca1f01"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 2d376efa48..93ebac46cc 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -1749,7 +1749,17 @@ function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } var objectIs = "function" === typeof Object.is ? Object.is : is, - forkStack = [], + CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; +} +var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, @@ -1815,9 +1825,12 @@ var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1, hydrationErrors = null, - rootOrSingletonContext = !1; -function throwOnHydrationMismatch() { - throw Error(formatProdErrorMessage(418, "")); + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function prepareToHydrateHostInstance(fiber) { var instance = fiber.stateNode, @@ -1837,8 +1850,8 @@ function prepareToHydrateHostInstance(fiber) { break; case "video": case "audio": - for (fiber = 0; fiber < mediaEventTypes.length; fiber++) - listenToNonDelegatedEvent(mediaEventTypes[fiber], instance); + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); break; case "source": listenToNonDelegatedEvent("error", instance); @@ -1874,20 +1887,20 @@ function prepareToHydrateHostInstance(fiber) { initTextarea(instance, props.value, props.defaultValue, props.children), track(instance); } - fiber = props.children; - ("string" !== typeof fiber && - "number" !== typeof fiber && - "bigint" !== typeof fiber) || - instance.textContent === "" + fiber || + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, fiber) + checkForUnmatchedText(instance.textContent, type) ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$2), (instance = !0)) : (instance = !1); - !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(); + !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); } function popToNextHostParent(fiber) { for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) @@ -1918,7 +1931,7 @@ function popHydrationState(fiber) { JSCompiler_temp = !JSCompiler_temp; } JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); popToNextHostParent(fiber); if (13 === fiber.tag) { fiber = fiber.memoizedState; @@ -3964,42 +3977,44 @@ function mountActionState(action, initialStateProp) { var ssrFormState = workInProgressRoot.formState; if (null !== ssrFormState) { a: { + var JSCompiler_inline_result = currentlyRenderingFiber$1; if (isHydrating) { if (nextHydratableInstance) { b: { - var JSCompiler_inline_result = nextHydratableInstance; + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; for ( var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result.nodeType; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) { if (!inRootOrSingleton) { - JSCompiler_inline_result = null; + JSCompiler_inline_result$jscomp$0 = null; break b; } - JSCompiler_inline_result = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling ); - if (null === JSCompiler_inline_result) { - JSCompiler_inline_result = null; + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; break b; } } - inRootOrSingleton = JSCompiler_inline_result.data; - JSCompiler_inline_result = + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result + ? JSCompiler_inline_result$jscomp$0 : null; } - if (JSCompiler_inline_result) { + if (JSCompiler_inline_result$jscomp$0) { nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0.nextSibling ); - JSCompiler_inline_result = "F!" === JSCompiler_inline_result.data; + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; break a; } } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(JSCompiler_inline_result); } JSCompiler_inline_result = !1; } @@ -4023,28 +4038,28 @@ function mountActionState(action, initialStateProp) { ); JSCompiler_inline_result.dispatch = ssrFormState; JSCompiler_inline_result = mountStateImpl(!1); - var setPendingState = dispatchOptimisticSetState.bind( + inRootOrSingleton = dispatchOptimisticSetState.bind( null, currentlyRenderingFiber$1, !1, JSCompiler_inline_result.queue ); JSCompiler_inline_result = mountWorkInProgressHook(); - inRootOrSingleton = { + JSCompiler_inline_result$jscomp$0 = { state: initialStateProp, dispatch: null, action: action, pending: null }; - JSCompiler_inline_result.queue = inRootOrSingleton; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; ssrFormState = dispatchActionState.bind( null, currentlyRenderingFiber$1, + JSCompiler_inline_result$jscomp$0, inRootOrSingleton, - setPendingState, ssrFormState ); - inRootOrSingleton.dispatch = ssrFormState; + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; JSCompiler_inline_result.memoizedState = action; return [initialStateProp, ssrFormState, !1]; } @@ -5019,20 +5034,6 @@ function resolveDefaultProps(Component, baseProps) { } return baseProps; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; -} -function createCapturedValueFromError(value, stack) { - "string" === typeof stack && CapturedStacks.set(value, stack); - return { value: value, source: null, stack: stack }; -} var reportGlobalError = "function" === typeof reportError ? reportError @@ -5178,152 +5179,182 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - var wakeable = value; - enableLazyContextPropagation && - ((value = sourceFiber.alternate), - null !== value && - propagateParentContextChanges(value, sourceFiber, rootRenderLanes, !0)); - value = sourceFiber.tag; + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + } + currentSourceFiber = sourceFiber.tag; 0 !== (sourceFiber.mode & 1) || - (0 !== value && 11 !== value && 15 !== value) || - ((value = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = value.updateQueue), - (sourceFiber.memoizedState = value.memoizedState), - (sourceFiber.lanes = value.lanes)) + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) : ((sourceFiber.updateQueue = null), (sourceFiber.memoizedState = null))); - value = suspenseHandlerStackCursor.current; - if (null !== value) { - switch (value.tag) { + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: return ( sourceFiber.mode & 1 && (null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === value.alternate && + : null === currentSourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3)), - (value.flags &= -257), + (currentSourceFiber.flags &= -257), markSuspenseBoundaryShouldCapture( - value, + currentSourceFiber, returnFiber, sourceFiber, root, rootRenderLanes ), - wakeable === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((sourceFiber = value.updateQueue), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), null === sourceFiber - ? (value.updateQueue = new Set([wakeable])) - : sourceFiber.add(wakeable), - value.mode & 1 && - attachPingListener(root, wakeable, rootRenderLanes)), + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & 1 && + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: - if (value.mode & 1) + if (currentSourceFiber.mode & 1) return ( - (value.flags |= 65536), - wakeable === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((sourceFiber = value.updateQueue), + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), null === sourceFiber ? ((sourceFiber = { transitions: null, markerInstances: null, - retryQueue: new Set([wakeable]) + retryQueue: new Set([value]) }), - (value.updateQueue = sourceFiber)) + (currentSourceFiber.updateQueue = sourceFiber)) : ((returnFiber = sourceFiber.retryQueue), null === returnFiber - ? (sourceFiber.retryQueue = new Set([wakeable])) - : returnFiber.add(wakeable)), - attachPingListener(root, wakeable, rootRenderLanes)), + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), !1 ); } - throw Error(formatProdErrorMessage(435, value.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } if (1 === root.tag) return ( - attachPingListener(root, wakeable, rootRenderLanes), + attachPingListener(root, value, rootRenderLanes), renderDidSuspendDelayIfPossible(), !1 ); value = Error(formatProdErrorMessage(426)); } - if ( - isHydrating && - sourceFiber.mode & 1 && - ((wakeable = suspenseHandlerStackCursor.current), null !== wakeable) - ) + if (isHydrating && sourceFiber.mode & 1) return ( - 0 === (wakeable.flags & 65536) && (wakeable.flags |= 256), - markSuspenseBoundaryShouldCapture( - wakeable, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)), - !1 - ); - wakeable = value = createCapturedValueAtFiber(value, sourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wakeable]) - : workInProgressRootConcurrentErrors.push(wakeable); - if (null === returnFiber) return !0; - wakeable = returnFiber; - do { - switch (wakeable.tag) { - case 3: - return ( - (root = value), - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (root = createRootErrorUpdate( - wakeable.stateNode, + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, root, rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes )), - enqueueCapturedUpdate(wakeable, root), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 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 && + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.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 - ); - } + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); } - wakeable = wakeable.return; - } while (null !== wakeable); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -5433,10 +5464,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$76 = workInProgress.stateNode; + root$80 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$76.incompleteTransitions.has(transition)) { + if (!root$80.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5444,11 +5475,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$76.incompleteTransitions.set(transition, markerInstance); + root$80.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$76.incompleteTransitions.forEach(function (markerInstance) { + root$80.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -6050,11 +6081,9 @@ function mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= 256; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -6133,7 +6162,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (JSCompiler_temp$jscomp$0 = !0)) : (JSCompiler_temp$jscomp$0 = !1); } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(); + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } nextInstance = workInProgress.memoizedState; if ( @@ -6219,15 +6248,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags &= -257), - (JSCompiler_temp = createCapturedValueFromError( - Error(formatProdErrorMessage(422)), - null - )), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ))) : null !== workInProgress.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress), @@ -6281,12 +6305,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps = Error(formatProdErrorMessage(419)); nextProps.stack = ""; nextProps.digest = JSCompiler_temp; - JSCompiler_temp = createCapturedValueFromError(nextProps, null); + queueHydrationError({ value: nextProps, source: null, stack: null }); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ); } else if ( (enableLazyContextPropagation && @@ -6354,8 +6377,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else "$?" === nextInstance.data @@ -6546,10 +6568,8 @@ function mountSuspenseFallbackChildren( function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { - null !== recoverableError && queueHydrationError(recoverableError); reconcileChildFibers(workInProgress, current.child, null, renderLanes); current = mountSuspensePrimaryChildren( workInProgress, @@ -6955,55 +6975,50 @@ function beginWork(current, workInProgress, renderLanes) { a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); - elementType = workInProgress.pendingProps; - var prevState = workInProgress.memoizedState; - props = prevState.element; + var nextProps = workInProgress.pendingProps; + elementType = workInProgress.memoizedState; + props = elementType.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, elementType, null, renderLanes); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - elementType = nextState.cache; - pushProvider(workInProgress, CacheContext, elementType); - elementType !== prevState.cache && + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== elementType.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - elementType = nextState.element; - if (prevState.isDehydrated) + nextProps = nextState.element; + if (elementType.isDehydrated) if ( - ((prevState = { - element: elementType, + ((elementType = { + element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = prevState), - (workInProgress.memoizedState = prevState), + (workInProgress.updateQueue.baseState = elementType), + (workInProgress.memoizedState = elementType), workInProgress.flags & 256) ) { - props = createCapturedValueAtFiber( - Error(formatProdErrorMessage(423)), - workInProgress - ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - elementType, - renderLanes, - props + nextProps, + renderLanes ); break a; - } else if (elementType !== props) { + } else if (nextProps !== props) { props = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); + queueHydrationError(props); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - elementType, - renderLanes, - props + nextProps, + renderLanes ); break a; } else @@ -7018,7 +7033,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - elementType, + nextProps, renderLanes ), workInProgress.child = renderLanes; @@ -7029,7 +7044,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (elementType === props) { + if (nextProps === props) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -7037,7 +7052,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, nextProps, renderLanes); } workInProgress = workInProgress.child; } @@ -7108,14 +7123,14 @@ function beginWork(current, workInProgress, renderLanes) { (rootOrSingletonContext = !1), (elementType = !0)) : (elementType = !1); - elementType || throwOnHydrationMismatch(); + elementType || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); elementType = workInProgress.type; - prevState = workInProgress.pendingProps; + nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - props = prevState.children; - shouldSetTextContent(elementType, prevState) + props = nextProps.children; + shouldSetTextContent(elementType, nextProps) ? (props = null) : null !== nextState && shouldSetTextContent(elementType, nextState) && @@ -7156,7 +7171,7 @@ function beginWork(current, workInProgress, renderLanes) { (nextHydratableInstance = null), (current = !0)) : (current = !1); - current || throwOnHydrationMismatch(); + current || throwOnHydrationMismatch(workInProgress); } return null; case 13: @@ -7234,13 +7249,13 @@ function beginWork(current, workInProgress, renderLanes) { ? workInProgress.type : workInProgress.type._context; elementType = workInProgress.pendingProps; - prevState = workInProgress.memoizedProps; + nextProps = workInProgress.memoizedProps; nextState = elementType.value; pushProvider(workInProgress, props, nextState); - if (!enableLazyContextPropagation && null !== prevState) - if (objectIs(prevState.value, nextState)) { + if (!enableLazyContextPropagation && null !== nextProps) + if (objectIs(nextProps.value, nextState)) { if ( - prevState.children === elementType.children && + nextProps.children === elementType.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7360,12 +7375,12 @@ function beginWork(current, workInProgress, renderLanes) { ? ((elementType = peekCacheFromPool()), null === elementType && ((elementType = workInProgressRoot), - (prevState = createCache()), - (elementType.pooledCache = prevState), - prevState.refCount++, - null !== prevState && + (nextProps = createCache()), + (elementType.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (elementType.pooledCacheLanes |= renderLanes), - (elementType = prevState)), + (elementType = nextProps)), (workInProgress.memoizedState = { parent: props, cache: elementType @@ -7377,7 +7392,7 @@ function beginWork(current, workInProgress, renderLanes) { processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), (elementType = current.memoizedState), - (prevState = workInProgress.memoizedState), + (nextProps = workInProgress.memoizedState), elementType.parent !== props ? ((elementType = { parent: props, cache: props }), (workInProgress.memoizedState = elementType), @@ -7386,7 +7401,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.updateQueue.baseState = elementType), pushProvider(workInProgress, CacheContext, props)) - : ((props = prevState.cache), + : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== elementType.cache && propagateContextChange( @@ -7933,14 +7948,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$122 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$122 = lastTailNode), + for (var lastTailNode$124 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$124 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$122 + null === lastTailNode$124 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$122.sibling = null); + : (lastTailNode$124.sibling = null); } } function bubbleProperties(completedWork) { @@ -7952,53 +7967,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$124 = completedWork.selfBaseDuration, - child$125 = completedWork.child; - null !== child$125; + var treeBaseDuration$126 = completedWork.selfBaseDuration, + child$127 = completedWork.child; + null !== child$127; ) - (newChildLanes |= child$125.lanes | child$125.childLanes), - (subtreeFlags |= child$125.subtreeFlags & 31457280), - (subtreeFlags |= child$125.flags & 31457280), - (treeBaseDuration$124 += child$125.treeBaseDuration), - (child$125 = child$125.sibling); - completedWork.treeBaseDuration = treeBaseDuration$124; + (newChildLanes |= child$127.lanes | child$127.childLanes), + (subtreeFlags |= child$127.subtreeFlags & 31457280), + (subtreeFlags |= child$127.flags & 31457280), + (treeBaseDuration$126 += child$127.treeBaseDuration), + (child$127 = child$127.sibling); + completedWork.treeBaseDuration = treeBaseDuration$126; } else for ( - treeBaseDuration$124 = completedWork.child; - null !== treeBaseDuration$124; + treeBaseDuration$126 = completedWork.child; + null !== treeBaseDuration$126; ) (newChildLanes |= - treeBaseDuration$124.lanes | treeBaseDuration$124.childLanes), - (subtreeFlags |= treeBaseDuration$124.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$124.flags & 31457280), - (treeBaseDuration$124.return = completedWork), - (treeBaseDuration$124 = treeBaseDuration$124.sibling); + treeBaseDuration$126.lanes | treeBaseDuration$126.childLanes), + (subtreeFlags |= treeBaseDuration$126.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$126.flags & 31457280), + (treeBaseDuration$126.return = completedWork), + (treeBaseDuration$126 = treeBaseDuration$126.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$124 = completedWork.actualDuration; - child$125 = completedWork.selfBaseDuration; + treeBaseDuration$126 = completedWork.actualDuration; + child$127 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$124 += child.actualDuration), - (child$125 += child.treeBaseDuration), + (treeBaseDuration$126 += child.actualDuration), + (child$127 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$124; - completedWork.treeBaseDuration = child$125; + completedWork.actualDuration = treeBaseDuration$126; + completedWork.treeBaseDuration = child$127; } else for ( - treeBaseDuration$124 = completedWork.child; - null !== treeBaseDuration$124; + treeBaseDuration$126 = completedWork.child; + null !== treeBaseDuration$126; ) (newChildLanes |= - treeBaseDuration$124.lanes | treeBaseDuration$124.childLanes), - (subtreeFlags |= treeBaseDuration$124.subtreeFlags), - (subtreeFlags |= treeBaseDuration$124.flags), - (treeBaseDuration$124.return = completedWork), - (treeBaseDuration$124 = treeBaseDuration$124.sibling); + treeBaseDuration$126.lanes | treeBaseDuration$126.childLanes), + (subtreeFlags |= treeBaseDuration$126.subtreeFlags), + (subtreeFlags |= treeBaseDuration$126.flags), + (treeBaseDuration$126.return = completedWork), + (treeBaseDuration$126 = treeBaseDuration$126.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -8257,7 +8272,7 @@ function completeWork(current, workInProgress, renderLanes) { : !1; !current && favorSafetyOverHydrationPerf && - throwOnHydrationMismatch(); + throwOnHydrationMismatch(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -8332,11 +8347,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (currentResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$140 = null; + var cache$142 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$140 = newProps.memoizedState.cachePool.pool); - cache$140 !== currentResource && (newProps.flags |= 2048); + (cache$142 = newProps.memoizedState.cachePool.pool); + cache$142 !== currentResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8382,8 +8397,8 @@ function completeWork(current, workInProgress, renderLanes) { if (null === currentResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$140 = currentResource.rendering; - if (null === cache$140) + cache$142 = currentResource.rendering; + if (null === cache$142) if (newProps) cutOffTailIfNeeded(currentResource, !1); else { if ( @@ -8391,11 +8406,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$140 = findFirstSuspended(current); - if (null !== cache$140) { + cache$142 = findFirstSuspended(current); + if (null !== cache$142) { workInProgress.flags |= 128; cutOffTailIfNeeded(currentResource, !1); - current = cache$140.updateQueue; + current = cache$142.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8420,7 +8435,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$140)), null !== current)) { + if (((current = findFirstSuspended(cache$142)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8430,7 +8445,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !0), null === currentResource.tail && "hidden" === currentResource.tailMode && - !cache$140.alternate && + !cache$142.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8443,13 +8458,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !1), (workInProgress.lanes = 4194304)); currentResource.isBackwards - ? ((cache$140.sibling = workInProgress.child), - (workInProgress.child = cache$140)) + ? ((cache$142.sibling = workInProgress.child), + (workInProgress.child = cache$142)) : ((current = currentResource.last), null !== current - ? (current.sibling = cache$140) - : (workInProgress.child = cache$140), - (currentResource.last = cache$140)); + ? (current.sibling = cache$142) + : (workInProgress.child = cache$142), + (currentResource.last = cache$142)); } if (null !== currentResource.tail) return ( @@ -8761,8 +8776,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$158) { - captureCommitPhaseError(current, nearestMountedAncestor, error$158); + } catch (error$160) { + captureCommitPhaseError(current, nearestMountedAncestor, error$160); } else ref.current = null; } @@ -8799,7 +8814,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$218) { + } catch (e$220) { JSCompiler_temp = null; break a; } @@ -9057,11 +9072,11 @@ function commitPassiveEffectDurations(finishedRoot, finishedWork) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id; _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$160 = commitTime, + var commitTime$162 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$160); + _finishedWork$memoize(id, phase, finishedRoot, commitTime$162); finishedWork = finishedWork.return; a: for (; null !== finishedWork; ) { switch (finishedWork.tag) { @@ -9088,8 +9103,8 @@ function commitHookLayoutEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$162) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$162); + } catch (error$164) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$164); } } function commitClassCallbacks(finishedWork) { @@ -9188,11 +9203,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$163) { + } catch (error$165) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$165 ); } else { @@ -9210,11 +9225,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$164) { + } catch (error$166) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$164 + error$166 ); } recordLayoutEffectDuration(finishedWork); @@ -9225,11 +9240,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$165) { + } catch (error$167) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$165 + error$167 ); } } @@ -9935,22 +9950,22 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { startLayoutEffectTimer(), commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$180) { + } catch (error$182) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$180 + error$182 ); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$181) { + } catch (error$183) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$181 + error$183 ); } } @@ -10123,11 +10138,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$182) { + } catch (error$184) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$182 + error$184 ); } } @@ -10165,8 +10180,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$183) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$183); + } catch (error$185) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$185); } } if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { @@ -10177,8 +10192,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(flags, hoistableRoot, current, root), (flags[internalPropsKey] = root); - } catch (error$186) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$186); + } catch (error$188) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$188); } } break; @@ -10192,8 +10207,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$187) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$187); + } catch (error$189) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$189); } } break; @@ -10207,8 +10222,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$188) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$188); + } catch (error$190) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$190); } break; case 4: @@ -10238,8 +10253,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$190) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$190); + } catch (error$192) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$192); } current = finishedWork.updateQueue; null !== current && @@ -10317,11 +10332,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$170) { + } catch (error$172) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$170 + error$172 ); } } else if ( @@ -10396,21 +10411,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$171 = JSCompiler_inline_result.stateNode; + var parent$173 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$171, ""), + (setTextContent(parent$173, ""), (JSCompiler_inline_result.flags &= -33)); - var before$172 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$172, parent$171); + var before$174 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$174, parent$173); break; case 3: case 4: - var parent$173 = JSCompiler_inline_result.stateNode.containerInfo, - before$174 = getHostSibling(finishedWork); + var parent$175 = JSCompiler_inline_result.stateNode.containerInfo, + before$176 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$174, - parent$173 + before$176, + parent$175 ); break; default: @@ -10602,8 +10617,8 @@ function commitHookPassiveMountEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$193) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$193); + } catch (error$195) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$195); } } function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { @@ -10902,9 +10917,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$198 = finishedWork.stateNode; + var instance$200 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$198._visibility & 4 + ? instance$200._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10917,7 +10932,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$198._visibility |= 4), + : ((instance$200._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10925,7 +10940,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$198._visibility |= 4), + : ((instance$200._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10938,7 +10953,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$198 + instance$200 ); break; case 24: @@ -11983,8 +11998,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$206) { - handleThrow(root, thrownValue$206); + } catch (thrownValue$208) { + handleThrow(root, thrownValue$208); } while (1); lanes && root.shellSuspendCounter++; @@ -12100,8 +12115,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$208) { - handleThrow(root, thrownValue$208); + } catch (thrownValue$210) { + handleThrow(root, thrownValue$210); } while (1); resetContextDependencies(); @@ -12362,13 +12377,13 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$212 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$214 = commitBeforeMutationEffects( root, finishedWork ); commitTime = now(); commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$212 && + shouldFireAfterActiveInstanceBlur$214 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -12453,7 +12468,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$213 = rootWithPendingPassiveEffects, + var root$215 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -12469,7 +12484,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$213, remainingLanes); + releaseRootPooledCache(root$215, remainingLanes); } } return !1; @@ -13227,12 +13242,12 @@ function getPublicRootInstance(container) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$216 = fiber.stateNode; - if (root$216.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$216.pendingLanes); + var root$218 = fiber.stateNode; + if (root$218.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$218.pendingLanes); 0 !== lanes && - (upgradePendingLanesToSync(root$216, lanes), - ensureRootIsScheduled(root$216), + (upgradePendingLanesToSync(root$218, lanes), + ensureRootIsScheduled(root$218), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now$1() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -13798,19 +13813,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$367; + var JSCompiler_inline_result$jscomp$369; if (canUseDOM) { - var isSupported$jscomp$inline_1571 = "oninput" in document; - if (!isSupported$jscomp$inline_1571) { - var element$jscomp$inline_1572 = document.createElement("div"); - element$jscomp$inline_1572.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1571 = - "function" === typeof element$jscomp$inline_1572.oninput; + var isSupported$jscomp$inline_1573 = "oninput" in document; + if (!isSupported$jscomp$inline_1573) { + var element$jscomp$inline_1574 = document.createElement("div"); + element$jscomp$inline_1574.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1573 = + "function" === typeof element$jscomp$inline_1574.oninput; } - JSCompiler_inline_result$jscomp$367 = isSupported$jscomp$inline_1571; - } else JSCompiler_inline_result$jscomp$367 = !1; + JSCompiler_inline_result$jscomp$369 = isSupported$jscomp$inline_1573; + } else JSCompiler_inline_result$jscomp$369 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$367 && + JSCompiler_inline_result$jscomp$369 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14182,20 +14197,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1612 = 0; - i$jscomp$inline_1612 < simpleEventPluginEvents.length; - i$jscomp$inline_1612++ + var i$jscomp$inline_1614 = 0; + i$jscomp$inline_1614 < simpleEventPluginEvents.length; + i$jscomp$inline_1614++ ) { - var eventName$jscomp$inline_1613 = - simpleEventPluginEvents[i$jscomp$inline_1612], - domEventName$jscomp$inline_1614 = - eventName$jscomp$inline_1613.toLowerCase(), - capitalizedEvent$jscomp$inline_1615 = - eventName$jscomp$inline_1613[0].toUpperCase() + - eventName$jscomp$inline_1613.slice(1); + var eventName$jscomp$inline_1615 = + simpleEventPluginEvents[i$jscomp$inline_1614], + domEventName$jscomp$inline_1616 = + eventName$jscomp$inline_1615.toLowerCase(), + capitalizedEvent$jscomp$inline_1617 = + eventName$jscomp$inline_1615[0].toUpperCase() + + eventName$jscomp$inline_1615.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1614, - "on" + capitalizedEvent$jscomp$inline_1615 + domEventName$jscomp$inline_1616, + "on" + capitalizedEvent$jscomp$inline_1617 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15665,14 +15680,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$245 in nextProps) { - var propKey = nextProps[propKey$245]; - lastProp = lastProps[propKey$245]; + for (var propKey$247 in nextProps) { + var propKey = nextProps[propKey$247]; + lastProp = lastProps[propKey$247]; if ( - nextProps.hasOwnProperty(propKey$245) && + nextProps.hasOwnProperty(propKey$247) && (null != propKey || null != lastProp) ) - switch (propKey$245) { + switch (propKey$247) { case "type": type = propKey; break; @@ -15701,7 +15716,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$245, + propKey$247, propKey, nextProps, lastProp @@ -15720,7 +15735,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$245 = null; + propKey = value = defaultValue = propKey$247 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15751,7 +15766,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$245 = type; + propKey$247 = type; break; case "defaultValue": defaultValue = type; @@ -15772,15 +15787,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$245 - ? updateOptions(domElement, !!lastProps, propKey$245, !1) + null != propKey$247 + ? updateOptions(domElement, !!lastProps, propKey$247, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$245 = null; + propKey = propKey$247 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15804,7 +15819,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$245 = name; + propKey$247 = name; break; case "defaultValue": propKey = name; @@ -15818,17 +15833,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$245, propKey); + updateTextarea(domElement, propKey$247, propKey); return; case "option": - for (var propKey$261 in lastProps) + for (var propKey$263 in lastProps) if ( - ((propKey$245 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && - null != propKey$245 && - !nextProps.hasOwnProperty(propKey$261)) + ((propKey$247 = lastProps[propKey$263]), + lastProps.hasOwnProperty(propKey$263) && + null != propKey$247 && + !nextProps.hasOwnProperty(propKey$263)) ) - switch (propKey$261) { + switch (propKey$263) { case "selected": domElement.selected = !1; break; @@ -15836,33 +15851,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$261, + propKey$263, null, nextProps, - propKey$245 + propKey$247 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$245 = nextProps[lastDefaultValue]), + ((propKey$247 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$245 !== propKey && - (null != propKey$245 || null != propKey)) + propKey$247 !== propKey && + (null != propKey$247 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$245 && - "function" !== typeof propKey$245 && - "symbol" !== typeof propKey$245; + propKey$247 && + "function" !== typeof propKey$247 && + "symbol" !== typeof propKey$247; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$245, + propKey$247, nextProps, propKey ); @@ -15883,24 +15898,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$266 in lastProps) - (propKey$245 = lastProps[propKey$266]), - lastProps.hasOwnProperty(propKey$266) && - null != propKey$245 && - !nextProps.hasOwnProperty(propKey$266) && - setProp(domElement, tag, propKey$266, null, nextProps, propKey$245); + for (var propKey$268 in lastProps) + (propKey$247 = lastProps[propKey$268]), + lastProps.hasOwnProperty(propKey$268) && + null != propKey$247 && + !nextProps.hasOwnProperty(propKey$268) && + setProp(domElement, tag, propKey$268, null, nextProps, propKey$247); for (checked in nextProps) if ( - ((propKey$245 = nextProps[checked]), + ((propKey$247 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$245 !== propKey && - (null != propKey$245 || null != propKey)) + propKey$247 !== propKey && + (null != propKey$247 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$245) + if (null != propKey$247) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15908,7 +15923,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$245, + propKey$247, nextProps, propKey ); @@ -15916,49 +15931,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$271 in lastProps) - (propKey$245 = lastProps[propKey$271]), - lastProps.hasOwnProperty(propKey$271) && - void 0 !== propKey$245 && - !nextProps.hasOwnProperty(propKey$271) && + for (var propKey$273 in lastProps) + (propKey$247 = lastProps[propKey$273]), + lastProps.hasOwnProperty(propKey$273) && + void 0 !== propKey$247 && + !nextProps.hasOwnProperty(propKey$273) && setPropOnCustomElement( domElement, tag, - propKey$271, + propKey$273, void 0, nextProps, - propKey$245 + propKey$247 ); for (defaultChecked in nextProps) - (propKey$245 = nextProps[defaultChecked]), + (propKey$247 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$245 === propKey || - (void 0 === propKey$245 && void 0 === propKey) || + propKey$247 === propKey || + (void 0 === propKey$247 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$245, + propKey$247, nextProps, propKey ); return; } } - for (var propKey$276 in lastProps) - (propKey$245 = lastProps[propKey$276]), - lastProps.hasOwnProperty(propKey$276) && - null != propKey$245 && - !nextProps.hasOwnProperty(propKey$276) && - setProp(domElement, tag, propKey$276, null, nextProps, propKey$245); + for (var propKey$278 in lastProps) + (propKey$247 = lastProps[propKey$278]), + lastProps.hasOwnProperty(propKey$278) && + null != propKey$247 && + !nextProps.hasOwnProperty(propKey$278) && + setProp(domElement, tag, propKey$278, null, nextProps, propKey$247); for (lastProp in nextProps) - (propKey$245 = nextProps[lastProp]), + (propKey$247 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$245 === propKey || - (null == propKey$245 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$245, nextProps, propKey); + propKey$247 === propKey || + (null == propKey$247 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$247, nextProps, propKey); } function noop$1() {} var Internals = { @@ -16547,17 +16562,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$284 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$285 = styles$284.get(type); - resource$285 || + var styles$286 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$287 = styles$286.get(type); + resource$287 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$285 = { + (resource$287 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$284.set(type, resource$285), + styles$286.set(type, resource$287), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -16572,9 +16587,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$285.state + resource$287.state )); - return resource$285; + return resource$287; } return null; case "script": @@ -16657,37 +16672,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$289 = hoistableRoot.querySelector( + var instance$291 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$289) + if (instance$291) return ( (resource.state.loading |= 4), - (resource.instance = instance$289), - markNodeAsHoistable(instance$289), - instance$289 + (resource.instance = instance$291), + markNodeAsHoistable(instance$291), + instance$291 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$289 = ( + instance$291 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$289); - var linkInstance = instance$289; + markNodeAsHoistable(instance$291); + var linkInstance = instance$291; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$289, "link", instance); + setInitialProperties(instance$291, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$289, props.precedence, hoistableRoot); - return (resource.instance = instance$289); + insertStylesheet(instance$291, props.precedence, hoistableRoot); + return (resource.instance = instance$291); case "script": - instance$289 = getScriptKey(props.src); + instance$291 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$289) + getScriptSelectorFromKey(instance$291) )) ) return ( @@ -16696,7 +16711,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$289))) + if ((styleProps = preloadPropsMap.get(instance$291))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17723,10 +17738,10 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1788 = { +var devToolsConfig$jscomp$inline_1790 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-d8eb49f6", + version: "19.0.0-www-classic-1231a9cb", rendererPackageName: "react-dom" }; (function (internals) { @@ -17744,10 +17759,10 @@ var devToolsConfig$jscomp$inline_1788 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1788.bundleType, - version: devToolsConfig$jscomp$inline_1788.version, - rendererPackageName: devToolsConfig$jscomp$inline_1788.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1788.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1790.bundleType, + version: devToolsConfig$jscomp$inline_1790.version, + rendererPackageName: devToolsConfig$jscomp$inline_1790.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1790.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17763,14 +17778,14 @@ var devToolsConfig$jscomp$inline_1788 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1788.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1790.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-d8eb49f6" + reconcilerVersion: "19.0.0-www-classic-1231a9cb" }); var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); if ("function" !== typeof ReactFiberErrorDialogWWW.showErrorDialog) @@ -17805,11 +17820,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$310); + var instance = getPublicRootInstance(root$312); originalCallback.call(instance); }; } - var root$310 = createHydrationContainer( + var root$312 = createHydrationContainer( initialChildren, callback, container, @@ -17824,23 +17839,23 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$310; - container[internalContainerInstanceKey] = root$310.current; + container._reactRootContainer = root$312; + container[internalContainerInstanceKey] = root$312.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$310; + return root$312; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$311 = callback; + var originalCallback$313 = callback; callback = function () { - var instance = getPublicRootInstance(root$312); - originalCallback$311.call(instance); + var instance = getPublicRootInstance(root$314); + originalCallback$313.call(instance); }; } - var root$312 = createFiberRoot( + var root$314 = createFiberRoot( container, 0, !1, @@ -17855,15 +17870,15 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$312; - container[internalContainerInstanceKey] = root$312.current; + container._reactRootContainer = root$314; + container[internalContainerInstanceKey] = root$314.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$312, parentComponent, callback); + updateContainer(initialChildren, root$314, parentComponent, callback); }); - return root$312; + return root$314; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -18213,7 +18228,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-d8eb49f6"; +exports.version = "19.0.0-www-classic-1231a9cb"; "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 62c32634ff..889e9acadc 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -2205,19 +2205,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$313; + var JSCompiler_inline_result$jscomp$315; if (canUseDOM) { - var isSupported$jscomp$inline_442 = "oninput" in document; - if (!isSupported$jscomp$inline_442) { - var element$jscomp$inline_443 = document.createElement("div"); - element$jscomp$inline_443.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_442 = - "function" === typeof element$jscomp$inline_443.oninput; + var isSupported$jscomp$inline_444 = "oninput" in document; + if (!isSupported$jscomp$inline_444) { + var element$jscomp$inline_445 = document.createElement("div"); + element$jscomp$inline_445.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_444 = + "function" === typeof element$jscomp$inline_445.oninput; } - JSCompiler_inline_result$jscomp$313 = isSupported$jscomp$inline_442; - } else JSCompiler_inline_result$jscomp$313 = !1; + JSCompiler_inline_result$jscomp$315 = isSupported$jscomp$inline_444; + } else JSCompiler_inline_result$jscomp$315 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$313 && + JSCompiler_inline_result$jscomp$315 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2644,19 +2644,19 @@ for ( } console.error(error); }, - i$jscomp$inline_483 = 0; - i$jscomp$inline_483 < simpleEventPluginEvents.length; - i$jscomp$inline_483++ + i$jscomp$inline_485 = 0; + i$jscomp$inline_485 < simpleEventPluginEvents.length; + i$jscomp$inline_485++ ) { - var eventName$jscomp$inline_484 = - simpleEventPluginEvents[i$jscomp$inline_483], - domEventName$jscomp$inline_485 = eventName$jscomp$inline_484.toLowerCase(), - capitalizedEvent$jscomp$inline_486 = - eventName$jscomp$inline_484[0].toUpperCase() + - eventName$jscomp$inline_484.slice(1); + var eventName$jscomp$inline_486 = + simpleEventPluginEvents[i$jscomp$inline_485], + domEventName$jscomp$inline_487 = eventName$jscomp$inline_486.toLowerCase(), + capitalizedEvent$jscomp$inline_488 = + eventName$jscomp$inline_486[0].toUpperCase() + + eventName$jscomp$inline_486.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_485, - "on" + capitalizedEvent$jscomp$inline_486 + domEventName$jscomp$inline_487, + "on" + capitalizedEvent$jscomp$inline_488 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -5386,7 +5386,17 @@ function insertStylesheetIntoRoot(root, resource) { } } var emptyContextObject = {}, - forkStack = [], + CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; +} +var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, @@ -5452,9 +5462,12 @@ var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1, hydrationErrors = null, - rootOrSingletonContext = !1; -function throwOnHydrationMismatch() { - throw Error(formatProdErrorMessage(418, "")); + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function prepareToHydrateHostInstance(fiber) { var instance = fiber.stateNode, @@ -5474,8 +5487,8 @@ function prepareToHydrateHostInstance(fiber) { break; case "video": case "audio": - for (fiber = 0; fiber < mediaEventTypes.length; fiber++) - listenToNonDelegatedEvent(mediaEventTypes[fiber], instance); + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); break; case "source": listenToNonDelegatedEvent("error", instance); @@ -5511,20 +5524,20 @@ function prepareToHydrateHostInstance(fiber) { initTextarea(instance, props.value, props.defaultValue), track(instance); } - fiber = props.children; - ("string" !== typeof fiber && - "number" !== typeof fiber && - "bigint" !== typeof fiber) || - instance.textContent === "" + fiber || + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, fiber) + checkForUnmatchedText(instance.textContent, type) ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$2), (instance = !0)) : (instance = !1); - !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(); + !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); } function popToNextHostParent(fiber) { for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) @@ -5555,7 +5568,7 @@ function popHydrationState(fiber) { JSCompiler_temp = !JSCompiler_temp; } JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); popToNextHostParent(fiber); if (13 === fiber.tag) { fiber = fiber.memoizedState; @@ -7579,42 +7592,44 @@ function mountActionState(action, initialStateProp) { var ssrFormState = workInProgressRoot.formState; if (null !== ssrFormState) { a: { + var JSCompiler_inline_result = currentlyRenderingFiber$1; if (isHydrating) { if (nextHydratableInstance) { b: { - var JSCompiler_inline_result = nextHydratableInstance; + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; for ( var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result.nodeType; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) { if (!inRootOrSingleton) { - JSCompiler_inline_result = null; + JSCompiler_inline_result$jscomp$0 = null; break b; } - JSCompiler_inline_result = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling ); - if (null === JSCompiler_inline_result) { - JSCompiler_inline_result = null; + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; break b; } } - inRootOrSingleton = JSCompiler_inline_result.data; - JSCompiler_inline_result = + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result + ? JSCompiler_inline_result$jscomp$0 : null; } - if (JSCompiler_inline_result) { + if (JSCompiler_inline_result$jscomp$0) { nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0.nextSibling ); - JSCompiler_inline_result = "F!" === JSCompiler_inline_result.data; + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; break a; } } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(JSCompiler_inline_result); } JSCompiler_inline_result = !1; } @@ -7638,28 +7653,28 @@ function mountActionState(action, initialStateProp) { ); JSCompiler_inline_result.dispatch = ssrFormState; JSCompiler_inline_result = mountStateImpl(!1); - var setPendingState = dispatchOptimisticSetState.bind( + inRootOrSingleton = dispatchOptimisticSetState.bind( null, currentlyRenderingFiber$1, !1, JSCompiler_inline_result.queue ); JSCompiler_inline_result = mountWorkInProgressHook(); - inRootOrSingleton = { + JSCompiler_inline_result$jscomp$0 = { state: initialStateProp, dispatch: null, action: action, pending: null }; - JSCompiler_inline_result.queue = inRootOrSingleton; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; ssrFormState = dispatchActionState.bind( null, currentlyRenderingFiber$1, + JSCompiler_inline_result$jscomp$0, inRootOrSingleton, - setPendingState, ssrFormState ); - inRootOrSingleton.dispatch = ssrFormState; + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; JSCompiler_inline_result.memoizedState = action; return [initialStateProp, ssrFormState, !1]; } @@ -8572,20 +8587,6 @@ function resolveDefaultProps(Component, baseProps) { } return baseProps; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; -} -function createCapturedValueFromError(value, stack) { - "string" === typeof stack && CapturedStacks.set(value, stack); - return { value: value, source: null, stack: stack }; -} function defaultOnUncaughtError(error) { reportGlobalError(error); } @@ -8672,11 +8673,15 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - returnFiber = value; enableLazyContextPropagation && - ((value = sourceFiber.alternate), - null !== value && - propagateParentContextChanges(value, sourceFiber, rootRenderLanes, !0)); + ((returnFiber = sourceFiber.alternate), + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + )); sourceFiber = suspenseHandlerStackCursor.current; if (null !== sourceFiber) { switch (sourceFiber.tag) { @@ -8690,107 +8695,122 @@ function throwException( (sourceFiber.flags &= -257), (sourceFiber.flags |= 65536), (sourceFiber.lanes = rootRenderLanes), - returnFiber === noopSuspenseyCommitThenable + value === noopSuspenseyCommitThenable ? (sourceFiber.flags |= 16384) - : ((value = sourceFiber.updateQueue), - null === value - ? (sourceFiber.updateQueue = new Set([returnFiber])) - : value.add(returnFiber), - attachPingListener(root, returnFiber, rootRenderLanes)), + : ((returnFiber = sourceFiber.updateQueue), + null === returnFiber + ? (sourceFiber.updateQueue = new Set([value])) + : returnFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: return ( (sourceFiber.flags |= 65536), - returnFiber === noopSuspenseyCommitThenable + value === noopSuspenseyCommitThenable ? (sourceFiber.flags |= 16384) - : ((value = sourceFiber.updateQueue), - null === value - ? ((value = { + : ((returnFiber = sourceFiber.updateQueue), + null === returnFiber + ? ((returnFiber = { transitions: null, markerInstances: null, - retryQueue: new Set([returnFiber]) + retryQueue: new Set([value]) }), - (sourceFiber.updateQueue = value)) - : ((sourceFiber = value.retryQueue), + (sourceFiber.updateQueue = returnFiber)) + : ((sourceFiber = returnFiber.retryQueue), null === sourceFiber - ? (value.retryQueue = new Set([returnFiber])) - : sourceFiber.add(returnFiber)), - attachPingListener(root, returnFiber, rootRenderLanes)), + ? (returnFiber.retryQueue = new Set([value])) + : sourceFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), !1 ); } throw Error(formatProdErrorMessage(435, sourceFiber.tag)); } - attachPingListener(root, returnFiber, rootRenderLanes); + attachPingListener(root, value, rootRenderLanes); renderDidSuspendDelayIfPossible(); return !1; } - if (isHydrating) { - var suspenseBoundary$160 = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary$160) - return ( - 0 === (suspenseBoundary$160.flags & 65536) && - (suspenseBoundary$160.flags |= 256), - (suspenseBoundary$160.flags |= 65536), - (suspenseBoundary$160.lanes = rootRenderLanes), - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)), - !1 - ); - } - suspenseBoundary$160 = value = createCapturedValueAtFiber(value, sourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [suspenseBoundary$160]) - : workInProgressRootConcurrentErrors.push(suspenseBoundary$160); - if (null === returnFiber) return !0; - do { - switch (returnFiber.tag) { - case 3: - return ( - (root = value), + if (isHydrating) + return ( + (returnFiber = suspenseHandlerStackCursor.current), + null !== returnFiber + ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), (returnFiber.flags |= 65536), + (returnFiber.lanes = rootRenderLanes), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (root = createRootErrorUpdate( - returnFiber.stateNode, - root, + (root.lanes |= rootRenderLanes), + (value = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + value, rootRenderLanes )), - enqueueCapturedUpdate(returnFiber, root), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); + wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [wrapperError]) + : workInProgressRootConcurrentErrors.push(wrapperError); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + value = createCapturedValueAtFiber(value, sourceFiber); + sourceFiber = returnFiber; + do { + switch (sourceFiber.tag) { + case 3: + return ( + (sourceFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (sourceFiber.lanes |= root), + (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)), + enqueueCapturedUpdate(sourceFiber, root), !1 ); case 1: - if (!(isHydrating && sourceFiber.mode & 1)) { - suspenseBoundary$160 = value; - var ctor = returnFiber.type, - instance = returnFiber.stateNode; - if ( - 0 === (returnFiber.flags & 128) && - ("function" === typeof ctor.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && + if ( + ((returnFiber = sourceFiber.type), + (wrapperError = sourceFiber.stateNode), + 0 === (sourceFiber.flags & 128) && + ("function" === typeof returnFiber.getDerivedStateFromError || + (null !== wrapperError && + "function" === typeof wrapperError.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - suspenseBoundary$160 - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } + !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) + ) + return ( + (sourceFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (sourceFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + sourceFiber, + value + ), + enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + !1 + ); } - returnFiber = returnFiber.return; - } while (null !== returnFiber); + sourceFiber = sourceFiber.return; + } while (null !== sourceFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -8900,10 +8920,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$164 = workInProgress.stateNode; + root$168 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$164.incompleteTransitions.has(transition)) { + if (!root$168.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -8911,11 +8931,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$164.incompleteTransitions.set(transition, markerInstance); + root$168.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$164.incompleteTransitions.forEach(function (markerInstance) { + root$168.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -9508,11 +9528,9 @@ function mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= 256; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -9591,7 +9609,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (JSCompiler_temp$jscomp$0 = !0)) : (JSCompiler_temp$jscomp$0 = !1); } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(); + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } nextInstance = workInProgress.memoizedState; if ( @@ -9677,15 +9695,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags &= -257), - (JSCompiler_temp = createCapturedValueFromError( - Error(formatProdErrorMessage(422)), - null - )), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ))) : null !== workInProgress.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress), @@ -9736,12 +9749,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps = Error(formatProdErrorMessage(419)); nextProps.stack = ""; nextProps.digest = JSCompiler_temp; - JSCompiler_temp = createCapturedValueFromError(nextProps, null); + queueHydrationError({ value: nextProps, source: null, stack: null }); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ); } else if ( (enableLazyContextPropagation && @@ -9809,8 +9821,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else "$?" === nextInstance.data @@ -9975,10 +9986,8 @@ function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { - null !== recoverableError && queueHydrationError(recoverableError); reconcileChildFibers(workInProgress, current.child, null, renderLanes); current = mountSuspensePrimaryChildren( workInProgress, @@ -10360,55 +10369,50 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.stateNode.containerInfo ); if (null === current) throw Error(formatProdErrorMessage(387)); - init = workInProgress.pendingProps; - var prevState = workInProgress.memoizedState; - props = prevState.element; + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + props = init.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, init, null, renderLanes); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - init = nextState.cache; - pushProvider(workInProgress, CacheContext, init); - init !== prevState.cache && + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextState.element; - if (prevState.isDehydrated) + nextProps = nextState.element; + if (init.isDehydrated) if ( - ((prevState = { - element: init, + ((init = { + element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = prevState), - (workInProgress.memoizedState = prevState), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), workInProgress.flags & 256) ) { - props = createCapturedValueAtFiber( - Error(formatProdErrorMessage(423)), - workInProgress - ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - init, - renderLanes, - props + nextProps, + renderLanes ); break a; - } else if (init !== props) { + } else if (nextProps !== props) { props = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); + queueHydrationError(props); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - init, - renderLanes, - props + nextProps, + renderLanes ); break a; } else @@ -10423,7 +10427,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - init, + nextProps, renderLanes ), workInProgress.child = renderLanes; @@ -10434,7 +10438,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (init === props) { + if (nextProps === props) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -10442,7 +10446,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, init, renderLanes); + reconcileChildren(current, workInProgress, nextProps, renderLanes); } workInProgress = workInProgress.child; } @@ -10513,14 +10517,14 @@ function beginWork(current, workInProgress, renderLanes) { (rootOrSingletonContext = !1), (init = !0)) : (init = !1); - init || throwOnHydrationMismatch(); + init || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); init = workInProgress.type; - prevState = workInProgress.pendingProps; + nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - props = prevState.children; - shouldSetTextContent(init, prevState) + props = nextProps.children; + shouldSetTextContent(init, nextProps) ? (props = null) : null !== nextState && shouldSetTextContent(init, nextState) && @@ -10561,7 +10565,7 @@ function beginWork(current, workInProgress, renderLanes) { (nextHydratableInstance = null), (current = !0)) : (current = !1); - current || throwOnHydrationMismatch(); + current || throwOnHydrationMismatch(workInProgress); } return null; case 13: @@ -10633,12 +10637,12 @@ function beginWork(current, workInProgress, renderLanes) { ? workInProgress.type : workInProgress.type._context; init = workInProgress.pendingProps; - prevState = workInProgress.memoizedProps; + nextProps = workInProgress.memoizedProps; nextState = init.value; pushProvider(workInProgress, props, nextState); - if (!enableLazyContextPropagation && null !== prevState) - if (objectIs(prevState.value, nextState)) { - if (prevState.children === init.children) { + if (!enableLazyContextPropagation && null !== nextProps) + if (objectIs(nextProps.value, nextState)) { + if (nextProps.children === init.children) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -10702,11 +10706,11 @@ function beginWork(current, workInProgress, renderLanes) { ? ((init = peekCacheFromPool()), null === init && ((init = workInProgressRoot), - (prevState = createCache()), - (init.pooledCache = prevState), - prevState.refCount++, - null !== prevState && (init.pooledCacheLanes |= renderLanes), - (init = prevState)), + (nextProps = createCache()), + (init.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), (workInProgress.memoizedState = { parent: props, cache: init }), initializeUpdateQueue(workInProgress), pushProvider(workInProgress, CacheContext, init)) @@ -10715,7 +10719,7 @@ function beginWork(current, workInProgress, renderLanes) { processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), (init = current.memoizedState), - (prevState = workInProgress.memoizedState), + (nextProps = workInProgress.memoizedState), init.parent !== props ? ((init = { parent: props, cache: props }), (workInProgress.memoizedState = init), @@ -10724,7 +10728,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.updateQueue.baseState = init), pushProvider(workInProgress, CacheContext, props)) - : ((props = prevState.cache), + : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== init.cache && propagateContextChange( @@ -11271,14 +11275,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$203 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$203 = lastTailNode), + for (var lastTailNode$205 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$205 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$203 + null === lastTailNode$205 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$203.sibling = null); + : (lastTailNode$205.sibling = null); } } function bubbleProperties(completedWork) { @@ -11290,53 +11294,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$205 = completedWork.selfBaseDuration, - child$206 = completedWork.child; - null !== child$206; + var treeBaseDuration$207 = completedWork.selfBaseDuration, + child$208 = completedWork.child; + null !== child$208; ) - (newChildLanes |= child$206.lanes | child$206.childLanes), - (subtreeFlags |= child$206.subtreeFlags & 31457280), - (subtreeFlags |= child$206.flags & 31457280), - (treeBaseDuration$205 += child$206.treeBaseDuration), - (child$206 = child$206.sibling); - completedWork.treeBaseDuration = treeBaseDuration$205; + (newChildLanes |= child$208.lanes | child$208.childLanes), + (subtreeFlags |= child$208.subtreeFlags & 31457280), + (subtreeFlags |= child$208.flags & 31457280), + (treeBaseDuration$207 += child$208.treeBaseDuration), + (child$208 = child$208.sibling); + completedWork.treeBaseDuration = treeBaseDuration$207; } else for ( - treeBaseDuration$205 = completedWork.child; - null !== treeBaseDuration$205; + treeBaseDuration$207 = completedWork.child; + null !== treeBaseDuration$207; ) (newChildLanes |= - treeBaseDuration$205.lanes | treeBaseDuration$205.childLanes), - (subtreeFlags |= treeBaseDuration$205.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$205.flags & 31457280), - (treeBaseDuration$205.return = completedWork), - (treeBaseDuration$205 = treeBaseDuration$205.sibling); + treeBaseDuration$207.lanes | treeBaseDuration$207.childLanes), + (subtreeFlags |= treeBaseDuration$207.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$207.flags & 31457280), + (treeBaseDuration$207.return = completedWork), + (treeBaseDuration$207 = treeBaseDuration$207.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$205 = completedWork.actualDuration; - child$206 = completedWork.selfBaseDuration; + treeBaseDuration$207 = completedWork.actualDuration; + child$208 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$205 += child.actualDuration), - (child$206 += child.treeBaseDuration), + (treeBaseDuration$207 += child.actualDuration), + (child$208 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$205; - completedWork.treeBaseDuration = child$206; + completedWork.actualDuration = treeBaseDuration$207; + completedWork.treeBaseDuration = child$208; } else for ( - treeBaseDuration$205 = completedWork.child; - null !== treeBaseDuration$205; + treeBaseDuration$207 = completedWork.child; + null !== treeBaseDuration$207; ) (newChildLanes |= - treeBaseDuration$205.lanes | treeBaseDuration$205.childLanes), - (subtreeFlags |= treeBaseDuration$205.subtreeFlags), - (subtreeFlags |= treeBaseDuration$205.flags), - (treeBaseDuration$205.return = completedWork), - (treeBaseDuration$205 = treeBaseDuration$205.sibling); + treeBaseDuration$207.lanes | treeBaseDuration$207.childLanes), + (subtreeFlags |= treeBaseDuration$207.subtreeFlags), + (subtreeFlags |= treeBaseDuration$207.flags), + (treeBaseDuration$207.return = completedWork), + (treeBaseDuration$207 = treeBaseDuration$207.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -11584,7 +11588,7 @@ function completeWork(current, workInProgress, renderLanes) { (null !== newProps && !0 === newProps.suppressHydrationWarning) || checkForUnmatchedText(current.nodeValue, renderLanes) || !favorSafetyOverHydrationPerf || - throwOnHydrationMismatch(); + throwOnHydrationMismatch(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -11659,11 +11663,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (currentResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$221 = null; + var cache$223 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$221 = newProps.memoizedState.cachePool.pool); - cache$221 !== currentResource && (newProps.flags |= 2048); + (cache$223 = newProps.memoizedState.cachePool.pool); + cache$223 !== currentResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -11703,8 +11707,8 @@ function completeWork(current, workInProgress, renderLanes) { if (null === currentResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$221 = currentResource.rendering; - if (null === cache$221) + cache$223 = currentResource.rendering; + if (null === cache$223) if (newProps) cutOffTailIfNeeded(currentResource, !1); else { if ( @@ -11712,11 +11716,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$221 = findFirstSuspended(current); - if (null !== cache$221) { + cache$223 = findFirstSuspended(current); + if (null !== cache$223) { workInProgress.flags |= 128; cutOffTailIfNeeded(currentResource, !1); - current = cache$221.updateQueue; + current = cache$223.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -11741,7 +11745,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$221)), null !== current)) { + if (((current = findFirstSuspended(cache$223)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -11751,7 +11755,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !0), null === currentResource.tail && "hidden" === currentResource.tailMode && - !cache$221.alternate && + !cache$223.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -11764,13 +11768,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !1), (workInProgress.lanes = 4194304)); currentResource.isBackwards - ? ((cache$221.sibling = workInProgress.child), - (workInProgress.child = cache$221)) + ? ((cache$223.sibling = workInProgress.child), + (workInProgress.child = cache$223)) : ((current = currentResource.last), null !== current - ? (current.sibling = cache$221) - : (workInProgress.child = cache$221), - (currentResource.last = cache$221)); + ? (current.sibling = cache$223) + : (workInProgress.child = cache$223), + (currentResource.last = cache$223)); } if (null !== currentResource.tail) return ( @@ -12073,8 +12077,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$238) { - captureCommitPhaseError(current, nearestMountedAncestor, error$238); + } catch (error$240) { + captureCommitPhaseError(current, nearestMountedAncestor, error$240); } else ref.current = null; } @@ -12389,11 +12393,11 @@ function commitPassiveEffectDurations(finishedRoot, finishedWork) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id; _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$240 = commitTime, + var commitTime$242 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$240); + _finishedWork$memoize(id, phase, finishedRoot, commitTime$242); finishedWork = finishedWork.return; a: for (; null !== finishedWork; ) { switch (finishedWork.tag) { @@ -12420,8 +12424,8 @@ function commitHookLayoutEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$242) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$242); + } catch (error$244) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$244); } } function commitClassCallbacks(finishedWork) { @@ -12520,11 +12524,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$243) { + } catch (error$245) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$243 + error$245 ); } else { @@ -12542,11 +12546,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$244) { + } catch (error$246) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$244 + error$246 ); } recordLayoutEffectDuration(finishedWork); @@ -12557,11 +12561,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$245) { + } catch (error$247) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$245 + error$247 ); } } @@ -13256,22 +13260,22 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { startLayoutEffectTimer(), commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$260) { + } catch (error$262) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$260 + error$262 ); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$261) { + } catch (error$263) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$261 + error$263 ); } } @@ -13444,11 +13448,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$262) { + } catch (error$264) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$262 + error$264 ); } } @@ -13486,8 +13490,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$263) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$263); + } catch (error$265) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$265); } } if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { @@ -13498,8 +13502,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(flags, hoistableRoot, current, root), (flags[internalPropsKey] = root); - } catch (error$266) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$266); + } catch (error$268) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$268); } } break; @@ -13513,8 +13517,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$267) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$267); + } catch (error$269) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$269); } } break; @@ -13528,8 +13532,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$268) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$268); + } catch (error$270) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$270); } break; case 4: @@ -13559,8 +13563,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$270) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$270); + } catch (error$272) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$272); } current = finishedWork.updateQueue; null !== current && @@ -13635,11 +13639,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$250) { + } catch (error$252) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$250 + error$252 ); } } else if ( @@ -13714,21 +13718,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$251 = JSCompiler_inline_result.stateNode; + var parent$253 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$251, ""), + (setTextContent(parent$253, ""), (JSCompiler_inline_result.flags &= -33)); - var before$252 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$252, parent$251); + var before$254 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$254, parent$253); break; case 3: case 4: - var parent$253 = JSCompiler_inline_result.stateNode.containerInfo, - before$254 = getHostSibling(finishedWork); + var parent$255 = JSCompiler_inline_result.stateNode.containerInfo, + before$256 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$254, - parent$253 + before$256, + parent$255 ); break; default: @@ -13920,8 +13924,8 @@ function commitHookPassiveMountEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$273) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$273); + } catch (error$275) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$275); } } function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { @@ -14212,9 +14216,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$278 = finishedWork.stateNode; + var instance$280 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$278._visibility & 4 + ? instance$280._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14226,7 +14230,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$278._visibility |= 4), + : ((instance$280._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14239,7 +14243,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$278 + instance$280 ); break; case 24: @@ -15261,8 +15265,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$286) { - handleThrow(root, thrownValue$286); + } catch (thrownValue$288) { + handleThrow(root, thrownValue$288); } while (1); lanes && root.shellSuspendCounter++; @@ -15378,8 +15382,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$288) { - handleThrow(root, thrownValue$288); + } catch (thrownValue$290) { + handleThrow(root, thrownValue$290); } while (1); resetContextDependencies(); @@ -15636,13 +15640,13 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$292 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$294 = commitBeforeMutationEffects( root, finishedWork ); commitTime = now(); commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$292 && + shouldFireAfterActiveInstanceBlur$294 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -15725,7 +15729,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$293 = rootWithPendingPassiveEffects, + var root$295 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -15741,7 +15745,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$293, remainingLanes); + releaseRootPooledCache(root$295, remainingLanes); } } return !1; @@ -16397,12 +16401,12 @@ function updateContainer(element, container, parentComponent, callback) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$296 = fiber.stateNode; - if (root$296.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$296.pendingLanes); + var root$298 = fiber.stateNode; + if (root$298.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$298.pendingLanes); 0 !== lanes && - (upgradePendingLanesToSync(root$296, lanes), - ensureRootIsScheduled(root$296), + (upgradePendingLanesToSync(root$298, lanes), + ensureRootIsScheduled(root$298), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now$1() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -17092,10 +17096,10 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1771 = { +var devToolsConfig$jscomp$inline_1773 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-05c0edfb", + version: "19.0.0-www-modern-31fa3d44", rendererPackageName: "react-dom" }; (function (internals) { @@ -17113,10 +17117,10 @@ var devToolsConfig$jscomp$inline_1771 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1771.bundleType, - version: devToolsConfig$jscomp$inline_1771.version, - rendererPackageName: devToolsConfig$jscomp$inline_1771.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1771.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1773.bundleType, + version: devToolsConfig$jscomp$inline_1773.version, + rendererPackageName: devToolsConfig$jscomp$inline_1773.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1773.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17132,14 +17136,14 @@ var devToolsConfig$jscomp$inline_1771 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1771.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1773.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-05c0edfb" + reconcilerVersion: "19.0.0-www-modern-31fa3d44" }); var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); if ("function" !== typeof ReactFiberErrorDialogWWW.showErrorDialog) @@ -17429,7 +17433,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-05c0edfb"; +exports.version = "19.0.0-www-modern-31fa3d44"; "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 901ce49e2d..b74e43652a 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -8012,6 +8012,43 @@ if (__DEV__) { return currentState.isDehydrated; } + var CapturedStacks = new WeakMap(); + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + var stack; + + if (typeof value === "object" && value !== null) { + var capturedStack = CapturedStacks.get(value); + + if (typeof capturedStack === "string") { + stack = capturedStack; + } else { + stack = getStackByFiberInDevAndProd(source); + CapturedStacks.set(value, stack); + } + } else { + stack = getStackByFiberInDevAndProd(source); + } + + return { + value: value, + source: source, + stack: stack + }; + } + function createCapturedValueFromError(value, stack) { + if (typeof stack === "string") { + CapturedStacks.set(value, stack); + } + + return { + value: value, + source: null, + stack: stack + }; + } + // Intentionally not using it yet to derisk the initial implementation, because // the way we push/pop these values is a bit unusual. If there's a mistake, I'd // rather the ids be wrong than crash the whole reconciler. @@ -9080,6 +9117,11 @@ if (__DEV__) { return false; } + var HydrationMismatchException = new Error( + "Hydration Mismatch Exception: This is not a real error, and should not leak into " + + "userspace. If you're seeing this, it's likely a bug in React." + ); + function throwOnHydrationMismatch(fiber) { var diff = ""; @@ -9094,7 +9136,7 @@ if (__DEV__) { } } - throw new Error( + var error = new Error( "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n" + "\n" + "- A server/client branch `if (typeof window !== 'undefined')`.\n" + @@ -9108,6 +9150,8 @@ if (__DEV__) { "https://react.dev/link/hydration-mismatch" + diff ); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function claimHydratableSingleton(fiber) { @@ -9169,7 +9213,7 @@ if (__DEV__) { warnNonHydratedInstance(fiber, nextInstance); } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9193,7 +9237,7 @@ if (__DEV__) { warnNonHydratedInstance(fiber, nextInstance); } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9206,7 +9250,7 @@ if (__DEV__) { if (!nextInstance || !tryHydrateSuspense(fiber, nextInstance)) { warnNonHydratedInstance(fiber, nextInstance); - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9234,7 +9278,7 @@ if (__DEV__) { // rendering. We don't bother to check if we're in a concurrent root because // useActionState is a new API, so backwards compat is not an issue. - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); return false; } @@ -9249,7 +9293,7 @@ if (__DEV__) { ); if (!didHydrate && favorSafetyOverHydrationPerf) { - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9316,7 +9360,7 @@ if (__DEV__) { ); if (!didHydrate && favorSafetyOverHydrationPerf) { - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -9410,7 +9454,7 @@ if (__DEV__) { if (nextInstance) { warnIfUnhydratedTailNodes(fiber); - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -15368,7 +15412,9 @@ if (__DEV__) { // matches this hook instance. if (ssrFormState !== null) { - var isMatching = tryToClaimNextHydratableFormMarkerInstance(); + var isMatching = tryToClaimNextHydratableFormMarkerInstance( + currentlyRenderingFiber$1 + ); if (isMatching) { initialState = ssrFormState[0]; @@ -19284,43 +19330,6 @@ if (__DEV__) { return baseProps; } - var CapturedStacks = new WeakMap(); - function createCapturedValueAtFiber(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - var stack; - - if (typeof value === "object" && value !== null) { - var capturedStack = CapturedStacks.get(value); - - if (typeof capturedStack === "string") { - stack = capturedStack; - } else { - stack = getStackByFiberInDevAndProd(source); - CapturedStacks.set(value, stack); - } - } else { - stack = getStackByFiberInDevAndProd(source); - } - - return { - value: value, - source: source, - stack: stack - }; - } - function createCapturedValueFromError(value, stack) { - if (typeof stack === "string") { - CapturedStacks.set(value, stack); - } - - return { - value: value, - source: null, - stack: stack - }; - } - var reportGlobalError = typeof reportError === "function" // In modern browsers, reportError will dispatch an error event, ? // emulating an uncaught JavaScript error. @@ -19946,13 +19955,65 @@ if (__DEV__) { ); // Even though the user may not be affected by this error, we should // still log it so it can be fixed. - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)); + if (value !== HydrationMismatchException) { + var _wrapperError = new Error( + "There was an error while hydrating but React was able to recover by " + + "instead client rendering from the nearest Suspense boundary.", + { + cause: value + } + ); + + queueHydrationError( + createCapturedValueAtFiber(_wrapperError, sourceFiber) + ); + } + + return false; + } else { + if (value !== HydrationMismatchException) { + var _wrapperError2 = new Error( + "There was an error while hydrating but React was able to recover by " + + "instead client rendering the entire root.", + { + cause: value + } + ); + + queueHydrationError( + createCapturedValueAtFiber(_wrapperError2, sourceFiber) + ); + } + + var _workInProgress = root.current.alternate; // Schedule an update at the root to log the error but this shouldn't + // actually happen because we should recover. + + _workInProgress.flags |= ShouldCapture; + var lane = pickArbitraryLane(rootRenderLanes); + _workInProgress.lanes = mergeLanes(_workInProgress.lanes, lane); + var rootErrorInfo = createCapturedValueAtFiber(value, sourceFiber); + var update = createRootErrorUpdate( + _workInProgress.stateNode, + rootErrorInfo, // This should never actually get logged due to the recovery. + lane + ); + enqueueCapturedUpdate(_workInProgress, update); + renderDidError(); return false; } } - value = createCapturedValueAtFiber(value, sourceFiber); - renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + var wrapperError = new Error( + "There was an error during concurrent rendering but React was able to recover by " + + "instead synchronously rendering the entire root.", + { + cause: value + } + ); + queueConcurrentError( + createCapturedValueAtFiber(wrapperError, sourceFiber) + ); + renderDidError(); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. @@ -19962,34 +20023,30 @@ if (__DEV__) { return true; } + var errorInfo = createCapturedValueAtFiber(value, sourceFiber); var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { - var _errorInfo = value; workInProgress.flags |= ShouldCapture; - var lane = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); - var update = createRootErrorUpdate( + + var _lane = pickArbitraryLane(rootRenderLanes); + + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); + + var _update = createRootErrorUpdate( workInProgress.stateNode, - _errorInfo, - lane + errorInfo, + _lane ); - enqueueCapturedUpdate(workInProgress, update); + + enqueueCapturedUpdate(workInProgress, _update); return false; } case ClassComponent: - 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; + // Capture and retry var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -20002,19 +20059,19 @@ if (__DEV__) { ) { workInProgress.flags |= ShouldCapture; - var _lane = pickArbitraryLane(rootRenderLanes); + var _lane2 = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane2); // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(_lane); + var _update2 = createClassErrorUpdate(_lane2); initializeClassErrorUpdate( - _update, + _update2, root, workInProgress, errorInfo ); - enqueueCapturedUpdate(workInProgress, _update); + enqueueCapturedUpdate(workInProgress, _update2); return false; } @@ -21424,37 +21481,27 @@ if (__DEV__) { if (workInProgress.flags & ForceClientRender) { // Something errored during a previous attempt to hydrate the shell, so we - // forced a client render. - var recoverableError = createCapturedValueAtFiber( - new Error( - "There was an error while hydrating. Because the error happened outside " + - "of a Suspense boundary, the entire root will switch to " + - "client rendering." - ), - workInProgress - ); + // forced a client render. We should have a recoverable error already scheduled. return mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ); } else if (nextChildren !== prevChildren) { - var _recoverableError = createCapturedValueAtFiber( + var recoverableError = createCapturedValueAtFiber( new Error( "This root received an early update, before anything was able " + "hydrate. Switched the entire root to client rendering." ), workInProgress ); - + queueHydrationError(recoverableError); return mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - _recoverableError + renderLanes ); } else { // The outermost shell has not hydrated yet. Start hydrating. @@ -21502,12 +21549,10 @@ if (__DEV__) { current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { // Revert to client rendering. resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= ForceClientRender; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -22467,20 +22512,12 @@ if (__DEV__) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. - // - // The error is passed in as an argument to enforce that every caller provide - // a custom message, or explicitly opt out (currently the only path that opts - // out is legacy mode; every concurrent path provides an error). - if (recoverableError !== null) { - queueHydrationError(recoverableError); - } // This will add the old fiber to the deletion list - + // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; @@ -22598,9 +22635,7 @@ if (__DEV__) { message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; componentStack = _getSuspenseInstanceF.componentStack; - } - - var capturedValue = null; // TODO: Figure out a better signal than encoding a magic digest value. + } // TODO: Figure out a better signal than encoding a magic digest value. { var error; @@ -22618,17 +22653,17 @@ if (__DEV__) { error.stack = stack || ""; error.digest = digest; - capturedValue = createCapturedValueFromError( + var capturedValue = createCapturedValueFromError( error, componentStack === undefined ? null : componentStack ); + queueHydrationError(capturedValue); } return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - capturedValue + renderLanes ); } @@ -22703,8 +22738,7 @@ if (__DEV__) { return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else if (isSuspenseInstancePending(suspenseInstance)) { // This component is still pending more data from the server, so we can't hydrate its @@ -22749,22 +22783,13 @@ if (__DEV__) { // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. + // The error should've already been logged in throwException. pushPrimaryTreeSuspenseHandler(workInProgress); workInProgress.flags &= ~ForceClientRender; - - var _capturedValue = createCapturedValueFromError( - new Error( - "There was an error while hydrating this Suspense boundary. " + - "Switched to client rendering." - ), - null - ); - return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - _capturedValue + renderLanes ); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. @@ -33403,11 +33428,12 @@ if (__DEV__) { ); } } - function renderDidError(error) { + function renderDidError() { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } - + } + function queueConcurrentError(error) { if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { @@ -36811,7 +36837,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-1334cd9a"; + var ReactVersion = "19.0.0-www-classic-06a8599f"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 12893af4fb..563e79ddee 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -18398,6 +18398,43 @@ if (__DEV__) { return currentState.isDehydrated; } + var CapturedStacks = new WeakMap(); + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + var stack; + + if (typeof value === "object" && value !== null) { + var capturedStack = CapturedStacks.get(value); + + if (typeof capturedStack === "string") { + stack = capturedStack; + } else { + stack = getStackByFiberInDevAndProd(source); + CapturedStacks.set(value, stack); + } + } else { + stack = getStackByFiberInDevAndProd(source); + } + + return { + value: value, + source: source, + stack: stack + }; + } + function createCapturedValueFromError(value, stack) { + if (typeof stack === "string") { + CapturedStacks.set(value, stack); + } + + return { + value: value, + source: null, + stack: stack + }; + } + // Intentionally not using it yet to derisk the initial implementation, because // the way we push/pop these values is a bit unusual. If there's a mistake, I'd // rather the ids be wrong than crash the whole reconciler. @@ -19466,6 +19503,11 @@ if (__DEV__) { return false; } + var HydrationMismatchException = new Error( + "Hydration Mismatch Exception: This is not a real error, and should not leak into " + + "userspace. If you're seeing this, it's likely a bug in React." + ); + function throwOnHydrationMismatch(fiber) { var diff = ""; @@ -19480,7 +19522,7 @@ if (__DEV__) { } } - throw new Error( + var error = new Error( "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n" + "\n" + "- A server/client branch `if (typeof window !== 'undefined')`.\n" + @@ -19494,6 +19536,8 @@ if (__DEV__) { "https://react.dev/link/hydration-mismatch" + diff ); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function claimHydratableSingleton(fiber) { @@ -19555,7 +19599,7 @@ if (__DEV__) { warnNonHydratedInstance(fiber, nextInstance); } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19579,7 +19623,7 @@ if (__DEV__) { warnNonHydratedInstance(fiber, nextInstance); } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19592,7 +19636,7 @@ if (__DEV__) { if (!nextInstance || !tryHydrateSuspense(fiber, nextInstance)) { warnNonHydratedInstance(fiber, nextInstance); - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19620,7 +19664,7 @@ if (__DEV__) { // rendering. We don't bother to check if we're in a concurrent root because // useActionState is a new API, so backwards compat is not an issue. - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); return false; } @@ -19635,7 +19679,7 @@ if (__DEV__) { ); if (!didHydrate && favorSafetyOverHydrationPerf) { - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19702,7 +19746,7 @@ if (__DEV__) { ); if (!didHydrate && favorSafetyOverHydrationPerf) { - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -19796,7 +19840,7 @@ if (__DEV__) { if (nextInstance) { warnIfUnhydratedTailNodes(fiber); - throwOnHydrationMismatch(); + throwOnHydrationMismatch(fiber); } } @@ -25701,7 +25745,9 @@ if (__DEV__) { // matches this hook instance. if (ssrFormState !== null) { - var isMatching = tryToClaimNextHydratableFormMarkerInstance(); + var isMatching = tryToClaimNextHydratableFormMarkerInstance( + currentlyRenderingFiber$1 + ); if (isMatching) { initialState = ssrFormState[0]; @@ -29576,43 +29622,6 @@ if (__DEV__) { return baseProps; } - var CapturedStacks = new WeakMap(); - function createCapturedValueAtFiber(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - var stack; - - if (typeof value === "object" && value !== null) { - var capturedStack = CapturedStacks.get(value); - - if (typeof capturedStack === "string") { - stack = capturedStack; - } else { - stack = getStackByFiberInDevAndProd(source); - CapturedStacks.set(value, stack); - } - } else { - stack = getStackByFiberInDevAndProd(source); - } - - return { - value: value, - source: source, - stack: stack - }; - } - function createCapturedValueFromError(value, stack) { - if (typeof stack === "string") { - CapturedStacks.set(value, stack); - } - - return { - value: value, - source: null, - stack: stack - }; - } - var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // Side-channel since I'm not sure we want to make this part of the public API var componentName = null; @@ -30103,13 +30112,65 @@ if (__DEV__) { ); // Even though the user may not be affected by this error, we should // still log it so it can be fixed. - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)); + if (value !== HydrationMismatchException) { + var _wrapperError = new Error( + "There was an error while hydrating but React was able to recover by " + + "instead client rendering from the nearest Suspense boundary.", + { + cause: value + } + ); + + queueHydrationError( + createCapturedValueAtFiber(_wrapperError, sourceFiber) + ); + } + + return false; + } else { + if (value !== HydrationMismatchException) { + var _wrapperError2 = new Error( + "There was an error while hydrating but React was able to recover by " + + "instead client rendering the entire root.", + { + cause: value + } + ); + + queueHydrationError( + createCapturedValueAtFiber(_wrapperError2, sourceFiber) + ); + } + + var _workInProgress = root.current.alternate; // Schedule an update at the root to log the error but this shouldn't + // actually happen because we should recover. + + _workInProgress.flags |= ShouldCapture; + var lane = pickArbitraryLane(rootRenderLanes); + _workInProgress.lanes = mergeLanes(_workInProgress.lanes, lane); + var rootErrorInfo = createCapturedValueAtFiber(value, sourceFiber); + var update = createRootErrorUpdate( + _workInProgress.stateNode, + rootErrorInfo, // This should never actually get logged due to the recovery. + lane + ); + enqueueCapturedUpdate(_workInProgress, update); + renderDidError(); return false; } } - value = createCapturedValueAtFiber(value, sourceFiber); - renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + var wrapperError = new Error( + "There was an error during concurrent rendering but React was able to recover by " + + "instead synchronously rendering the entire root.", + { + cause: value + } + ); + queueConcurrentError( + createCapturedValueAtFiber(wrapperError, sourceFiber) + ); + renderDidError(); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. @@ -30119,34 +30180,30 @@ if (__DEV__) { return true; } + var errorInfo = createCapturedValueAtFiber(value, sourceFiber); var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { - var _errorInfo = value; workInProgress.flags |= ShouldCapture; - var lane = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); - var update = createRootErrorUpdate( + + var _lane = pickArbitraryLane(rootRenderLanes); + + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); + + var _update = createRootErrorUpdate( workInProgress.stateNode, - _errorInfo, - lane + errorInfo, + _lane ); - enqueueCapturedUpdate(workInProgress, update); + + enqueueCapturedUpdate(workInProgress, _update); return false; } case ClassComponent: - 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; + // Capture and retry var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -30159,19 +30216,19 @@ if (__DEV__) { ) { workInProgress.flags |= ShouldCapture; - var _lane = pickArbitraryLane(rootRenderLanes); + var _lane2 = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane2); // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(_lane); + var _update2 = createClassErrorUpdate(_lane2); initializeClassErrorUpdate( - _update, + _update2, root, workInProgress, errorInfo ); - enqueueCapturedUpdate(workInProgress, _update); + enqueueCapturedUpdate(workInProgress, _update2); return false; } @@ -31520,37 +31577,27 @@ if (__DEV__) { if (workInProgress.flags & ForceClientRender) { // Something errored during a previous attempt to hydrate the shell, so we - // forced a client render. - var recoverableError = createCapturedValueAtFiber( - new Error( - "There was an error while hydrating. Because the error happened outside " + - "of a Suspense boundary, the entire root will switch to " + - "client rendering." - ), - workInProgress - ); + // forced a client render. We should have a recoverable error already scheduled. return mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ); } else if (nextChildren !== prevChildren) { - var _recoverableError = createCapturedValueAtFiber( + var recoverableError = createCapturedValueAtFiber( new Error( "This root received an early update, before anything was able " + "hydrate. Switched the entire root to client rendering." ), workInProgress ); - + queueHydrationError(recoverableError); return mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - _recoverableError + renderLanes ); } else { // The outermost shell has not hydrated yet. Start hydrating. @@ -31598,12 +31645,10 @@ if (__DEV__) { current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { // Revert to client rendering. resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= ForceClientRender; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -32461,20 +32506,12 @@ if (__DEV__) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. - // - // The error is passed in as an argument to enforce that every caller provide - // a custom message, or explicitly opt out (currently the only path that opts - // out is legacy mode; every concurrent path provides an error). - if (recoverableError !== null) { - queueHydrationError(recoverableError); - } // This will add the old fiber to the deletion list - + // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; @@ -32592,9 +32629,7 @@ if (__DEV__) { message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; componentStack = _getSuspenseInstanceF.componentStack; - } - - var capturedValue = null; // TODO: Figure out a better signal than encoding a magic digest value. + } // TODO: Figure out a better signal than encoding a magic digest value. { var error; @@ -32612,17 +32647,17 @@ if (__DEV__) { error.stack = stack || ""; error.digest = digest; - capturedValue = createCapturedValueFromError( + var capturedValue = createCapturedValueFromError( error, componentStack === undefined ? null : componentStack ); + queueHydrationError(capturedValue); } return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - capturedValue + renderLanes ); } @@ -32697,8 +32732,7 @@ if (__DEV__) { return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else if (isSuspenseInstancePending(suspenseInstance)) { // This component is still pending more data from the server, so we can't hydrate its @@ -32743,22 +32777,13 @@ if (__DEV__) { // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. + // The error should've already been logged in throwException. pushPrimaryTreeSuspenseHandler(workInProgress); workInProgress.flags &= ~ForceClientRender; - - var _capturedValue = createCapturedValueFromError( - new Error( - "There was an error while hydrating this Suspense boundary. " + - "Switched to client rendering." - ), - null - ); - return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - _capturedValue + renderLanes ); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. @@ -43137,11 +43162,12 @@ if (__DEV__) { ); } } - function renderDidError(error) { + function renderDidError() { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } - + } + function queueConcurrentError(error) { if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { @@ -46437,7 +46463,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-8e64ec55"; + var ReactVersion = "19.0.0-www-modern-2bc2ffbc"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index f584fd2ca6..327b4f6239 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -1699,7 +1699,17 @@ function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } var objectIs = "function" === typeof Object.is ? Object.is : is, - forkStack = [], + CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; +} +var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, @@ -1765,9 +1775,12 @@ var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1, hydrationErrors = null, - rootOrSingletonContext = !1; -function throwOnHydrationMismatch() { - throw Error(formatProdErrorMessage(418, "")); + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function prepareToHydrateHostInstance(fiber) { var instance = fiber.stateNode, @@ -1787,8 +1800,8 @@ function prepareToHydrateHostInstance(fiber) { break; case "video": case "audio": - for (fiber = 0; fiber < mediaEventTypes.length; fiber++) - listenToNonDelegatedEvent(mediaEventTypes[fiber], instance); + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); break; case "source": listenToNonDelegatedEvent("error", instance); @@ -1824,20 +1837,20 @@ function prepareToHydrateHostInstance(fiber) { initTextarea(instance, props.value, props.defaultValue, props.children), track(instance); } - fiber = props.children; - ("string" !== typeof fiber && - "number" !== typeof fiber && - "bigint" !== typeof fiber) || - instance.textContent === "" + fiber || + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, fiber) + checkForUnmatchedText(instance.textContent, type) ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$2), (instance = !0)) : (instance = !1); - !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(); + !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); } function popToNextHostParent(fiber) { for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) @@ -1868,7 +1881,7 @@ function popHydrationState(fiber) { JSCompiler_temp = !JSCompiler_temp; } JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); popToNextHostParent(fiber); if (13 === fiber.tag) { fiber = fiber.memoizedState; @@ -3914,42 +3927,44 @@ function mountActionState(action, initialStateProp) { var ssrFormState = workInProgressRoot.formState; if (null !== ssrFormState) { a: { + var JSCompiler_inline_result = currentlyRenderingFiber$1; if (isHydrating) { if (nextHydratableInstance) { b: { - var JSCompiler_inline_result = nextHydratableInstance; + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; for ( var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result.nodeType; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) { if (!inRootOrSingleton) { - JSCompiler_inline_result = null; + JSCompiler_inline_result$jscomp$0 = null; break b; } - JSCompiler_inline_result = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling ); - if (null === JSCompiler_inline_result) { - JSCompiler_inline_result = null; + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; break b; } } - inRootOrSingleton = JSCompiler_inline_result.data; - JSCompiler_inline_result = + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result + ? JSCompiler_inline_result$jscomp$0 : null; } - if (JSCompiler_inline_result) { + if (JSCompiler_inline_result$jscomp$0) { nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0.nextSibling ); - JSCompiler_inline_result = "F!" === JSCompiler_inline_result.data; + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; break a; } } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(JSCompiler_inline_result); } JSCompiler_inline_result = !1; } @@ -3973,28 +3988,28 @@ function mountActionState(action, initialStateProp) { ); JSCompiler_inline_result.dispatch = ssrFormState; JSCompiler_inline_result = mountStateImpl(!1); - var setPendingState = dispatchOptimisticSetState.bind( + inRootOrSingleton = dispatchOptimisticSetState.bind( null, currentlyRenderingFiber$1, !1, JSCompiler_inline_result.queue ); JSCompiler_inline_result = mountWorkInProgressHook(); - inRootOrSingleton = { + JSCompiler_inline_result$jscomp$0 = { state: initialStateProp, dispatch: null, action: action, pending: null }; - JSCompiler_inline_result.queue = inRootOrSingleton; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; ssrFormState = dispatchActionState.bind( null, currentlyRenderingFiber$1, + JSCompiler_inline_result$jscomp$0, inRootOrSingleton, - setPendingState, ssrFormState ); - inRootOrSingleton.dispatch = ssrFormState; + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; JSCompiler_inline_result.memoizedState = action; return [initialStateProp, ssrFormState, !1]; } @@ -4897,20 +4912,6 @@ function resolveDefaultProps(Component, baseProps) { } return baseProps; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; -} -function createCapturedValueFromError(value, stack) { - "string" === typeof stack && CapturedStacks.set(value, stack); - return { value: value, source: null, stack: stack }; -} var reportGlobalError = "function" === typeof reportError ? reportError @@ -5055,152 +5056,182 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - var wakeable = value; - enableLazyContextPropagation && - ((value = sourceFiber.alternate), - null !== value && - propagateParentContextChanges(value, sourceFiber, rootRenderLanes, !0)); - value = sourceFiber.tag; + if (enableLazyContextPropagation) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + } + currentSourceFiber = sourceFiber.tag; 0 !== (sourceFiber.mode & 1) || - (0 !== value && 11 !== value && 15 !== value) || - ((value = sourceFiber.alternate) - ? ((sourceFiber.updateQueue = value.updateQueue), - (sourceFiber.memoizedState = value.memoizedState), - (sourceFiber.lanes = value.lanes)) + (0 !== currentSourceFiber && + 11 !== currentSourceFiber && + 15 !== currentSourceFiber) || + ((currentSourceFiber = sourceFiber.alternate) + ? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue), + (sourceFiber.memoizedState = currentSourceFiber.memoizedState), + (sourceFiber.lanes = currentSourceFiber.lanes)) : ((sourceFiber.updateQueue = null), (sourceFiber.memoizedState = null))); - value = suspenseHandlerStackCursor.current; - if (null !== value) { - switch (value.tag) { + currentSourceFiber = suspenseHandlerStackCursor.current; + if (null !== currentSourceFiber) { + switch (currentSourceFiber.tag) { case 13: return ( sourceFiber.mode & 1 && (null === shellBoundary ? renderDidSuspendDelayIfPossible() - : null === value.alternate && + : null === currentSourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3)), - (value.flags &= -257), + (currentSourceFiber.flags &= -257), markSuspenseBoundaryShouldCapture( - value, + currentSourceFiber, returnFiber, sourceFiber, root, rootRenderLanes ), - wakeable === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((sourceFiber = value.updateQueue), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), null === sourceFiber - ? (value.updateQueue = new Set([wakeable])) - : sourceFiber.add(wakeable), - value.mode & 1 && - attachPingListener(root, wakeable, rootRenderLanes)), + ? (currentSourceFiber.updateQueue = new Set([value])) + : sourceFiber.add(value), + currentSourceFiber.mode & 1 && + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: - if (value.mode & 1) + if (currentSourceFiber.mode & 1) return ( - (value.flags |= 65536), - wakeable === noopSuspenseyCommitThenable - ? (value.flags |= 16384) - : ((sourceFiber = value.updateQueue), + (currentSourceFiber.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (currentSourceFiber.flags |= 16384) + : ((sourceFiber = currentSourceFiber.updateQueue), null === sourceFiber ? ((sourceFiber = { transitions: null, markerInstances: null, - retryQueue: new Set([wakeable]) + retryQueue: new Set([value]) }), - (value.updateQueue = sourceFiber)) + (currentSourceFiber.updateQueue = sourceFiber)) : ((returnFiber = sourceFiber.retryQueue), null === returnFiber - ? (sourceFiber.retryQueue = new Set([wakeable])) - : returnFiber.add(wakeable)), - attachPingListener(root, wakeable, rootRenderLanes)), + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), !1 ); } - throw Error(formatProdErrorMessage(435, value.tag)); + throw Error(formatProdErrorMessage(435, currentSourceFiber.tag)); } if (1 === root.tag) return ( - attachPingListener(root, wakeable, rootRenderLanes), + attachPingListener(root, value, rootRenderLanes), renderDidSuspendDelayIfPossible(), !1 ); value = Error(formatProdErrorMessage(426)); } - if ( - isHydrating && - sourceFiber.mode & 1 && - ((wakeable = suspenseHandlerStackCursor.current), null !== wakeable) - ) + if (isHydrating && sourceFiber.mode & 1) return ( - 0 === (wakeable.flags & 65536) && (wakeable.flags |= 256), - markSuspenseBoundaryShouldCapture( - wakeable, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)), - !1 - ); - wakeable = value = createCapturedValueAtFiber(value, sourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [wakeable]) - : workInProgressRootConcurrentErrors.push(wakeable); - if (null === returnFiber) return !0; - wakeable = returnFiber; - do { - switch (wakeable.tag) { - case 3: - return ( - (root = value), - (wakeable.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (wakeable.lanes |= rootRenderLanes), - (root = createRootErrorUpdate( - wakeable.stateNode, + (currentSourceFiber = suspenseHandlerStackCursor.current), + null !== currentSourceFiber + ? (0 === (currentSourceFiber.flags & 65536) && + (currentSourceFiber.flags |= 256), + markSuspenseBoundaryShouldCapture( + currentSourceFiber, + returnFiber, + sourceFiber, root, rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes )), - enqueueCapturedUpdate(wakeable, root), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + currentSourceFiber = Error(formatProdErrorMessage(520), { cause: value }); + currentSourceFiber = createCapturedValueAtFiber( + currentSourceFiber, + sourceFiber + ); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [currentSourceFiber]) + : workInProgressRootConcurrentErrors.push(currentSourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), !1 ); case 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 && + if ( + ((value = returnFiber.type), + (currentSourceFiber = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== currentSourceFiber && + "function" === typeof currentSourceFiber.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 - ); - } + !legacyErrorBoundariesThatAlreadyFailed.has( + currentSourceFiber + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); } - wakeable = wakeable.return; - } while (null !== wakeable); + returnFiber = returnFiber.return; + } while (null !== returnFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -5310,10 +5341,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$71 = workInProgress.stateNode; + root$75 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$71.incompleteTransitions.has(transition)) { + if (!root$75.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5321,11 +5352,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$71.incompleteTransitions.set(transition, markerInstance); + root$75.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$71.incompleteTransitions.forEach(function (markerInstance) { + root$75.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5914,11 +5945,9 @@ function mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= 256; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -5997,7 +6026,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (JSCompiler_temp$jscomp$0 = !0)) : (JSCompiler_temp$jscomp$0 = !1); } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(); + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } nextInstance = workInProgress.memoizedState; if ( @@ -6083,15 +6112,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags &= -257), - (JSCompiler_temp = createCapturedValueFromError( - Error(formatProdErrorMessage(422)), - null - )), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ))) : null !== workInProgress.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress), @@ -6145,12 +6169,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps = Error(formatProdErrorMessage(419)); nextProps.stack = ""; nextProps.digest = JSCompiler_temp; - JSCompiler_temp = createCapturedValueFromError(nextProps, null); + queueHydrationError({ value: nextProps, source: null, stack: null }); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ); } else if ( (enableLazyContextPropagation && @@ -6218,8 +6241,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else "$?" === nextInstance.data @@ -6398,10 +6420,8 @@ function mountSuspenseFallbackChildren( function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { - null !== recoverableError && queueHydrationError(recoverableError); reconcileChildFibers(workInProgress, current.child, null, renderLanes); current = mountSuspensePrimaryChildren( workInProgress, @@ -6799,55 +6819,50 @@ function beginWork(current, workInProgress, renderLanes) { a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); - elementType = workInProgress.pendingProps; - var prevState = workInProgress.memoizedState; - props = prevState.element; + var nextProps = workInProgress.pendingProps; + elementType = workInProgress.memoizedState; + props = elementType.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, elementType, null, renderLanes); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - elementType = nextState.cache; - pushProvider(workInProgress, CacheContext, elementType); - elementType !== prevState.cache && + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== elementType.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - elementType = nextState.element; - if (prevState.isDehydrated) + nextProps = nextState.element; + if (elementType.isDehydrated) if ( - ((prevState = { - element: elementType, + ((elementType = { + element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = prevState), - (workInProgress.memoizedState = prevState), + (workInProgress.updateQueue.baseState = elementType), + (workInProgress.memoizedState = elementType), workInProgress.flags & 256) ) { - props = createCapturedValueAtFiber( - Error(formatProdErrorMessage(423)), - workInProgress - ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - elementType, - renderLanes, - props + nextProps, + renderLanes ); break a; - } else if (elementType !== props) { + } else if (nextProps !== props) { props = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); + queueHydrationError(props); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - elementType, - renderLanes, - props + nextProps, + renderLanes ); break a; } else @@ -6862,7 +6877,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - elementType, + nextProps, renderLanes ), workInProgress.child = renderLanes; @@ -6873,7 +6888,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (elementType === props) { + if (nextProps === props) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -6881,7 +6896,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, nextProps, renderLanes); } workInProgress = workInProgress.child; } @@ -6952,14 +6967,14 @@ function beginWork(current, workInProgress, renderLanes) { (rootOrSingletonContext = !1), (elementType = !0)) : (elementType = !1); - elementType || throwOnHydrationMismatch(); + elementType || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); elementType = workInProgress.type; - prevState = workInProgress.pendingProps; + nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - props = prevState.children; - shouldSetTextContent(elementType, prevState) + props = nextProps.children; + shouldSetTextContent(elementType, nextProps) ? (props = null) : null !== nextState && shouldSetTextContent(elementType, nextState) && @@ -7000,7 +7015,7 @@ function beginWork(current, workInProgress, renderLanes) { (nextHydratableInstance = null), (current = !0)) : (current = !1); - current || throwOnHydrationMismatch(); + current || throwOnHydrationMismatch(workInProgress); } return null; case 13: @@ -7074,13 +7089,13 @@ function beginWork(current, workInProgress, renderLanes) { ? workInProgress.type : workInProgress.type._context; elementType = workInProgress.pendingProps; - prevState = workInProgress.memoizedProps; + nextProps = workInProgress.memoizedProps; nextState = elementType.value; pushProvider(workInProgress, props, nextState); - if (!enableLazyContextPropagation && null !== prevState) - if (objectIs(prevState.value, nextState)) { + if (!enableLazyContextPropagation && null !== nextProps) + if (objectIs(nextProps.value, nextState)) { if ( - prevState.children === elementType.children && + nextProps.children === elementType.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7198,12 +7213,12 @@ function beginWork(current, workInProgress, renderLanes) { ? ((elementType = peekCacheFromPool()), null === elementType && ((elementType = workInProgressRoot), - (prevState = createCache()), - (elementType.pooledCache = prevState), - prevState.refCount++, - null !== prevState && + (nextProps = createCache()), + (elementType.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (elementType.pooledCacheLanes |= renderLanes), - (elementType = prevState)), + (elementType = nextProps)), (workInProgress.memoizedState = { parent: props, cache: elementType @@ -7215,7 +7230,7 @@ function beginWork(current, workInProgress, renderLanes) { processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), (elementType = current.memoizedState), - (prevState = workInProgress.memoizedState), + (nextProps = workInProgress.memoizedState), elementType.parent !== props ? ((elementType = { parent: props, cache: props }), (workInProgress.memoizedState = elementType), @@ -7224,7 +7239,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.updateQueue.baseState = elementType), pushProvider(workInProgress, CacheContext, props)) - : ((props = prevState.cache), + : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== elementType.cache && propagateContextChange( @@ -7771,14 +7786,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$116 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$116 = lastTailNode), + for (var lastTailNode$118 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$118 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$116 + null === lastTailNode$118 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$116.sibling = null); + : (lastTailNode$118.sibling = null); } } function bubbleProperties(completedWork) { @@ -7788,19 +7803,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$117 = completedWork.child; null !== child$117; ) - (newChildLanes |= child$117.lanes | child$117.childLanes), - (subtreeFlags |= child$117.subtreeFlags & 31457280), - (subtreeFlags |= child$117.flags & 31457280), - (child$117.return = completedWork), - (child$117 = child$117.sibling); + for (var child$119 = completedWork.child; null !== child$119; ) + (newChildLanes |= child$119.lanes | child$119.childLanes), + (subtreeFlags |= child$119.subtreeFlags & 31457280), + (subtreeFlags |= child$119.flags & 31457280), + (child$119.return = completedWork), + (child$119 = child$119.sibling); else - for (child$117 = completedWork.child; null !== child$117; ) - (newChildLanes |= child$117.lanes | child$117.childLanes), - (subtreeFlags |= child$117.subtreeFlags), - (subtreeFlags |= child$117.flags), - (child$117.return = completedWork), - (child$117 = child$117.sibling); + for (child$119 = completedWork.child; null !== child$119; ) + (newChildLanes |= child$119.lanes | child$119.childLanes), + (subtreeFlags |= child$119.subtreeFlags), + (subtreeFlags |= child$119.flags), + (child$119.return = completedWork), + (child$119 = child$119.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -8059,7 +8074,7 @@ function completeWork(current, workInProgress, renderLanes) { : !1; !current && favorSafetyOverHydrationPerf && - throwOnHydrationMismatch(); + throwOnHydrationMismatch(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -8116,11 +8131,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (currentResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$129 = null; + var cache$131 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$129 = newProps.memoizedState.cachePool.pool); - cache$129 !== currentResource && (newProps.flags |= 2048); + (cache$131 = newProps.memoizedState.cachePool.pool); + cache$131 !== currentResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8161,8 +8176,8 @@ function completeWork(current, workInProgress, renderLanes) { if (null === currentResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$129 = currentResource.rendering; - if (null === cache$129) + cache$131 = currentResource.rendering; + if (null === cache$131) if (newProps) cutOffTailIfNeeded(currentResource, !1); else { if ( @@ -8170,11 +8185,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$129 = findFirstSuspended(current); - if (null !== cache$129) { + cache$131 = findFirstSuspended(current); + if (null !== cache$131) { workInProgress.flags |= 128; cutOffTailIfNeeded(currentResource, !1); - current = cache$129.updateQueue; + current = cache$131.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8199,7 +8214,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$129)), null !== current)) { + if (((current = findFirstSuspended(cache$131)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8209,7 +8224,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !0), null === currentResource.tail && "hidden" === currentResource.tailMode && - !cache$129.alternate && + !cache$131.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8222,13 +8237,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !1), (workInProgress.lanes = 4194304)); currentResource.isBackwards - ? ((cache$129.sibling = workInProgress.child), - (workInProgress.child = cache$129)) + ? ((cache$131.sibling = workInProgress.child), + (workInProgress.child = cache$131)) : ((current = currentResource.last), null !== current - ? (current.sibling = cache$129) - : (workInProgress.child = cache$129), - (currentResource.last = cache$129)); + ? (current.sibling = cache$131) + : (workInProgress.child = cache$131), + (currentResource.last = cache$131)); } if (null !== currentResource.tail) return ( @@ -8502,8 +8517,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$147) { - captureCommitPhaseError(current, nearestMountedAncestor, error$147); + } catch (error$149) { + captureCommitPhaseError(current, nearestMountedAncestor, error$149); } else ref.current = null; } @@ -8540,7 +8555,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$198) { + } catch (e$200) { JSCompiler_temp = null; break a; } @@ -8808,11 +8823,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$149) { + } catch (error$151) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$149 + error$151 ); } } @@ -9490,8 +9505,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$162) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$162); + } catch (error$164) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$164); } } break; @@ -9663,11 +9678,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$163) { + } catch (error$165) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$165 ); } } @@ -9705,8 +9720,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$164) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$164); + } catch (error$166) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$166); } } if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { @@ -9717,8 +9732,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(flags, hoistableRoot, current, root), (flags[internalPropsKey] = root); - } catch (error$167) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$167); + } catch (error$169) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$169); } } break; @@ -9732,8 +9747,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$168) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$168); + } catch (error$170) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$170); } } break; @@ -9747,8 +9762,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$169) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$169); + } catch (error$171) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$171); } break; case 4: @@ -9778,8 +9793,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$171) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$171); + } catch (error$173) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$173); } current = finishedWork.updateQueue; null !== current && @@ -9857,11 +9872,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$152) { + } catch (error$154) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$152 + error$154 ); } } else if ( @@ -9936,21 +9951,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$153 = JSCompiler_inline_result.stateNode; + var parent$155 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$153, ""), + (setTextContent(parent$155, ""), (JSCompiler_inline_result.flags &= -33)); - var before$154 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$154, parent$153); + var before$156 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$156, parent$155); break; case 3: case 4: - var parent$155 = JSCompiler_inline_result.stateNode.containerInfo, - before$156 = getHostSibling(finishedWork); + var parent$157 = JSCompiler_inline_result.stateNode.containerInfo, + before$158 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$156, - parent$155 + before$158, + parent$157 ); break; default: @@ -10417,9 +10432,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$178 = finishedWork.stateNode; + var instance$180 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$178._visibility & 4 + ? instance$180._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10432,7 +10447,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$178._visibility |= 4), + : ((instance$180._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10440,7 +10455,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$178._visibility |= 4), + : ((instance$180._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10453,7 +10468,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$178 + instance$180 ); break; case 24: @@ -11621,8 +11636,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$187) { - handleThrow(root, thrownValue$187); + } catch (thrownValue$189) { + handleThrow(root, thrownValue$189); } while (1); lanes && root.shellSuspendCounter++; @@ -11727,8 +11742,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$189) { - handleThrow(root, thrownValue$189); + } catch (thrownValue$191) { + handleThrow(root, thrownValue$191); } while (1); resetContextDependencies(); @@ -11955,12 +11970,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$193 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$195 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$193 && + shouldFireAfterActiveInstanceBlur$195 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -12032,7 +12047,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$194 = rootWithPendingPassiveEffects, + var root$196 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -12048,7 +12063,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$194, remainingLanes); + releaseRootPooledCache(root$196, remainingLanes); } } return !1; @@ -12751,12 +12766,12 @@ function getPublicRootInstance(container) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$196 = fiber.stateNode; - if (root$196.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$196.pendingLanes); + var root$198 = fiber.stateNode; + if (root$198.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$198.pendingLanes); 0 !== lanes && - (upgradePendingLanesToSync(root$196, lanes), - ensureRootIsScheduled(root$196), + (upgradePendingLanesToSync(root$198, lanes), + ensureRootIsScheduled(root$198), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -13322,19 +13337,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$348; + var JSCompiler_inline_result$jscomp$350; if (canUseDOM) { - var isSupported$jscomp$inline_1512 = "oninput" in document; - if (!isSupported$jscomp$inline_1512) { - var element$jscomp$inline_1513 = document.createElement("div"); - element$jscomp$inline_1513.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1512 = - "function" === typeof element$jscomp$inline_1513.oninput; + var isSupported$jscomp$inline_1514 = "oninput" in document; + if (!isSupported$jscomp$inline_1514) { + var element$jscomp$inline_1515 = document.createElement("div"); + element$jscomp$inline_1515.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1514 = + "function" === typeof element$jscomp$inline_1515.oninput; } - JSCompiler_inline_result$jscomp$348 = isSupported$jscomp$inline_1512; - } else JSCompiler_inline_result$jscomp$348 = !1; + JSCompiler_inline_result$jscomp$350 = isSupported$jscomp$inline_1514; + } else JSCompiler_inline_result$jscomp$350 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$348 && + JSCompiler_inline_result$jscomp$350 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13706,20 +13721,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1553 = 0; - i$jscomp$inline_1553 < simpleEventPluginEvents.length; - i$jscomp$inline_1553++ + var i$jscomp$inline_1555 = 0; + i$jscomp$inline_1555 < simpleEventPluginEvents.length; + i$jscomp$inline_1555++ ) { - var eventName$jscomp$inline_1554 = - simpleEventPluginEvents[i$jscomp$inline_1553], - domEventName$jscomp$inline_1555 = - eventName$jscomp$inline_1554.toLowerCase(), - capitalizedEvent$jscomp$inline_1556 = - eventName$jscomp$inline_1554[0].toUpperCase() + - eventName$jscomp$inline_1554.slice(1); + var eventName$jscomp$inline_1556 = + simpleEventPluginEvents[i$jscomp$inline_1555], + domEventName$jscomp$inline_1557 = + eventName$jscomp$inline_1556.toLowerCase(), + capitalizedEvent$jscomp$inline_1558 = + eventName$jscomp$inline_1556[0].toUpperCase() + + eventName$jscomp$inline_1556.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1555, - "on" + capitalizedEvent$jscomp$inline_1556 + domEventName$jscomp$inline_1557, + "on" + capitalizedEvent$jscomp$inline_1558 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15189,14 +15204,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$225 in nextProps) { - var propKey = nextProps[propKey$225]; - lastProp = lastProps[propKey$225]; + for (var propKey$227 in nextProps) { + var propKey = nextProps[propKey$227]; + lastProp = lastProps[propKey$227]; if ( - nextProps.hasOwnProperty(propKey$225) && + nextProps.hasOwnProperty(propKey$227) && (null != propKey || null != lastProp) ) - switch (propKey$225) { + switch (propKey$227) { case "type": type = propKey; break; @@ -15225,7 +15240,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$225, + propKey$227, propKey, nextProps, lastProp @@ -15244,7 +15259,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$225 = null; + propKey = value = defaultValue = propKey$227 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15275,7 +15290,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$225 = type; + propKey$227 = type; break; case "defaultValue": defaultValue = type; @@ -15296,15 +15311,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$225 - ? updateOptions(domElement, !!lastProps, propKey$225, !1) + null != propKey$227 + ? updateOptions(domElement, !!lastProps, propKey$227, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$225 = null; + propKey = propKey$227 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15328,7 +15343,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$225 = name; + propKey$227 = name; break; case "defaultValue": propKey = name; @@ -15342,17 +15357,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$225, propKey); + updateTextarea(domElement, propKey$227, propKey); return; case "option": - for (var propKey$241 in lastProps) + for (var propKey$243 in lastProps) if ( - ((propKey$225 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && - null != propKey$225 && - !nextProps.hasOwnProperty(propKey$241)) + ((propKey$227 = lastProps[propKey$243]), + lastProps.hasOwnProperty(propKey$243) && + null != propKey$227 && + !nextProps.hasOwnProperty(propKey$243)) ) - switch (propKey$241) { + switch (propKey$243) { case "selected": domElement.selected = !1; break; @@ -15360,33 +15375,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$241, + propKey$243, null, nextProps, - propKey$225 + propKey$227 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$225 = nextProps[lastDefaultValue]), + ((propKey$227 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$225 !== propKey && - (null != propKey$225 || null != propKey)) + propKey$227 !== propKey && + (null != propKey$227 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$225 && - "function" !== typeof propKey$225 && - "symbol" !== typeof propKey$225; + propKey$227 && + "function" !== typeof propKey$227 && + "symbol" !== typeof propKey$227; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$225, + propKey$227, nextProps, propKey ); @@ -15407,24 +15422,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$246 in lastProps) - (propKey$225 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && - null != propKey$225 && - !nextProps.hasOwnProperty(propKey$246) && - setProp(domElement, tag, propKey$246, null, nextProps, propKey$225); + for (var propKey$248 in lastProps) + (propKey$227 = lastProps[propKey$248]), + lastProps.hasOwnProperty(propKey$248) && + null != propKey$227 && + !nextProps.hasOwnProperty(propKey$248) && + setProp(domElement, tag, propKey$248, null, nextProps, propKey$227); for (checked in nextProps) if ( - ((propKey$225 = nextProps[checked]), + ((propKey$227 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$225 !== propKey && - (null != propKey$225 || null != propKey)) + propKey$227 !== propKey && + (null != propKey$227 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$225) + if (null != propKey$227) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15432,7 +15447,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$225, + propKey$227, nextProps, propKey ); @@ -15440,49 +15455,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$251 in lastProps) - (propKey$225 = lastProps[propKey$251]), - lastProps.hasOwnProperty(propKey$251) && - void 0 !== propKey$225 && - !nextProps.hasOwnProperty(propKey$251) && + for (var propKey$253 in lastProps) + (propKey$227 = lastProps[propKey$253]), + lastProps.hasOwnProperty(propKey$253) && + void 0 !== propKey$227 && + !nextProps.hasOwnProperty(propKey$253) && setPropOnCustomElement( domElement, tag, - propKey$251, + propKey$253, void 0, nextProps, - propKey$225 + propKey$227 ); for (defaultChecked in nextProps) - (propKey$225 = nextProps[defaultChecked]), + (propKey$227 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$225 === propKey || - (void 0 === propKey$225 && void 0 === propKey) || + propKey$227 === propKey || + (void 0 === propKey$227 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$225, + propKey$227, nextProps, propKey ); return; } } - for (var propKey$256 in lastProps) - (propKey$225 = lastProps[propKey$256]), - lastProps.hasOwnProperty(propKey$256) && - null != propKey$225 && - !nextProps.hasOwnProperty(propKey$256) && - setProp(domElement, tag, propKey$256, null, nextProps, propKey$225); + for (var propKey$258 in lastProps) + (propKey$227 = lastProps[propKey$258]), + lastProps.hasOwnProperty(propKey$258) && + null != propKey$227 && + !nextProps.hasOwnProperty(propKey$258) && + setProp(domElement, tag, propKey$258, null, nextProps, propKey$227); for (lastProp in nextProps) - (propKey$225 = nextProps[lastProp]), + (propKey$227 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$225 === propKey || - (null == propKey$225 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$225, nextProps, propKey); + propKey$227 === propKey || + (null == propKey$227 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$227, nextProps, propKey); } function noop$1() {} var Internals = { @@ -16128,17 +16143,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$264 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$265 = styles$264.get(type); - resource$265 || + var styles$266 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$267 = styles$266.get(type); + resource$267 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$265 = { + (resource$267 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$264.set(type, resource$265), + styles$266.set(type, resource$267), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -16153,9 +16168,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$265.state + resource$267.state )); - return resource$265; + return resource$267; } return null; case "script": @@ -16238,37 +16253,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$269 = hoistableRoot.querySelector( + var instance$271 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$269) + if (instance$271) return ( (resource.state.loading |= 4), - (resource.instance = instance$269), - markNodeAsHoistable(instance$269), - instance$269 + (resource.instance = instance$271), + markNodeAsHoistable(instance$271), + instance$271 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$269 = ( + instance$271 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$269); - var linkInstance = instance$269; + markNodeAsHoistable(instance$271); + var linkInstance = instance$271; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$269, "link", instance); + setInitialProperties(instance$271, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$269, props.precedence, hoistableRoot); - return (resource.instance = instance$269); + insertStylesheet(instance$271, props.precedence, hoistableRoot); + return (resource.instance = instance$271); case "script": - instance$269 = getScriptKey(props.src); + instance$271 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$269) + getScriptSelectorFromKey(instance$271) )) ) return ( @@ -16277,7 +16292,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$269))) + if ((styleProps = preloadPropsMap.get(instance$271))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17304,17 +17319,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1729 = { +var devToolsConfig$jscomp$inline_1731 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-f161fb1d", + version: "19.0.0-www-classic-c508353a", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2136 = { - bundleType: devToolsConfig$jscomp$inline_1729.bundleType, - version: devToolsConfig$jscomp$inline_1729.version, - rendererPackageName: devToolsConfig$jscomp$inline_1729.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1729.rendererConfig, +var internals$jscomp$inline_2142 = { + bundleType: devToolsConfig$jscomp$inline_1731.bundleType, + version: devToolsConfig$jscomp$inline_1731.version, + rendererPackageName: devToolsConfig$jscomp$inline_1731.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1731.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17330,26 +17345,26 @@ var internals$jscomp$inline_2136 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1729.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1731.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-f161fb1d" + reconcilerVersion: "19.0.0-www-classic-c508353a" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2137 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2143 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2137.isDisabled && - hook$jscomp$inline_2137.supportsFiber + !hook$jscomp$inline_2143.isDisabled && + hook$jscomp$inline_2143.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2137.inject( - internals$jscomp$inline_2136 + (rendererID = hook$jscomp$inline_2143.inject( + internals$jscomp$inline_2142 )), - (injectedHook = hook$jscomp$inline_2137); + (injectedHook = hook$jscomp$inline_2143); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -17385,11 +17400,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$290); + var instance = getPublicRootInstance(root$292); originalCallback.call(instance); }; } - var root$290 = createHydrationContainer( + var root$292 = createHydrationContainer( initialChildren, callback, container, @@ -17404,23 +17419,23 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$290; - container[internalContainerInstanceKey] = root$290.current; + container._reactRootContainer = root$292; + container[internalContainerInstanceKey] = root$292.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$290; + return root$292; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$291 = callback; + var originalCallback$293 = callback; callback = function () { - var instance = getPublicRootInstance(root$292); - originalCallback$291.call(instance); + var instance = getPublicRootInstance(root$294); + originalCallback$293.call(instance); }; } - var root$292 = createFiberRoot( + var root$294 = createFiberRoot( container, 0, !1, @@ -17435,15 +17450,15 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$292; - container[internalContainerInstanceKey] = root$292.current; + container._reactRootContainer = root$294; + container[internalContainerInstanceKey] = root$294.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$292, parentComponent, callback); + updateContainer(initialChildren, root$294, parentComponent, callback); }); - return root$292; + return root$294; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -17936,4 +17951,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-f161fb1d"; +exports.version = "19.0.0-www-classic-c508353a"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 3e25757304..1d4f166727 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -2214,19 +2214,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$293; + var JSCompiler_inline_result$jscomp$295; if (canUseDOM) { - var isSupported$jscomp$inline_424 = "oninput" in document; - if (!isSupported$jscomp$inline_424) { - var element$jscomp$inline_425 = document.createElement("div"); - element$jscomp$inline_425.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_424 = - "function" === typeof element$jscomp$inline_425.oninput; + var isSupported$jscomp$inline_426 = "oninput" in document; + if (!isSupported$jscomp$inline_426) { + var element$jscomp$inline_427 = document.createElement("div"); + element$jscomp$inline_427.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_426 = + "function" === typeof element$jscomp$inline_427.oninput; } - JSCompiler_inline_result$jscomp$293 = isSupported$jscomp$inline_424; - } else JSCompiler_inline_result$jscomp$293 = !1; + JSCompiler_inline_result$jscomp$295 = isSupported$jscomp$inline_426; + } else JSCompiler_inline_result$jscomp$295 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$293 && + JSCompiler_inline_result$jscomp$295 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2653,19 +2653,19 @@ for ( } console.error(error); }, - i$jscomp$inline_465 = 0; - i$jscomp$inline_465 < simpleEventPluginEvents.length; - i$jscomp$inline_465++ + i$jscomp$inline_467 = 0; + i$jscomp$inline_467 < simpleEventPluginEvents.length; + i$jscomp$inline_467++ ) { - var eventName$jscomp$inline_466 = - simpleEventPluginEvents[i$jscomp$inline_465], - domEventName$jscomp$inline_467 = eventName$jscomp$inline_466.toLowerCase(), - capitalizedEvent$jscomp$inline_468 = - eventName$jscomp$inline_466[0].toUpperCase() + - eventName$jscomp$inline_466.slice(1); + var eventName$jscomp$inline_468 = + simpleEventPluginEvents[i$jscomp$inline_467], + domEventName$jscomp$inline_469 = eventName$jscomp$inline_468.toLowerCase(), + capitalizedEvent$jscomp$inline_470 = + eventName$jscomp$inline_468[0].toUpperCase() + + eventName$jscomp$inline_468.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_467, - "on" + capitalizedEvent$jscomp$inline_468 + domEventName$jscomp$inline_469, + "on" + capitalizedEvent$jscomp$inline_470 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -5452,7 +5452,17 @@ function insertStylesheetIntoRoot(root, resource) { } } var emptyContextObject = {}, - forkStack = [], + CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; +} +var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, @@ -5518,9 +5528,12 @@ var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1, hydrationErrors = null, - rootOrSingletonContext = !1; -function throwOnHydrationMismatch() { - throw Error(formatProdErrorMessage(418, "")); + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } function prepareToHydrateHostInstance(fiber) { var instance = fiber.stateNode, @@ -5540,8 +5553,8 @@ function prepareToHydrateHostInstance(fiber) { break; case "video": case "audio": - for (fiber = 0; fiber < mediaEventTypes.length; fiber++) - listenToNonDelegatedEvent(mediaEventTypes[fiber], instance); + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); break; case "source": listenToNonDelegatedEvent("error", instance); @@ -5577,20 +5590,20 @@ function prepareToHydrateHostInstance(fiber) { initTextarea(instance, props.value, props.defaultValue), track(instance); } - fiber = props.children; - ("string" !== typeof fiber && - "number" !== typeof fiber && - "bigint" !== typeof fiber) || - instance.textContent === "" + fiber || + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, fiber) + checkForUnmatchedText(instance.textContent, type) ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$2), (instance = !0)) : (instance = !1); - !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(); + !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); } function popToNextHostParent(fiber) { for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) @@ -5621,7 +5634,7 @@ function popHydrationState(fiber) { JSCompiler_temp = !JSCompiler_temp; } JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); popToNextHostParent(fiber); if (13 === fiber.tag) { fiber = fiber.memoizedState; @@ -7645,42 +7658,44 @@ function mountActionState(action, initialStateProp) { var ssrFormState = workInProgressRoot.formState; if (null !== ssrFormState) { a: { + var JSCompiler_inline_result = currentlyRenderingFiber$1; if (isHydrating) { if (nextHydratableInstance) { b: { - var JSCompiler_inline_result = nextHydratableInstance; + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; for ( var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result.nodeType; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) { if (!inRootOrSingleton) { - JSCompiler_inline_result = null; + JSCompiler_inline_result$jscomp$0 = null; break b; } - JSCompiler_inline_result = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling ); - if (null === JSCompiler_inline_result) { - JSCompiler_inline_result = null; + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; break b; } } - inRootOrSingleton = JSCompiler_inline_result.data; - JSCompiler_inline_result = + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result + ? JSCompiler_inline_result$jscomp$0 : null; } - if (JSCompiler_inline_result) { + if (JSCompiler_inline_result$jscomp$0) { nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result.nextSibling + JSCompiler_inline_result$jscomp$0.nextSibling ); - JSCompiler_inline_result = "F!" === JSCompiler_inline_result.data; + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; break a; } } - throwOnHydrationMismatch(); + throwOnHydrationMismatch(JSCompiler_inline_result); } JSCompiler_inline_result = !1; } @@ -7704,28 +7719,28 @@ function mountActionState(action, initialStateProp) { ); JSCompiler_inline_result.dispatch = ssrFormState; JSCompiler_inline_result = mountStateImpl(!1); - var setPendingState = dispatchOptimisticSetState.bind( + inRootOrSingleton = dispatchOptimisticSetState.bind( null, currentlyRenderingFiber$1, !1, JSCompiler_inline_result.queue ); JSCompiler_inline_result = mountWorkInProgressHook(); - inRootOrSingleton = { + JSCompiler_inline_result$jscomp$0 = { state: initialStateProp, dispatch: null, action: action, pending: null }; - JSCompiler_inline_result.queue = inRootOrSingleton; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; ssrFormState = dispatchActionState.bind( null, currentlyRenderingFiber$1, + JSCompiler_inline_result$jscomp$0, inRootOrSingleton, - setPendingState, ssrFormState ); - inRootOrSingleton.dispatch = ssrFormState; + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; JSCompiler_inline_result.memoizedState = action; return [initialStateProp, ssrFormState, !1]; } @@ -8566,20 +8581,6 @@ function resolveDefaultProps(Component, baseProps) { } return baseProps; } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; -} -function createCapturedValueFromError(value, stack) { - "string" === typeof stack && CapturedStacks.set(value, stack); - return { value: value, source: null, stack: stack }; -} function defaultOnUncaughtError(error) { reportGlobalError(error); } @@ -8665,11 +8666,15 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - returnFiber = value; enableLazyContextPropagation && - ((value = sourceFiber.alternate), - null !== value && - propagateParentContextChanges(value, sourceFiber, rootRenderLanes, !0)); + ((returnFiber = sourceFiber.alternate), + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + )); sourceFiber = suspenseHandlerStackCursor.current; if (null !== sourceFiber) { switch (sourceFiber.tag) { @@ -8683,107 +8688,122 @@ function throwException( (sourceFiber.flags &= -257), (sourceFiber.flags |= 65536), (sourceFiber.lanes = rootRenderLanes), - returnFiber === noopSuspenseyCommitThenable + value === noopSuspenseyCommitThenable ? (sourceFiber.flags |= 16384) - : ((value = sourceFiber.updateQueue), - null === value - ? (sourceFiber.updateQueue = new Set([returnFiber])) - : value.add(returnFiber), - attachPingListener(root, returnFiber, rootRenderLanes)), + : ((returnFiber = sourceFiber.updateQueue), + null === returnFiber + ? (sourceFiber.updateQueue = new Set([value])) + : returnFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), !1 ); case 22: return ( (sourceFiber.flags |= 65536), - returnFiber === noopSuspenseyCommitThenable + value === noopSuspenseyCommitThenable ? (sourceFiber.flags |= 16384) - : ((value = sourceFiber.updateQueue), - null === value - ? ((value = { + : ((returnFiber = sourceFiber.updateQueue), + null === returnFiber + ? ((returnFiber = { transitions: null, markerInstances: null, - retryQueue: new Set([returnFiber]) + retryQueue: new Set([value]) }), - (sourceFiber.updateQueue = value)) - : ((sourceFiber = value.retryQueue), + (sourceFiber.updateQueue = returnFiber)) + : ((sourceFiber = returnFiber.retryQueue), null === sourceFiber - ? (value.retryQueue = new Set([returnFiber])) - : sourceFiber.add(returnFiber)), - attachPingListener(root, returnFiber, rootRenderLanes)), + ? (returnFiber.retryQueue = new Set([value])) + : sourceFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), !1 ); } throw Error(formatProdErrorMessage(435, sourceFiber.tag)); } - attachPingListener(root, returnFiber, rootRenderLanes); + attachPingListener(root, value, rootRenderLanes); renderDidSuspendDelayIfPossible(); return !1; } - if (isHydrating) { - var suspenseBoundary$155 = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary$155) - return ( - 0 === (suspenseBoundary$155.flags & 65536) && - (suspenseBoundary$155.flags |= 256), - (suspenseBoundary$155.flags |= 65536), - (suspenseBoundary$155.lanes = rootRenderLanes), - queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)), - !1 - ); - } - suspenseBoundary$155 = value = createCapturedValueAtFiber(value, sourceFiber); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - null === workInProgressRootConcurrentErrors - ? (workInProgressRootConcurrentErrors = [suspenseBoundary$155]) - : workInProgressRootConcurrentErrors.push(suspenseBoundary$155); - if (null === returnFiber) return !0; - do { - switch (returnFiber.tag) { - case 3: - return ( - (root = value), + if (isHydrating) + return ( + (returnFiber = suspenseHandlerStackCursor.current), + null !== returnFiber + ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), (returnFiber.flags |= 65536), + (returnFiber.lanes = rootRenderLanes), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (root = createRootErrorUpdate( - returnFiber.stateNode, - root, + (root.lanes |= rootRenderLanes), + (value = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + value, rootRenderLanes )), - enqueueCapturedUpdate(returnFiber, root), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); + wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); + null === workInProgressRootConcurrentErrors + ? (workInProgressRootConcurrentErrors = [wrapperError]) + : workInProgressRootConcurrentErrors.push(wrapperError); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + value = createCapturedValueAtFiber(value, sourceFiber); + sourceFiber = returnFiber; + do { + switch (sourceFiber.tag) { + case 3: + return ( + (sourceFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (sourceFiber.lanes |= root), + (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)), + enqueueCapturedUpdate(sourceFiber, root), !1 ); case 1: - if (!(isHydrating && sourceFiber.mode & 1)) { - suspenseBoundary$155 = value; - var ctor = returnFiber.type, - instance = returnFiber.stateNode; - if ( - 0 === (returnFiber.flags & 128) && - ("function" === typeof ctor.getDerivedStateFromError || - (null !== instance && - "function" === typeof instance.componentDidCatch && + if ( + ((returnFiber = sourceFiber.type), + (wrapperError = sourceFiber.stateNode), + 0 === (sourceFiber.flags & 128) && + ("function" === typeof returnFiber.getDerivedStateFromError || + (null !== wrapperError && + "function" === typeof wrapperError.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - suspenseBoundary$155 - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } + !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) + ) + return ( + (sourceFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (sourceFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + sourceFiber, + value + ), + enqueueCapturedUpdate(sourceFiber, rootRenderLanes), + !1 + ); } - returnFiber = returnFiber.return; - } while (null !== returnFiber); + sourceFiber = sourceFiber.return; + } while (null !== sourceFiber); return !1; } function processTransitionCallbacks(pendingTransitions, endTime, callbacks) { @@ -8893,10 +8913,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$159 = workInProgress.stateNode; + root$163 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$159.incompleteTransitions.has(transition)) { + if (!root$163.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -8904,11 +8924,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$159.incompleteTransitions.set(transition, markerInstance); + root$163.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$159.incompleteTransitions.forEach(function (markerInstance) { + root$163.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -9493,11 +9513,9 @@ function mountHostRootWithoutHydrating( current, workInProgress, nextChildren, - renderLanes, - recoverableError + renderLanes ) { resetHydrationState(); - queueHydrationError(recoverableError); workInProgress.flags |= 256; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; @@ -9576,7 +9594,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (JSCompiler_temp$jscomp$0 = !0)) : (JSCompiler_temp$jscomp$0 = !1); } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(); + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } nextInstance = workInProgress.memoizedState; if ( @@ -9662,15 +9680,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress), (workInProgress.flags &= -257), - (JSCompiler_temp = createCapturedValueFromError( - Error(formatProdErrorMessage(422)), - null - )), (workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ))) : null !== workInProgress.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress), @@ -9721,12 +9734,11 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { nextProps = Error(formatProdErrorMessage(419)); nextProps.stack = ""; nextProps.digest = JSCompiler_temp; - JSCompiler_temp = createCapturedValueFromError(nextProps, null); + queueHydrationError({ value: nextProps, source: null, stack: null }); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - JSCompiler_temp + renderLanes ); } else if ( (enableLazyContextPropagation && @@ -9794,8 +9806,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else "$?" === nextInstance.data @@ -9960,10 +9971,8 @@ function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { - null !== recoverableError && queueHydrationError(recoverableError); reconcileChildFibers(workInProgress, current.child, null, renderLanes); current = mountSuspensePrimaryChildren( workInProgress, @@ -10337,55 +10346,50 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.stateNode.containerInfo ); if (null === current) throw Error(formatProdErrorMessage(387)); - init = workInProgress.pendingProps; - var prevState = workInProgress.memoizedState; - props = prevState.element; + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + props = init.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, init, null, renderLanes); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - init = nextState.cache; - pushProvider(workInProgress, CacheContext, init); - init !== prevState.cache && + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextState.element; - if (prevState.isDehydrated) + nextProps = nextState.element; + if (init.isDehydrated) if ( - ((prevState = { - element: init, + ((init = { + element: nextProps, isDehydrated: !1, cache: nextState.cache }), - (workInProgress.updateQueue.baseState = prevState), - (workInProgress.memoizedState = prevState), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), workInProgress.flags & 256) ) { - props = createCapturedValueAtFiber( - Error(formatProdErrorMessage(423)), - workInProgress - ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - init, - renderLanes, - props + nextProps, + renderLanes ); break a; - } else if (init !== props) { + } else if (nextProps !== props) { props = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); + queueHydrationError(props); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - init, - renderLanes, - props + nextProps, + renderLanes ); break a; } else @@ -10400,7 +10404,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - init, + nextProps, renderLanes ), workInProgress.child = renderLanes; @@ -10411,7 +10415,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (init === props) { + if (nextProps === props) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -10419,7 +10423,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, init, renderLanes); + reconcileChildren(current, workInProgress, nextProps, renderLanes); } workInProgress = workInProgress.child; } @@ -10490,14 +10494,14 @@ function beginWork(current, workInProgress, renderLanes) { (rootOrSingletonContext = !1), (init = !0)) : (init = !1); - init || throwOnHydrationMismatch(); + init || throwOnHydrationMismatch(workInProgress); } pushHostContext(workInProgress); init = workInProgress.type; - prevState = workInProgress.pendingProps; + nextProps = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - props = prevState.children; - shouldSetTextContent(init, prevState) + props = nextProps.children; + shouldSetTextContent(init, nextProps) ? (props = null) : null !== nextState && shouldSetTextContent(init, nextState) && @@ -10538,7 +10542,7 @@ function beginWork(current, workInProgress, renderLanes) { (nextHydratableInstance = null), (current = !0)) : (current = !1); - current || throwOnHydrationMismatch(); + current || throwOnHydrationMismatch(workInProgress); } return null; case 13: @@ -10606,12 +10610,12 @@ function beginWork(current, workInProgress, renderLanes) { ? workInProgress.type : workInProgress.type._context; init = workInProgress.pendingProps; - prevState = workInProgress.memoizedProps; + nextProps = workInProgress.memoizedProps; nextState = init.value; pushProvider(workInProgress, props, nextState); - if (!enableLazyContextPropagation && null !== prevState) - if (objectIs(prevState.value, nextState)) { - if (prevState.children === init.children) { + if (!enableLazyContextPropagation && null !== nextProps) + if (objectIs(nextProps.value, nextState)) { + if (nextProps.children === init.children) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -10673,11 +10677,11 @@ function beginWork(current, workInProgress, renderLanes) { ? ((init = peekCacheFromPool()), null === init && ((init = workInProgressRoot), - (prevState = createCache()), - (init.pooledCache = prevState), - prevState.refCount++, - null !== prevState && (init.pooledCacheLanes |= renderLanes), - (init = prevState)), + (nextProps = createCache()), + (init.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), (workInProgress.memoizedState = { parent: props, cache: init }), initializeUpdateQueue(workInProgress), pushProvider(workInProgress, CacheContext, init)) @@ -10686,7 +10690,7 @@ function beginWork(current, workInProgress, renderLanes) { processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), (init = current.memoizedState), - (prevState = workInProgress.memoizedState), + (nextProps = workInProgress.memoizedState), init.parent !== props ? ((init = { parent: props, cache: props }), (workInProgress.memoizedState = init), @@ -10695,7 +10699,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.updateQueue.baseState = init), pushProvider(workInProgress, CacheContext, props)) - : ((props = prevState.cache), + : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== init.cache && propagateContextChange( @@ -11242,14 +11246,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$197 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$197 = lastTailNode), + for (var lastTailNode$199 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$199 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$197 + null === lastTailNode$199 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$197.sibling = null); + : (lastTailNode$199.sibling = null); } } function bubbleProperties(completedWork) { @@ -11259,19 +11263,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$198 = completedWork.child; null !== child$198; ) - (newChildLanes |= child$198.lanes | child$198.childLanes), - (subtreeFlags |= child$198.subtreeFlags & 31457280), - (subtreeFlags |= child$198.flags & 31457280), - (child$198.return = completedWork), - (child$198 = child$198.sibling); + for (var child$200 = completedWork.child; null !== child$200; ) + (newChildLanes |= child$200.lanes | child$200.childLanes), + (subtreeFlags |= child$200.subtreeFlags & 31457280), + (subtreeFlags |= child$200.flags & 31457280), + (child$200.return = completedWork), + (child$200 = child$200.sibling); else - for (child$198 = completedWork.child; null !== child$198; ) - (newChildLanes |= child$198.lanes | child$198.childLanes), - (subtreeFlags |= child$198.subtreeFlags), - (subtreeFlags |= child$198.flags), - (child$198.return = completedWork), - (child$198 = child$198.sibling); + for (child$200 = completedWork.child; null !== child$200; ) + (newChildLanes |= child$200.lanes | child$200.childLanes), + (subtreeFlags |= child$200.subtreeFlags), + (subtreeFlags |= child$200.flags), + (child$200.return = completedWork), + (child$200 = child$200.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -11519,7 +11523,7 @@ function completeWork(current, workInProgress, renderLanes) { (null !== newProps && !0 === newProps.suppressHydrationWarning) || checkForUnmatchedText(current.nodeValue, renderLanes) || !favorSafetyOverHydrationPerf || - throwOnHydrationMismatch(); + throwOnHydrationMismatch(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -11576,11 +11580,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (currentResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$210 = null; + var cache$212 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$210 = newProps.memoizedState.cachePool.pool); - cache$210 !== currentResource && (newProps.flags |= 2048); + (cache$212 = newProps.memoizedState.cachePool.pool); + cache$212 !== currentResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -11615,8 +11619,8 @@ function completeWork(current, workInProgress, renderLanes) { if (null === currentResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$210 = currentResource.rendering; - if (null === cache$210) + cache$212 = currentResource.rendering; + if (null === cache$212) if (newProps) cutOffTailIfNeeded(currentResource, !1); else { if ( @@ -11624,11 +11628,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$210 = findFirstSuspended(current); - if (null !== cache$210) { + cache$212 = findFirstSuspended(current); + if (null !== cache$212) { workInProgress.flags |= 128; cutOffTailIfNeeded(currentResource, !1); - current = cache$210.updateQueue; + current = cache$212.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -11653,7 +11657,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$210)), null !== current)) { + if (((current = findFirstSuspended(cache$212)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -11663,7 +11667,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !0), null === currentResource.tail && "hidden" === currentResource.tailMode && - !cache$210.alternate && + !cache$212.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -11676,13 +11680,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(currentResource, !1), (workInProgress.lanes = 4194304)); currentResource.isBackwards - ? ((cache$210.sibling = workInProgress.child), - (workInProgress.child = cache$210)) + ? ((cache$212.sibling = workInProgress.child), + (workInProgress.child = cache$212)) : ((current = currentResource.last), null !== current - ? (current.sibling = cache$210) - : (workInProgress.child = cache$210), - (currentResource.last = cache$210)); + ? (current.sibling = cache$212) + : (workInProgress.child = cache$212), + (currentResource.last = cache$212)); } if (null !== currentResource.tail) return ( @@ -11947,8 +11951,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$227) { - captureCommitPhaseError(current, nearestMountedAncestor, error$227); + } catch (error$229) { + captureCommitPhaseError(current, nearestMountedAncestor, error$229); } else ref.current = null; } @@ -12273,11 +12277,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$229) { + } catch (error$231) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$229 + error$231 ); } } @@ -12944,8 +12948,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$242) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$242); + } catch (error$244) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$244); } } break; @@ -13117,11 +13121,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$243) { + } catch (error$245) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$243 + error$245 ); } } @@ -13159,8 +13163,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$244) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$244); + } catch (error$246) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$246); } } if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { @@ -13171,8 +13175,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(flags, hoistableRoot, current, root), (flags[internalPropsKey] = root); - } catch (error$247) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$247); + } catch (error$249) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$249); } } break; @@ -13186,8 +13190,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$248) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$248); + } catch (error$250) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$250); } } break; @@ -13201,8 +13205,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$249) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$249); + } catch (error$251) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$251); } break; case 4: @@ -13232,8 +13236,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$251) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$251); + } catch (error$253) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$253); } current = finishedWork.updateQueue; null !== current && @@ -13308,11 +13312,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$232) { + } catch (error$234) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$232 + error$234 ); } } else if ( @@ -13387,21 +13391,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$233 = JSCompiler_inline_result.stateNode; + var parent$235 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$233, ""), + (setTextContent(parent$235, ""), (JSCompiler_inline_result.flags &= -33)); - var before$234 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$234, parent$233); + var before$236 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$236, parent$235); break; case 3: case 4: - var parent$235 = JSCompiler_inline_result.stateNode.containerInfo, - before$236 = getHostSibling(finishedWork); + var parent$237 = JSCompiler_inline_result.stateNode.containerInfo, + before$238 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$236, - parent$235 + before$238, + parent$237 ); break; default: @@ -13860,9 +13864,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$258 = finishedWork.stateNode; + var instance$260 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$258._visibility & 4 + ? instance$260._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -13874,7 +13878,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$258._visibility |= 4), + : ((instance$260._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -13887,7 +13891,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$258 + instance$260 ); break; case 24: @@ -15032,8 +15036,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$267) { - handleThrow(root, thrownValue$267); + } catch (thrownValue$269) { + handleThrow(root, thrownValue$269); } while (1); lanes && root.shellSuspendCounter++; @@ -15138,8 +15142,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$269) { - handleThrow(root, thrownValue$269); + } catch (thrownValue$271) { + handleThrow(root, thrownValue$271); } while (1); resetContextDependencies(); @@ -15362,12 +15366,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$273 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$275 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$273 && + shouldFireAfterActiveInstanceBlur$275 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -15437,7 +15441,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$274 = rootWithPendingPassiveEffects, + var root$276 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -15453,7 +15457,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$274, remainingLanes); + releaseRootPooledCache(root$276, remainingLanes); } } return !1; @@ -16054,12 +16058,12 @@ function updateContainer(element, container, parentComponent, callback) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$276 = fiber.stateNode; - if (root$276.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$276.pendingLanes); + var root$278 = fiber.stateNode; + if (root$278.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$278.pendingLanes); 0 !== lanes && - (upgradePendingLanesToSync(root$276, lanes), - ensureRootIsScheduled(root$276), + (upgradePendingLanesToSync(root$278, lanes), + ensureRootIsScheduled(root$278), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -16749,17 +16753,17 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1712 = { +var devToolsConfig$jscomp$inline_1714 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-eb01ec3b", + version: "19.0.0-www-modern-4326b2be", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2112 = { - bundleType: devToolsConfig$jscomp$inline_1712.bundleType, - version: devToolsConfig$jscomp$inline_1712.version, - rendererPackageName: devToolsConfig$jscomp$inline_1712.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1712.rendererConfig, +var internals$jscomp$inline_2118 = { + bundleType: devToolsConfig$jscomp$inline_1714.bundleType, + version: devToolsConfig$jscomp$inline_1714.version, + rendererPackageName: devToolsConfig$jscomp$inline_1714.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1714.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16775,26 +16779,26 @@ var internals$jscomp$inline_2112 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1712.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1714.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-eb01ec3b" + reconcilerVersion: "19.0.0-www-modern-4326b2be" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2113 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2119 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2113.isDisabled && - hook$jscomp$inline_2113.supportsFiber + !hook$jscomp$inline_2119.isDisabled && + hook$jscomp$inline_2119.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2113.inject( - internals$jscomp$inline_2112 + (rendererID = hook$jscomp$inline_2119.inject( + internals$jscomp$inline_2118 )), - (injectedHook = hook$jscomp$inline_2113); + (injectedHook = hook$jscomp$inline_2119); } catch (err) {} } if ("function" !== typeof require("ReactFiberErrorDialog").showErrorDialog) @@ -17208,4 +17212,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-eb01ec3b"; +exports.version = "19.0.0-www-modern-4326b2be"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 2115672b1e..ee85a90649 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -2564,6 +2564,394 @@ if (__DEV__) { var objectIs = typeof Object.is === "function" ? Object.is : is; // $FlowFixMe[method-unbinding] + var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + return "\n" + prefix + name; + } + } + function describeDebugInfoFrame(name, env) { + return describeBuiltInComponentFrame( + name + (env ? " (" + env + ")" : "") + ); + } + var reentry = false; + var componentFrameCache; + + { + var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap$1(); + } + /** + * Leverages native browser/VM stack frames to get proper details (e.g. + * filename, line + col number) for a single component in a component stack. We + * do this by: + * (1) throwing and catching an error in the function - this will be our + * control error. + * (2) calling the component which will eventually throw an error that we'll + * catch - this will be our sample error. + * (3) diffing the control and sample error stacks to find the stack frame + * which represents our component. + */ + + function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ""; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher$2.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher$2.current = null; + disableLogs(); + } + /** + * Finding a common stack frame between sample and control errors can be + * tricky given the different types and levels of stack trace truncation from + * different JS VMs. So instead we'll attempt to control what that common + * frame should be through this object method: + * Having both the sample and control errors be in the function under the + * `DescribeNativeComponentFrameRoot` property, + setting the `name` and + * `displayName` properties of the function ensures that a stack + * frame exists that has the method name `DescribeNativeComponentFrameRoot` in + * it for both control and sample stacks. + */ + + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + var control; + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe[prop-missing] + + Object.defineProperty(Fake.prototype, "props", { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === "object" && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } // $FlowFixMe[prop-missing] found when upgrading Flow + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } // TODO(luna): This will currently only throw if the function component + // tries to access React/ReactDOM/props. We should probably make this throw + // in simple components too + + var maybePromise = fn(); // If the function component returns a promise, it's likely an async + // component, which we don't yet support. Attach a noop catch handler to + // silence the error. + // TODO: Implement component stacks for async client components? + + if (maybePromise && typeof maybePromise.catch === "function") { + maybePromise.catch(function () {}); + } + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === "string") { + return [sample.stack, control.stack]; + } + } + + return [null, null]; + } + }; // $FlowFixMe[prop-missing] + + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); // Before ES6, the `name` property was not configurable. + + if (namePropDescriptor && namePropDescriptor.configurable) { + // V8 utilizes a function's `name` property when generating a stack trace. + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor + // is set to `false`. + // $FlowFixMe[cannot-write] + "name", + { + value: "DetermineComponentFrameRoot" + } + ); + } + + try { + var _RunInRootFrame$Deter = + RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + + if (sampleStack && controlStack) { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sampleStack.split("\n"); + var controlLines = controlStack.split("\n"); + var s = 0; + var c = 0; + + while ( + s < sampleLines.length && + !sampleLines[s].includes("DetermineComponentFrameRoot") + ) { + s++; + } + + while ( + c < controlLines.length && + !controlLines[c].includes("DetermineComponentFrameRoot") + ) { + c++; + } // We couldn't find our intentionally injected common root frame, attempt + // to find another common root frame by search from the bottom of the + // control stack... + + if (s === sampleLines.length || c === controlLines.length) { + s = sampleLines.length - 1; + c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = + "\n" + sampleLines[s].replace(" at new ", " at "); // If our component frame is labeled "" + // but we have a user-provided "displayName" + // splice it in to make the stack more readable. + + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); + } + + if (true) { + if (typeof fn === "function") { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher$2.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + var name = fn ? fn.displayName || fn.name : ""; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; + + { + if (typeof fn === "function") { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; + } + + function describeClassComponentFrame(ctor, ownerFn) { + { + return describeNativeComponentFrame(ctor, true); + } + } + function describeFunctionComponentFrame(fn, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostHoistable: + case HostSingleton: + case HostComponent: + return describeBuiltInComponentFrame(fiber.type); + + case LazyComponent: + return describeBuiltInComponentFrame("Lazy"); + + case SuspenseComponent: + return describeBuiltInComponentFrame("Suspense"); + + case SuspenseListComponent: + return describeBuiltInComponentFrame("SuspenseList"); + + case FunctionComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(fiber.type); + + case ForwardRef: + return describeFunctionComponentFrame(fiber.type.render); + + case ClassComponent: + return describeClassComponentFrame(fiber.type); + + default: + return ""; + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + var node = workInProgress; + + do { + info += describeFiber(node); + + if (true) { + // Add any Server Component stack frames in reverse order. + var debugInfo = node._debugInfo; + + if (debugInfo) { + for (var i = debugInfo.length - 1; i >= 0; i--) { + var entry = debugInfo[i]; + + if (typeof entry.name === "string") { + info += describeDebugInfoFrame(entry.name, entry.env); + } + } + } + } // $FlowFixMe[incompatible-type] we bail out when we get a null + + node = node.return; + } while (node); + + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + + var CapturedStacks = new WeakMap(); + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + var stack; + + if (typeof value === "object" && value !== null) { + var capturedStack = CapturedStacks.get(value); + + if (typeof capturedStack === "string") { + stack = capturedStack; + } else { + stack = getStackByFiberInDevAndProd(source); + CapturedStacks.set(value, stack); + } + } else { + stack = getStackByFiberInDevAndProd(source); + } + + return { + value: value, + source: source, + stack: stack + }; + } + function createCapturedValueFromError(value, stack) { + if (typeof stack === "string") { + CapturedStacks.set(value, stack); + } + + return { + value: value, + source: null, + stack: stack + }; + } + var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) @@ -4760,357 +5148,6 @@ if (__DEV__) { return true; } - var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - return "\n" + prefix + name; - } - } - function describeDebugInfoFrame(name, env) { - return describeBuiltInComponentFrame( - name + (env ? " (" + env + ")" : "") - ); - } - var reentry = false; - var componentFrameCache; - - { - var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap$1(); - } - /** - * Leverages native browser/VM stack frames to get proper details (e.g. - * filename, line + col number) for a single component in a component stack. We - * do this by: - * (1) throwing and catching an error in the function - this will be our - * control error. - * (2) calling the component which will eventually throw an error that we'll - * catch - this will be our sample error. - * (3) diffing the control and sample error stacks to find the stack frame - * which represents our component. - */ - - function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ""; - } - - { - var frame = componentFrameCache.get(fn); - - if (frame !== undefined) { - return frame; - } - } - - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. - - Error.prepareStackTrace = undefined; - var previousDispatcher; - - { - previousDispatcher = ReactCurrentDispatcher$2.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - - ReactCurrentDispatcher$2.current = null; - disableLogs(); - } - /** - * Finding a common stack frame between sample and control errors can be - * tricky given the different types and levels of stack trace truncation from - * different JS VMs. So instead we'll attempt to control what that common - * frame should be through this object method: - * Having both the sample and control errors be in the function under the - * `DescribeNativeComponentFrameRoot` property, + setting the `name` and - * `displayName` properties of the function ensures that a stack - * frame exists that has the method name `DescribeNativeComponentFrameRoot` in - * it for both control and sample stacks. - */ - - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - var control; - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe[prop-missing] - - Object.defineProperty(Fake.prototype, "props", { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === "object" && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } // $FlowFixMe[prop-missing] found when upgrading Flow - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } // TODO(luna): This will currently only throw if the function component - // tries to access React/ReactDOM/props. We should probably make this throw - // in simple components too - - var maybePromise = fn(); // If the function component returns a promise, it's likely an async - // component, which we don't yet support. Attach a noop catch handler to - // silence the error. - // TODO: Implement component stacks for async client components? - - if (maybePromise && typeof maybePromise.catch === "function") { - maybePromise.catch(function () {}); - } - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === "string") { - return [sample.stack, control.stack]; - } - } - - return [null, null]; - } - }; // $FlowFixMe[prop-missing] - - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); // Before ES6, the `name` property was not configurable. - - if (namePropDescriptor && namePropDescriptor.configurable) { - // V8 utilizes a function's `name` property when generating a stack trace. - Object.defineProperty( - RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor - // is set to `false`. - // $FlowFixMe[cannot-write] - "name", - { - value: "DetermineComponentFrameRoot" - } - ); - } - - try { - var _RunInRootFrame$Deter = - RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - - if (sampleStack && controlStack) { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sampleStack.split("\n"); - var controlLines = controlStack.split("\n"); - var s = 0; - var c = 0; - - while ( - s < sampleLines.length && - !sampleLines[s].includes("DetermineComponentFrameRoot") - ) { - s++; - } - - while ( - c < controlLines.length && - !controlLines[c].includes("DetermineComponentFrameRoot") - ) { - c++; - } // We couldn't find our intentionally injected common root frame, attempt - // to find another common root frame by search from the bottom of the - // control stack... - - if (s === sampleLines.length || c === controlLines.length) { - s = sampleLines.length - 1; - c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = - "\n" + sampleLines[s].replace(" at new ", " at "); // If our component frame is labeled "" - // but we have a user-provided "displayName" - // splice it in to make the stack more readable. - - if (fn.displayName && _frame.includes("")) { - _frame = _frame.replace("", fn.displayName); - } - - if (true) { - if (typeof fn === "function") { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. - - return _frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - - { - ReactCurrentDispatcher$2.current = previousDispatcher; - reenableLogs(); - } - - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - - var name = fn ? fn.displayName || fn.name : ""; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; - - { - if (typeof fn === "function") { - componentFrameCache.set(fn, syntheticFrame); - } - } - - return syntheticFrame; - } - - function describeClassComponentFrame(ctor, ownerFn) { - { - return describeNativeComponentFrame(ctor, true); - } - } - function describeFunctionComponentFrame(fn, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } - } - - function describeFiber(fiber) { - switch (fiber.tag) { - case HostHoistable: - case HostSingleton: - case HostComponent: - return describeBuiltInComponentFrame(fiber.type); - - case LazyComponent: - return describeBuiltInComponentFrame("Lazy"); - - case SuspenseComponent: - return describeBuiltInComponentFrame("Suspense"); - - case SuspenseListComponent: - return describeBuiltInComponentFrame("SuspenseList"); - - case FunctionComponent: - case SimpleMemoComponent: - return describeFunctionComponentFrame(fiber.type); - - case ForwardRef: - return describeFunctionComponentFrame(fiber.type.render); - - case ClassComponent: - return describeClassComponentFrame(fiber.type); - - default: - return ""; - } - } - - function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = ""; - var node = workInProgress; - - do { - info += describeFiber(node); - - if (true) { - // Add any Server Component stack frames in reverse order. - var debugInfo = node._debugInfo; - - if (debugInfo) { - for (var i = debugInfo.length - 1; i >= 0; i--) { - var entry = debugInfo[i]; - - if (typeof entry.name === "string") { - info += describeDebugInfoFrame(entry.name, entry.env); - } - } - } - } // $FlowFixMe[incompatible-type] we bail out when we get a null - - node = node.return; - } while (node); - - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var current = null; var isRendering = false; @@ -13126,43 +13163,6 @@ if (__DEV__) { return baseProps; } - var CapturedStacks = new WeakMap(); - function createCapturedValueAtFiber(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - var stack; - - if (typeof value === "object" && value !== null) { - var capturedStack = CapturedStacks.get(value); - - if (typeof capturedStack === "string") { - stack = capturedStack; - } else { - stack = getStackByFiberInDevAndProd(source); - CapturedStacks.set(value, stack); - } - } else { - stack = getStackByFiberInDevAndProd(source); - } - - return { - value: value, - source: source, - stack: stack - }; - } - function createCapturedValueFromError(value, stack) { - if (typeof stack === "string") { - CapturedStacks.set(value, stack); - } - - return { - value: value, - source: null, - stack: stack - }; - } - var reportGlobalError = typeof reportError === "function" // In modern browsers, reportError will dispatch an error event, ? // emulating an uncaught JavaScript error. @@ -13725,8 +13725,17 @@ if (__DEV__) { } } // This is a regular error, not a Suspense wakeable. - value = createCapturedValueAtFiber(value, sourceFiber); - renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + var wrapperError = new Error( + "There was an error during concurrent rendering but React was able to recover by " + + "instead synchronously rendering the entire root.", + { + cause: value + } + ); + queueConcurrentError( + createCapturedValueAtFiber(wrapperError, sourceFiber) + ); + renderDidError(); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. @@ -13736,26 +13745,30 @@ if (__DEV__) { return true; } + var errorInfo = createCapturedValueAtFiber(value, sourceFiber); var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { - var _errorInfo = value; workInProgress.flags |= ShouldCapture; - var lane = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); - var update = createRootErrorUpdate( + + var _lane = pickArbitraryLane(rootRenderLanes); + + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); + + var _update = createRootErrorUpdate( workInProgress.stateNode, - _errorInfo, - lane + errorInfo, + _lane ); - enqueueCapturedUpdate(workInProgress, update); + + enqueueCapturedUpdate(workInProgress, _update); return false; } case ClassComponent: - var errorInfo = value; + // Capture and retry var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -13768,19 +13781,19 @@ if (__DEV__) { ) { workInProgress.flags |= ShouldCapture; - var _lane = pickArbitraryLane(rootRenderLanes); + var _lane2 = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane2); // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(_lane); + var _update2 = createClassErrorUpdate(_lane2); initializeClassErrorUpdate( - _update, + _update2, root, workInProgress, errorInfo ); - enqueueCapturedUpdate(workInProgress, _update); + enqueueCapturedUpdate(workInProgress, _update2); return false; } @@ -15578,20 +15591,12 @@ if (__DEV__) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. - // - // The error is passed in as an argument to enforce that every caller provide - // a custom message, or explicitly opt out (currently the only path that opts - // out is legacy mode; every concurrent path provides an error). - if (recoverableError !== null) { - queueHydrationError(recoverableError); - } // This will add the old fiber to the deletion list - + // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; @@ -15677,9 +15682,7 @@ if (__DEV__) { message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; componentStack = _getSuspenseInstanceF.componentStack; - } - - var capturedValue = null; // TODO: Figure out a better signal than encoding a magic digest value. + } // TODO: Figure out a better signal than encoding a magic digest value. { var error; @@ -15697,17 +15700,17 @@ if (__DEV__) { error.stack = stack || ""; error.digest = digest; - capturedValue = createCapturedValueFromError( + var capturedValue = createCapturedValueFromError( error, componentStack === undefined ? null : componentStack ); + queueHydrationError(capturedValue); } return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - capturedValue + renderLanes ); } // any context has changed, we need to treat is as if the input might have changed. @@ -15767,8 +15770,7 @@ if (__DEV__) { return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else if (isSuspenseInstancePending()) { // This component is still pending more data from the server, so we can't hydrate its @@ -15807,22 +15809,13 @@ if (__DEV__) { // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. + // The error should've already been logged in throwException. pushPrimaryTreeSuspenseHandler(workInProgress); workInProgress.flags &= ~ForceClientRender; - - var _capturedValue = createCapturedValueFromError( - new Error( - "There was an error while hydrating this Suspense boundary. " + - "Switched to client rendering." - ), - null - ); - return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - _capturedValue + renderLanes ); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. @@ -23897,11 +23890,12 @@ if (__DEV__) { ); } } - function renderDidError(error) { + function renderDidError() { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } - + } + function queueConcurrentError(error) { if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { @@ -26833,7 +26827,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-ea7c02d5"; + var ReactVersion = "19.0.0-www-classic-272ef63e"; // Might add PROFILE later. diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 403e213aa4..fdd4aed6d4 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -2564,6 +2564,394 @@ if (__DEV__) { var objectIs = typeof Object.is === "function" ? Object.is : is; // $FlowFixMe[method-unbinding] + var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + return "\n" + prefix + name; + } + } + function describeDebugInfoFrame(name, env) { + return describeBuiltInComponentFrame( + name + (env ? " (" + env + ")" : "") + ); + } + var reentry = false; + var componentFrameCache; + + { + var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap$1(); + } + /** + * Leverages native browser/VM stack frames to get proper details (e.g. + * filename, line + col number) for a single component in a component stack. We + * do this by: + * (1) throwing and catching an error in the function - this will be our + * control error. + * (2) calling the component which will eventually throw an error that we'll + * catch - this will be our sample error. + * (3) diffing the control and sample error stacks to find the stack frame + * which represents our component. + */ + + function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ""; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher$2.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher$2.current = null; + disableLogs(); + } + /** + * Finding a common stack frame between sample and control errors can be + * tricky given the different types and levels of stack trace truncation from + * different JS VMs. So instead we'll attempt to control what that common + * frame should be through this object method: + * Having both the sample and control errors be in the function under the + * `DescribeNativeComponentFrameRoot` property, + setting the `name` and + * `displayName` properties of the function ensures that a stack + * frame exists that has the method name `DescribeNativeComponentFrameRoot` in + * it for both control and sample stacks. + */ + + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + var control; + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe[prop-missing] + + Object.defineProperty(Fake.prototype, "props", { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === "object" && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } // $FlowFixMe[prop-missing] found when upgrading Flow + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } // TODO(luna): This will currently only throw if the function component + // tries to access React/ReactDOM/props. We should probably make this throw + // in simple components too + + var maybePromise = fn(); // If the function component returns a promise, it's likely an async + // component, which we don't yet support. Attach a noop catch handler to + // silence the error. + // TODO: Implement component stacks for async client components? + + if (maybePromise && typeof maybePromise.catch === "function") { + maybePromise.catch(function () {}); + } + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === "string") { + return [sample.stack, control.stack]; + } + } + + return [null, null]; + } + }; // $FlowFixMe[prop-missing] + + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); // Before ES6, the `name` property was not configurable. + + if (namePropDescriptor && namePropDescriptor.configurable) { + // V8 utilizes a function's `name` property when generating a stack trace. + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor + // is set to `false`. + // $FlowFixMe[cannot-write] + "name", + { + value: "DetermineComponentFrameRoot" + } + ); + } + + try { + var _RunInRootFrame$Deter = + RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + + if (sampleStack && controlStack) { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sampleStack.split("\n"); + var controlLines = controlStack.split("\n"); + var s = 0; + var c = 0; + + while ( + s < sampleLines.length && + !sampleLines[s].includes("DetermineComponentFrameRoot") + ) { + s++; + } + + while ( + c < controlLines.length && + !controlLines[c].includes("DetermineComponentFrameRoot") + ) { + c++; + } // We couldn't find our intentionally injected common root frame, attempt + // to find another common root frame by search from the bottom of the + // control stack... + + if (s === sampleLines.length || c === controlLines.length) { + s = sampleLines.length - 1; + c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = + "\n" + sampleLines[s].replace(" at new ", " at "); // If our component frame is labeled "" + // but we have a user-provided "displayName" + // splice it in to make the stack more readable. + + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); + } + + if (true) { + if (typeof fn === "function") { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher$2.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + var name = fn ? fn.displayName || fn.name : ""; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; + + { + if (typeof fn === "function") { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; + } + + function describeClassComponentFrame(ctor, ownerFn) { + { + return describeNativeComponentFrame(ctor, true); + } + } + function describeFunctionComponentFrame(fn, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostHoistable: + case HostSingleton: + case HostComponent: + return describeBuiltInComponentFrame(fiber.type); + + case LazyComponent: + return describeBuiltInComponentFrame("Lazy"); + + case SuspenseComponent: + return describeBuiltInComponentFrame("Suspense"); + + case SuspenseListComponent: + return describeBuiltInComponentFrame("SuspenseList"); + + case FunctionComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(fiber.type); + + case ForwardRef: + return describeFunctionComponentFrame(fiber.type.render); + + case ClassComponent: + return describeClassComponentFrame(fiber.type); + + default: + return ""; + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + var node = workInProgress; + + do { + info += describeFiber(node); + + if (true) { + // Add any Server Component stack frames in reverse order. + var debugInfo = node._debugInfo; + + if (debugInfo) { + for (var i = debugInfo.length - 1; i >= 0; i--) { + var entry = debugInfo[i]; + + if (typeof entry.name === "string") { + info += describeDebugInfoFrame(entry.name, entry.env); + } + } + } + } // $FlowFixMe[incompatible-type] we bail out when we get a null + + node = node.return; + } while (node); + + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + + var CapturedStacks = new WeakMap(); + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + var stack; + + if (typeof value === "object" && value !== null) { + var capturedStack = CapturedStacks.get(value); + + if (typeof capturedStack === "string") { + stack = capturedStack; + } else { + stack = getStackByFiberInDevAndProd(source); + CapturedStacks.set(value, stack); + } + } else { + stack = getStackByFiberInDevAndProd(source); + } + + return { + value: value, + source: source, + stack: stack + }; + } + function createCapturedValueFromError(value, stack) { + if (typeof stack === "string") { + CapturedStacks.set(value, stack); + } + + return { + value: value, + source: null, + stack: stack + }; + } + var contextStackCursor = createCursor(null); var contextFiberStackCursor = createCursor(null); var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) @@ -4760,357 +5148,6 @@ if (__DEV__) { return true; } - var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher; - var prefix; - function describeBuiltInComponentFrame(name, ownerFn) { - { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - return "\n" + prefix + name; - } - } - function describeDebugInfoFrame(name, env) { - return describeBuiltInComponentFrame( - name + (env ? " (" + env + ")" : "") - ); - } - var reentry = false; - var componentFrameCache; - - { - var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; - componentFrameCache = new PossiblyWeakMap$1(); - } - /** - * Leverages native browser/VM stack frames to get proper details (e.g. - * filename, line + col number) for a single component in a component stack. We - * do this by: - * (1) throwing and catching an error in the function - this will be our - * control error. - * (2) calling the component which will eventually throw an error that we'll - * catch - this will be our sample error. - * (3) diffing the control and sample error stacks to find the stack frame - * which represents our component. - */ - - function describeNativeComponentFrame(fn, construct) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ""; - } - - { - var frame = componentFrameCache.get(fn); - - if (frame !== undefined) { - return frame; - } - } - - reentry = true; - var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. - - Error.prepareStackTrace = undefined; - var previousDispatcher; - - { - previousDispatcher = ReactCurrentDispatcher$2.current; // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - - ReactCurrentDispatcher$2.current = null; - disableLogs(); - } - /** - * Finding a common stack frame between sample and control errors can be - * tricky given the different types and levels of stack trace truncation from - * different JS VMs. So instead we'll attempt to control what that common - * frame should be through this object method: - * Having both the sample and control errors be in the function under the - * `DescribeNativeComponentFrameRoot` property, + setting the `name` and - * `displayName` properties of the function ensures that a stack - * frame exists that has the method name `DescribeNativeComponentFrameRoot` in - * it for both control and sample stacks. - */ - - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - var control; - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - var Fake = function () { - throw Error(); - }; // $FlowFixMe[prop-missing] - - Object.defineProperty(Fake.prototype, "props", { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === "object" && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } // $FlowFixMe[prop-missing] found when upgrading Flow - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } // TODO(luna): This will currently only throw if the function component - // tries to access React/ReactDOM/props. We should probably make this throw - // in simple components too - - var maybePromise = fn(); // If the function component returns a promise, it's likely an async - // component, which we don't yet support. Attach a noop catch handler to - // silence the error. - // TODO: Implement component stacks for async client components? - - if (maybePromise && typeof maybePromise.catch === "function") { - maybePromise.catch(function () {}); - } - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === "string") { - return [sample.stack, control.stack]; - } - } - - return [null, null]; - } - }; // $FlowFixMe[prop-missing] - - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); // Before ES6, the `name` property was not configurable. - - if (namePropDescriptor && namePropDescriptor.configurable) { - // V8 utilizes a function's `name` property when generating a stack trace. - Object.defineProperty( - RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor - // is set to `false`. - // $FlowFixMe[cannot-write] - "name", - { - value: "DetermineComponentFrameRoot" - } - ); - } - - try { - var _RunInRootFrame$Deter = - RunInRootFrame.DetermineComponentFrameRoot(), - sampleStack = _RunInRootFrame$Deter[0], - controlStack = _RunInRootFrame$Deter[1]; - - if (sampleStack && controlStack) { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - var sampleLines = sampleStack.split("\n"); - var controlLines = controlStack.split("\n"); - var s = 0; - var c = 0; - - while ( - s < sampleLines.length && - !sampleLines[s].includes("DetermineComponentFrameRoot") - ) { - s++; - } - - while ( - c < controlLines.length && - !controlLines[c].includes("DetermineComponentFrameRoot") - ) { - c++; - } // We couldn't find our intentionally injected common root frame, attempt - // to find another common root frame by search from the bottom of the - // control stack... - - if (s === sampleLines.length || c === controlLines.length) { - s = sampleLines.length - 1; - c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - var _frame = - "\n" + sampleLines[s].replace(" at new ", " at "); // If our component frame is labeled "" - // but we have a user-provided "displayName" - // splice it in to make the stack more readable. - - if (fn.displayName && _frame.includes("")) { - _frame = _frame.replace("", fn.displayName); - } - - if (true) { - if (typeof fn === "function") { - componentFrameCache.set(fn, _frame); - } - } // Return the line we found. - - return _frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - - { - ReactCurrentDispatcher$2.current = previousDispatcher; - reenableLogs(); - } - - Error.prepareStackTrace = previousPrepareStackTrace; - } // Fallback to just using the name if we couldn't make it throw. - - var name = fn ? fn.displayName || fn.name : ""; - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; - - { - if (typeof fn === "function") { - componentFrameCache.set(fn, syntheticFrame); - } - } - - return syntheticFrame; - } - - function describeClassComponentFrame(ctor, ownerFn) { - { - return describeNativeComponentFrame(ctor, true); - } - } - function describeFunctionComponentFrame(fn, ownerFn) { - { - return describeNativeComponentFrame(fn, false); - } - } - - function describeFiber(fiber) { - switch (fiber.tag) { - case HostHoistable: - case HostSingleton: - case HostComponent: - return describeBuiltInComponentFrame(fiber.type); - - case LazyComponent: - return describeBuiltInComponentFrame("Lazy"); - - case SuspenseComponent: - return describeBuiltInComponentFrame("Suspense"); - - case SuspenseListComponent: - return describeBuiltInComponentFrame("SuspenseList"); - - case FunctionComponent: - case SimpleMemoComponent: - return describeFunctionComponentFrame(fiber.type); - - case ForwardRef: - return describeFunctionComponentFrame(fiber.type.render); - - case ClassComponent: - return describeClassComponentFrame(fiber.type); - - default: - return ""; - } - } - - function getStackByFiberInDevAndProd(workInProgress) { - try { - var info = ""; - var node = workInProgress; - - do { - info += describeFiber(node); - - if (true) { - // Add any Server Component stack frames in reverse order. - var debugInfo = node._debugInfo; - - if (debugInfo) { - for (var i = debugInfo.length - 1; i >= 0; i--) { - var entry = debugInfo[i]; - - if (typeof entry.name === "string") { - info += describeDebugInfoFrame(entry.name, entry.env); - } - } - } - } // $FlowFixMe[incompatible-type] we bail out when we get a null - - node = node.return; - } while (node); - - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var current = null; var isRendering = false; @@ -13126,43 +13163,6 @@ if (__DEV__) { return baseProps; } - var CapturedStacks = new WeakMap(); - function createCapturedValueAtFiber(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - var stack; - - if (typeof value === "object" && value !== null) { - var capturedStack = CapturedStacks.get(value); - - if (typeof capturedStack === "string") { - stack = capturedStack; - } else { - stack = getStackByFiberInDevAndProd(source); - CapturedStacks.set(value, stack); - } - } else { - stack = getStackByFiberInDevAndProd(source); - } - - return { - value: value, - source: source, - stack: stack - }; - } - function createCapturedValueFromError(value, stack) { - if (typeof stack === "string") { - CapturedStacks.set(value, stack); - } - - return { - value: value, - source: null, - stack: stack - }; - } - var reportGlobalError = typeof reportError === "function" // In modern browsers, reportError will dispatch an error event, ? // emulating an uncaught JavaScript error. @@ -13725,8 +13725,17 @@ if (__DEV__) { } } // This is a regular error, not a Suspense wakeable. - value = createCapturedValueAtFiber(value, sourceFiber); - renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + var wrapperError = new Error( + "There was an error during concurrent rendering but React was able to recover by " + + "instead synchronously rendering the entire root.", + { + cause: value + } + ); + queueConcurrentError( + createCapturedValueAtFiber(wrapperError, sourceFiber) + ); + renderDidError(); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. @@ -13736,26 +13745,30 @@ if (__DEV__) { return true; } + var errorInfo = createCapturedValueAtFiber(value, sourceFiber); var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { - var _errorInfo = value; workInProgress.flags |= ShouldCapture; - var lane = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); - var update = createRootErrorUpdate( + + var _lane = pickArbitraryLane(rootRenderLanes); + + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); + + var _update = createRootErrorUpdate( workInProgress.stateNode, - _errorInfo, - lane + errorInfo, + _lane ); - enqueueCapturedUpdate(workInProgress, update); + + enqueueCapturedUpdate(workInProgress, _update); return false; } case ClassComponent: - var errorInfo = value; + // Capture and retry var ctor = workInProgress.type; var instance = workInProgress.stateNode; @@ -13768,19 +13781,19 @@ if (__DEV__) { ) { workInProgress.flags |= ShouldCapture; - var _lane = pickArbitraryLane(rootRenderLanes); + var _lane2 = pickArbitraryLane(rootRenderLanes); - workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane2); // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(_lane); + var _update2 = createClassErrorUpdate(_lane2); initializeClassErrorUpdate( - _update, + _update2, root, workInProgress, errorInfo ); - enqueueCapturedUpdate(workInProgress, _update); + enqueueCapturedUpdate(workInProgress, _update2); return false; } @@ -15578,20 +15591,12 @@ if (__DEV__) { function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - recoverableError + renderLanes ) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. - // - // The error is passed in as an argument to enforce that every caller provide - // a custom message, or explicitly opt out (currently the only path that opts - // out is legacy mode; every concurrent path provides an error). - if (recoverableError !== null) { - queueHydrationError(recoverableError); - } // This will add the old fiber to the deletion list - + // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; @@ -15677,9 +15682,7 @@ if (__DEV__) { message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; componentStack = _getSuspenseInstanceF.componentStack; - } - - var capturedValue = null; // TODO: Figure out a better signal than encoding a magic digest value. + } // TODO: Figure out a better signal than encoding a magic digest value. { var error; @@ -15697,17 +15700,17 @@ if (__DEV__) { error.stack = stack || ""; error.digest = digest; - capturedValue = createCapturedValueFromError( + var capturedValue = createCapturedValueFromError( error, componentStack === undefined ? null : componentStack ); + queueHydrationError(capturedValue); } return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - capturedValue + renderLanes ); } // any context has changed, we need to treat is as if the input might have changed. @@ -15767,8 +15770,7 @@ if (__DEV__) { return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - null + renderLanes ); } else if (isSuspenseInstancePending()) { // This component is still pending more data from the server, so we can't hydrate its @@ -15807,22 +15809,13 @@ if (__DEV__) { // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. + // The error should've already been logged in throwException. pushPrimaryTreeSuspenseHandler(workInProgress); workInProgress.flags &= ~ForceClientRender; - - var _capturedValue = createCapturedValueFromError( - new Error( - "There was an error while hydrating this Suspense boundary. " + - "Switched to client rendering." - ), - null - ); - return retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - _capturedValue + renderLanes ); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. @@ -23897,11 +23890,12 @@ if (__DEV__) { ); } } - function renderDidError(error) { + function renderDidError() { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } - + } + function queueConcurrentError(error) { if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { @@ -26833,7 +26827,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-ea7c02d5"; + var ReactVersion = "19.0.0-www-modern-272ef63e"; // Might add PROFILE later.