diff --git a/package.json b/package.json index dea3c69518fc66..16759f9bc19a1a 100644 --- a/package.json +++ b/package.json @@ -216,16 +216,16 @@ "pretty-ms": "7.0.0", "random-seed": "0.3.0", "react": "19.0.0", - "react-builtin": "npm:react@19.1.0-canary-cbbe8666-20250213", + "react-builtin": "npm:react@19.1.0-canary-32b0cad8-20250213", "react-dom": "19.0.0", - "react-dom-builtin": "npm:react-dom@19.1.0-canary-cbbe8666-20250213", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-cbbe8666-20250213", - "react-experimental-builtin": "npm:react@0.0.0-experimental-cbbe8666-20250213", - "react-is-builtin": "npm:react-is@19.1.0-canary-cbbe8666-20250213", - "react-server-dom-turbopack": "19.1.0-canary-cbbe8666-20250213", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-cbbe8666-20250213", - "react-server-dom-webpack": "19.1.0-canary-cbbe8666-20250213", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-cbbe8666-20250213", + "react-dom-builtin": "npm:react-dom@19.1.0-canary-32b0cad8-20250213", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-32b0cad8-20250213", + "react-experimental-builtin": "npm:react@0.0.0-experimental-32b0cad8-20250213", + "react-is-builtin": "npm:react-is@19.1.0-canary-32b0cad8-20250213", + "react-server-dom-turbopack": "19.1.0-canary-32b0cad8-20250213", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-32b0cad8-20250213", + "react-server-dom-webpack": "19.1.0-canary-32b0cad8-20250213", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-32b0cad8-20250213", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -235,8 +235,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.12.1", - "scheduler-builtin": "npm:scheduler@0.26.0-canary-cbbe8666-20250213", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-cbbe8666-20250213", + "scheduler-builtin": "npm:scheduler@0.26.0-canary-32b0cad8-20250213", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-32b0cad8-20250213", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", @@ -277,10 +277,10 @@ "@types/react": "19.0.8", "@types/react-dom": "19.0.3", "jest-snapshot": "30.0.0-alpha.6", - "react": "19.1.0-canary-cbbe8666-20250213", - "react-dom": "19.1.0-canary-cbbe8666-20250213", - "react-is": "19.1.0-canary-cbbe8666-20250213", - "scheduler": "0.26.0-canary-cbbe8666-20250213" + "react": "19.1.0-canary-32b0cad8-20250213", + "react-dom": "19.1.0-canary-32b0cad8-20250213", + "react-is": "19.1.0-canary-32b0cad8-20250213", + "scheduler": "0.26.0-canary-32b0cad8-20250213" }, "patchedDependencies": { "webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch", diff --git a/packages/next/src/build/webpack/plugins/define-env-plugin.ts b/packages/next/src/build/webpack/plugins/define-env-plugin.ts index f89b6ec5aa5517..5d3d13a23ffaa4 100644 --- a/packages/next/src/build/webpack/plugins/define-env-plugin.ts +++ b/packages/next/src/build/webpack/plugins/define-env-plugin.ts @@ -293,8 +293,6 @@ export function getDefineEnv({ : undefined), 'process.env.__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY': config.experimental.newDevOverlay || false, - 'process.env.__NEXT_REACT_OWNER_STACK': - config.experimental.reactOwnerStack ?? false, } const userDefines = config.compiler?.define ?? {} diff --git a/packages/next/src/client/components/errors/stitched-error.ts b/packages/next/src/client/components/errors/stitched-error.ts index 4d91df2ffe15c4..1f78ddf8d5c84b 100644 --- a/packages/next/src/client/components/errors/stitched-error.ts +++ b/packages/next/src/client/components/errors/stitched-error.ts @@ -8,9 +8,6 @@ const REACT_ERROR_STACK_BOTTOM_FRAME_REGEX = new RegExp( ) export function getReactStitchedError(err: T): Error | T { - if (!process.env.__NEXT_REACT_OWNER_STACK) { - return err - } const isErrorInstance = isError(err) const originStack = isErrorInstance ? err.stack || '' : '' const originMessage = isErrorInstance ? err.message : '' diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js index 7d4576385bcd60..712db1943084e6 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js @@ -1461,10 +1461,7 @@ } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; - ReactSharedInternals.getCurrentStack = - null === fiber ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = fiber; + setCurrentFiber(fiber); try { return null !== fiber && fiber._debugTask ? fiber._debugTask.run( @@ -1472,12 +1469,18 @@ ) : callback(arg0, arg1, arg2, arg3, arg4); } finally { - current = previousFiber; + setCurrentFiber(previousFiber); } throw Error( "runWithFiberInDEV should never be called in production. This is a bug in React." ); } + function setCurrentFiber(fiber) { + ReactSharedInternals.getCurrentStack = + null === fiber ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = fiber; + } function getToStringValue(value) { switch (typeof value) { case "bigint": @@ -8744,7 +8747,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -9060,7 +9063,7 @@ (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 134217728); _instance = !0; - } else if (null === current$jscomp$0) { + } else if (null === current) { _instance = workInProgress.stateNode; var unresolvedOldProps = workInProgress.memoizedProps; lane = resolveClassComponentProps(Component, unresolvedOldProps); @@ -9140,7 +9143,7 @@ (_instance = !1)); } else { _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); + cloneUpdateQueue(current, workInProgress); state = workInProgress.memoizedProps; foundWillUpdateName = resolveClassComponentProps(Component, state); _instance.props = foundWillUpdateName; @@ -9173,9 +9176,9 @@ state !== newApiName || oldState !== newState || hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps( workInProgress, @@ -9195,9 +9198,9 @@ newState, lane ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (oldContext || ("function" !== typeof _instance.UNSAFE_componentWillUpdate && "function" !== typeof _instance.componentWillUpdate) || @@ -9214,12 +9217,12 @@ "function" === typeof _instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), @@ -9228,24 +9231,21 @@ (_instance.context = lane), (_instance = foundWillUpdateName)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (_instance = !1)); } lane = _instance; - markRef(current$jscomp$0, workInProgress); + markRef(current, workInProgress); state = 0 !== (workInProgress.flags & 128); if (lane || state) { lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; + setCurrentFiber(workInProgress); if (state && "function" !== typeof Component.getDerivedStateFromError) (Component = null), (profilerStartTime = -1); else if ( @@ -9260,10 +9260,10 @@ } } workInProgress.flags |= 1; - null !== current$jscomp$0 && state + null !== current && state ? ((workInProgress.child = reconcileChildFibers( workInProgress, - current$jscomp$0.child, + current.child, null, renderLanes )), @@ -9273,17 +9273,12 @@ Component, renderLanes ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); + : reconcileChildren(current, workInProgress, Component, renderLanes); workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; + current = workInProgress.child; } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, + current = bailoutOnAlreadyFinishedWork( + current, workInProgress, renderLanes ); @@ -9296,7 +9291,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -9348,33 +9343,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2582; - var JSCompiler_object_inline_stack_2581 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2578; + var JSCompiler_object_inline_stack_2577 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2579 = !1; + var JSCompiler_object_inline_message_2575 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2582 = didSuspend) || - (JSCompiler_object_inline_componentStack_2582 = + (JSCompiler_object_inline_componentStack_2578 = didSuspend) || + (JSCompiler_object_inline_componentStack_2578 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2582 && - ((JSCompiler_object_inline_message_2579 = !0), + JSCompiler_object_inline_componentStack_2578 && + ((JSCompiler_object_inline_message_2575 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2582 = + JSCompiler_object_inline_componentStack_2578 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2579 + JSCompiler_object_inline_message_2575 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2580 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2576 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2580)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2576)) { c: { - var instance = JSCompiler_object_inline_digest_2580; + var instance = JSCompiler_object_inline_digest_2576; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -9416,87 +9411,87 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2580 + JSCompiler_object_inline_digest_2576 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2580 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2576 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2580 && - ((JSCompiler_object_inline_digest_2580 = - JSCompiler_object_inline_digest_2580.dehydrated), - null !== JSCompiler_object_inline_digest_2580) + null !== JSCompiler_object_inline_digest_2576 && + ((JSCompiler_object_inline_digest_2576 = + JSCompiler_object_inline_digest_2576.dehydrated), + null !== JSCompiler_object_inline_digest_2576) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2580) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2576) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2580 = - JSCompiler_object_inline_stack_2581.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2581.fallback; - if (JSCompiler_object_inline_message_2579) + JSCompiler_object_inline_digest_2576 = + JSCompiler_object_inline_stack_2577.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2577.fallback; + if (JSCompiler_object_inline_message_2575) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2581 = + (JSCompiler_object_inline_stack_2577 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2580, + JSCompiler_object_inline_digest_2576, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2579 = workInProgress.child), - (JSCompiler_object_inline_message_2579.memoizedState = + (JSCompiler_object_inline_message_2575 = workInProgress.child), + (JSCompiler_object_inline_message_2575.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2579.childLanes = + (JSCompiler_object_inline_message_2575.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2578, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2577 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2581.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2577.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2581 = + (JSCompiler_object_inline_stack_2577 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2580, + JSCompiler_object_inline_digest_2576, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2579 = workInProgress.child), - (JSCompiler_object_inline_message_2579.memoizedState = + (JSCompiler_object_inline_message_2575 = workInProgress.child), + (JSCompiler_object_inline_message_2575.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2579.childLanes = + (JSCompiler_object_inline_message_2575.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2578, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2577 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2580 + JSCompiler_object_inline_digest_2576 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2580 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2580) + ((JSCompiler_object_inline_digest_2576 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2576) ) { if (didSuspend) workInProgress.flags & 256 @@ -9513,94 +9508,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2579 = - JSCompiler_object_inline_stack_2581.fallback), - (JSCompiler_object_inline_digest_2580 = workInProgress.mode), - (JSCompiler_object_inline_stack_2581 = + (JSCompiler_object_inline_message_2575 = + JSCompiler_object_inline_stack_2577.fallback), + (JSCompiler_object_inline_digest_2576 = workInProgress.mode), + (JSCompiler_object_inline_stack_2577 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2581.children + children: JSCompiler_object_inline_stack_2577.children }, - JSCompiler_object_inline_digest_2580 + JSCompiler_object_inline_digest_2576 )), - (JSCompiler_object_inline_message_2579 = + (JSCompiler_object_inline_message_2575 = createFiberFromFragment( - JSCompiler_object_inline_message_2579, - JSCompiler_object_inline_digest_2580, + JSCompiler_object_inline_message_2575, + JSCompiler_object_inline_digest_2576, renderLanes, null )), - (JSCompiler_object_inline_message_2579.flags |= 2), - (JSCompiler_object_inline_stack_2581.return = workInProgress), - (JSCompiler_object_inline_message_2579.return = workInProgress), - (JSCompiler_object_inline_stack_2581.sibling = - JSCompiler_object_inline_message_2579), - (workInProgress.child = JSCompiler_object_inline_stack_2581), + (JSCompiler_object_inline_message_2575.flags |= 2), + (JSCompiler_object_inline_stack_2577.return = workInProgress), + (JSCompiler_object_inline_message_2575.return = workInProgress), + (JSCompiler_object_inline_stack_2577.sibling = + JSCompiler_object_inline_message_2575), + (workInProgress.child = JSCompiler_object_inline_stack_2577), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2581 = workInProgress.child), - (JSCompiler_object_inline_stack_2581.memoizedState = + (JSCompiler_object_inline_stack_2577 = workInProgress.child), + (JSCompiler_object_inline_stack_2577.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2581.childLanes = + (JSCompiler_object_inline_stack_2577.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2578, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2579)); + (workInProgress = JSCompiler_object_inline_message_2575)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2580)) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2576)) ) { - JSCompiler_object_inline_componentStack_2582 = - JSCompiler_object_inline_digest_2580.nextSibling && - JSCompiler_object_inline_digest_2580.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2582) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2582.dgst; - var message = JSCompiler_object_inline_componentStack_2582.msg; - instance = JSCompiler_object_inline_componentStack_2582.stck; + JSCompiler_object_inline_componentStack_2578 = + JSCompiler_object_inline_digest_2576.nextSibling && + JSCompiler_object_inline_digest_2576.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2578) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2578.dgst; + var message = JSCompiler_object_inline_componentStack_2578.msg; + instance = JSCompiler_object_inline_componentStack_2578.stck; var componentStack = - JSCompiler_object_inline_componentStack_2582.cstck; + JSCompiler_object_inline_componentStack_2578.cstck; } - JSCompiler_object_inline_message_2579 = message; - JSCompiler_object_inline_digest_2580 = JSCompiler_temp; - JSCompiler_object_inline_stack_2581 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2582 = + JSCompiler_object_inline_message_2575 = message; + JSCompiler_object_inline_digest_2576 = JSCompiler_temp; + JSCompiler_object_inline_stack_2577 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2578 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2580 && - ((JSCompiler_object_inline_componentStack_2582 = - JSCompiler_object_inline_message_2579 - ? Error(JSCompiler_object_inline_message_2579) + "POSTPONE" !== JSCompiler_object_inline_digest_2576 && + ((JSCompiler_object_inline_componentStack_2578 = + JSCompiler_object_inline_message_2575 + ? Error(JSCompiler_object_inline_message_2575) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_componentStack_2582.stack = - JSCompiler_object_inline_stack_2581 || ""), - (JSCompiler_object_inline_componentStack_2582.digest = - JSCompiler_object_inline_digest_2580), - (JSCompiler_object_inline_stack_2581 = + (JSCompiler_object_inline_componentStack_2578.stack = + JSCompiler_object_inline_stack_2577 || ""), + (JSCompiler_object_inline_componentStack_2578.digest = + JSCompiler_object_inline_digest_2576), + (JSCompiler_object_inline_stack_2577 = void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2579 = { - value: JSCompiler_object_inline_componentStack_2582, + (JSCompiler_object_inline_message_2575 = { + value: JSCompiler_object_inline_componentStack_2578, source: null, - stack: JSCompiler_object_inline_stack_2581 + stack: JSCompiler_object_inline_stack_2577 }), - "string" === typeof JSCompiler_object_inline_stack_2581 && + "string" === typeof JSCompiler_object_inline_stack_2577 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2582, - JSCompiler_object_inline_message_2579 + JSCompiler_object_inline_componentStack_2578, + JSCompiler_object_inline_message_2575 ), - queueHydrationError(JSCompiler_object_inline_message_2579)); + queueHydrationError(JSCompiler_object_inline_message_2575)); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9614,44 +9609,44 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2582 = + (JSCompiler_object_inline_componentStack_2578 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2582) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2578) ) { - JSCompiler_object_inline_componentStack_2582 = workInProgressRoot; + JSCompiler_object_inline_componentStack_2578 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_componentStack_2582 && - ((JSCompiler_object_inline_stack_2581 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2581 = - 0 !== (JSCompiler_object_inline_stack_2581 & 42) + null !== JSCompiler_object_inline_componentStack_2578 && + ((JSCompiler_object_inline_stack_2577 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2577 = + 0 !== (JSCompiler_object_inline_stack_2577 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2577 )), - (JSCompiler_object_inline_stack_2581 = + (JSCompiler_object_inline_stack_2577 = 0 !== - (JSCompiler_object_inline_stack_2581 & - (JSCompiler_object_inline_componentStack_2582.suspendedLanes | + (JSCompiler_object_inline_stack_2577 & + (JSCompiler_object_inline_componentStack_2578.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2581), - 0 !== JSCompiler_object_inline_stack_2581 && - JSCompiler_object_inline_stack_2581 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2577), + 0 !== JSCompiler_object_inline_stack_2577 && + JSCompiler_object_inline_stack_2577 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2581), + ((prevState.retryLane = JSCompiler_object_inline_stack_2577), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2577 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2578, current, - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2577 ), SelectiveHydrationException) ); - JSCompiler_object_inline_digest_2580.data === + JSCompiler_object_inline_digest_2576.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9659,14 +9654,14 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2580.data === + JSCompiler_object_inline_digest_2576.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2580.nextSibling + JSCompiler_object_inline_digest_2576.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9684,54 +9679,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2581.children + JSCompiler_object_inline_stack_2577.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2579) + if (JSCompiler_object_inline_message_2575) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2579 = - JSCompiler_object_inline_stack_2581.fallback), - (JSCompiler_object_inline_digest_2580 = workInProgress.mode), + (JSCompiler_object_inline_message_2575 = + JSCompiler_object_inline_stack_2577.fallback), + (JSCompiler_object_inline_digest_2576 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2581 = createWorkInProgress( + (JSCompiler_object_inline_stack_2577 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2581.children + children: JSCompiler_object_inline_stack_2577.children } )), - (JSCompiler_object_inline_stack_2581.subtreeFlags = + (JSCompiler_object_inline_stack_2577.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_message_2579 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2575 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2579 + JSCompiler_object_inline_message_2575 )) - : ((JSCompiler_object_inline_message_2579 = createFiberFromFragment( - JSCompiler_object_inline_message_2579, - JSCompiler_object_inline_digest_2580, + : ((JSCompiler_object_inline_message_2575 = createFiberFromFragment( + JSCompiler_object_inline_message_2575, + JSCompiler_object_inline_digest_2576, renderLanes, null )), - (JSCompiler_object_inline_message_2579.flags |= 2)), - (JSCompiler_object_inline_message_2579.return = workInProgress), - (JSCompiler_object_inline_stack_2581.return = workInProgress), - (JSCompiler_object_inline_stack_2581.sibling = - JSCompiler_object_inline_message_2579), - (workInProgress.child = JSCompiler_object_inline_stack_2581), - (JSCompiler_object_inline_stack_2581 = - JSCompiler_object_inline_message_2579), - (JSCompiler_object_inline_message_2579 = workInProgress.child), - (JSCompiler_object_inline_digest_2580 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2580 - ? (JSCompiler_object_inline_digest_2580 = + (JSCompiler_object_inline_message_2575.flags |= 2)), + (JSCompiler_object_inline_message_2575.return = workInProgress), + (JSCompiler_object_inline_stack_2577.return = workInProgress), + (JSCompiler_object_inline_stack_2577.sibling = + JSCompiler_object_inline_message_2575), + (workInProgress.child = JSCompiler_object_inline_stack_2577), + (JSCompiler_object_inline_stack_2577 = + JSCompiler_object_inline_message_2575), + (JSCompiler_object_inline_message_2575 = workInProgress.child), + (JSCompiler_object_inline_digest_2576 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2576 + ? (JSCompiler_object_inline_digest_2576 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2580.cachePool), + JSCompiler_object_inline_digest_2576.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9739,38 +9734,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2580 = { + (JSCompiler_object_inline_digest_2576 = { baseLanes: - JSCompiler_object_inline_digest_2580.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2576.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2579.memoizedState = - JSCompiler_object_inline_digest_2580), - (JSCompiler_object_inline_message_2579.childLanes = + (JSCompiler_object_inline_message_2575.memoizedState = + JSCompiler_object_inline_digest_2576), + (JSCompiler_object_inline_message_2575.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2578, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2577 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2581.children + children: JSCompiler_object_inline_stack_2577.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2582 = + ((JSCompiler_object_inline_componentStack_2578 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2582 + null === JSCompiler_object_inline_componentStack_2578 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2582.push(current)); + : JSCompiler_object_inline_componentStack_2578.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -26887,11 +26882,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26928,10 +26923,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-32b0cad8-20250213" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27073,7 +27068,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js index f37c6a7fdc773a..4552274dae29ae 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js @@ -16435,14 +16435,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1824 = React.version; if ( - "19.1.0-experimental-cbbe8666-20250213" !== + "19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion$jscomp$inline_1824 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1824, - "19.1.0-experimental-cbbe8666-20250213" + "19.1.0-experimental-32b0cad8-20250213" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16464,10 +16464,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2359 = { bundleType: 0, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-32b0cad8-20250213" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2360 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16571,4 +16571,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js index 2c8a745a404c18..3134e36dcf3af2 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js @@ -1469,10 +1469,7 @@ } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; - ReactSharedInternals.getCurrentStack = - null === fiber ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = fiber; + setCurrentFiber(fiber); try { return null !== fiber && fiber._debugTask ? fiber._debugTask.run( @@ -1480,12 +1477,18 @@ ) : callback(arg0, arg1, arg2, arg3, arg4); } finally { - current = previousFiber; + setCurrentFiber(previousFiber); } throw Error( "runWithFiberInDEV should never be called in production. This is a bug in React." ); } + function setCurrentFiber(fiber) { + ReactSharedInternals.getCurrentStack = + null === fiber ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = fiber; + } function getToStringValue(value) { switch (typeof value) { case "bigint": @@ -8752,7 +8755,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -9068,7 +9071,7 @@ (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 134217728); _instance = !0; - } else if (null === current$jscomp$0) { + } else if (null === current) { _instance = workInProgress.stateNode; var unresolvedOldProps = workInProgress.memoizedProps; lane = resolveClassComponentProps(Component, unresolvedOldProps); @@ -9148,7 +9151,7 @@ (_instance = !1)); } else { _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); + cloneUpdateQueue(current, workInProgress); state = workInProgress.memoizedProps; foundWillUpdateName = resolveClassComponentProps(Component, state); _instance.props = foundWillUpdateName; @@ -9181,9 +9184,9 @@ state !== newApiName || oldState !== newState || hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps( workInProgress, @@ -9203,9 +9206,9 @@ newState, lane ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (oldContext || ("function" !== typeof _instance.UNSAFE_componentWillUpdate && "function" !== typeof _instance.componentWillUpdate) || @@ -9222,12 +9225,12 @@ "function" === typeof _instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), @@ -9236,24 +9239,21 @@ (_instance.context = lane), (_instance = foundWillUpdateName)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (_instance = !1)); } lane = _instance; - markRef(current$jscomp$0, workInProgress); + markRef(current, workInProgress); state = 0 !== (workInProgress.flags & 128); if (lane || state) { lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; + setCurrentFiber(workInProgress); if (state && "function" !== typeof Component.getDerivedStateFromError) (Component = null), (profilerStartTime = -1); else if ( @@ -9268,10 +9268,10 @@ } } workInProgress.flags |= 1; - null !== current$jscomp$0 && state + null !== current && state ? ((workInProgress.child = reconcileChildFibers( workInProgress, - current$jscomp$0.child, + current.child, null, renderLanes )), @@ -9281,17 +9281,12 @@ Component, renderLanes ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); + : reconcileChildren(current, workInProgress, Component, renderLanes); workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; + current = workInProgress.child; } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, + current = bailoutOnAlreadyFinishedWork( + current, workInProgress, renderLanes ); @@ -9304,7 +9299,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -9356,33 +9351,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2587; - var JSCompiler_object_inline_stack_2586 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2583; + var JSCompiler_object_inline_stack_2582 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2584 = !1; + var JSCompiler_object_inline_message_2580 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2587 = didSuspend) || - (JSCompiler_object_inline_componentStack_2587 = + (JSCompiler_object_inline_componentStack_2583 = didSuspend) || + (JSCompiler_object_inline_componentStack_2583 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2587 && - ((JSCompiler_object_inline_message_2584 = !0), + JSCompiler_object_inline_componentStack_2583 && + ((JSCompiler_object_inline_message_2580 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2587 = + JSCompiler_object_inline_componentStack_2583 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2584 + JSCompiler_object_inline_message_2580 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2585 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2581 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2585)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2581)) { c: { - var instance = JSCompiler_object_inline_digest_2585; + var instance = JSCompiler_object_inline_digest_2581; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -9424,87 +9419,87 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2585 + JSCompiler_object_inline_digest_2581 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2585 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2581 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2585 && - ((JSCompiler_object_inline_digest_2585 = - JSCompiler_object_inline_digest_2585.dehydrated), - null !== JSCompiler_object_inline_digest_2585) + null !== JSCompiler_object_inline_digest_2581 && + ((JSCompiler_object_inline_digest_2581 = + JSCompiler_object_inline_digest_2581.dehydrated), + null !== JSCompiler_object_inline_digest_2581) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2585) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2581) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2585 = - JSCompiler_object_inline_stack_2586.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2586.fallback; - if (JSCompiler_object_inline_message_2584) + JSCompiler_object_inline_digest_2581 = + JSCompiler_object_inline_stack_2582.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2582.fallback; + if (JSCompiler_object_inline_message_2580) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2586 = + (JSCompiler_object_inline_stack_2582 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2585, + JSCompiler_object_inline_digest_2581, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2584 = workInProgress.child), - (JSCompiler_object_inline_message_2584.memoizedState = + (JSCompiler_object_inline_message_2580 = workInProgress.child), + (JSCompiler_object_inline_message_2580.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2584.childLanes = + (JSCompiler_object_inline_message_2580.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2583, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2582 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2586.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2582.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2586 = + (JSCompiler_object_inline_stack_2582 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2585, + JSCompiler_object_inline_digest_2581, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2584 = workInProgress.child), - (JSCompiler_object_inline_message_2584.memoizedState = + (JSCompiler_object_inline_message_2580 = workInProgress.child), + (JSCompiler_object_inline_message_2580.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2584.childLanes = + (JSCompiler_object_inline_message_2580.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2583, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2582 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2585 + JSCompiler_object_inline_digest_2581 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2585 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2585) + ((JSCompiler_object_inline_digest_2581 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2581) ) { if (didSuspend) workInProgress.flags & 256 @@ -9521,94 +9516,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2584 = - JSCompiler_object_inline_stack_2586.fallback), - (JSCompiler_object_inline_digest_2585 = workInProgress.mode), - (JSCompiler_object_inline_stack_2586 = + (JSCompiler_object_inline_message_2580 = + JSCompiler_object_inline_stack_2582.fallback), + (JSCompiler_object_inline_digest_2581 = workInProgress.mode), + (JSCompiler_object_inline_stack_2582 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2586.children + children: JSCompiler_object_inline_stack_2582.children }, - JSCompiler_object_inline_digest_2585 + JSCompiler_object_inline_digest_2581 )), - (JSCompiler_object_inline_message_2584 = + (JSCompiler_object_inline_message_2580 = createFiberFromFragment( - JSCompiler_object_inline_message_2584, - JSCompiler_object_inline_digest_2585, + JSCompiler_object_inline_message_2580, + JSCompiler_object_inline_digest_2581, renderLanes, null )), - (JSCompiler_object_inline_message_2584.flags |= 2), - (JSCompiler_object_inline_stack_2586.return = workInProgress), - (JSCompiler_object_inline_message_2584.return = workInProgress), - (JSCompiler_object_inline_stack_2586.sibling = - JSCompiler_object_inline_message_2584), - (workInProgress.child = JSCompiler_object_inline_stack_2586), + (JSCompiler_object_inline_message_2580.flags |= 2), + (JSCompiler_object_inline_stack_2582.return = workInProgress), + (JSCompiler_object_inline_message_2580.return = workInProgress), + (JSCompiler_object_inline_stack_2582.sibling = + JSCompiler_object_inline_message_2580), + (workInProgress.child = JSCompiler_object_inline_stack_2582), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2586 = workInProgress.child), - (JSCompiler_object_inline_stack_2586.memoizedState = + (JSCompiler_object_inline_stack_2582 = workInProgress.child), + (JSCompiler_object_inline_stack_2582.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2586.childLanes = + (JSCompiler_object_inline_stack_2582.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2583, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2584)); + (workInProgress = JSCompiler_object_inline_message_2580)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2585)) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2581)) ) { - JSCompiler_object_inline_componentStack_2587 = - JSCompiler_object_inline_digest_2585.nextSibling && - JSCompiler_object_inline_digest_2585.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2587) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2587.dgst; - var message = JSCompiler_object_inline_componentStack_2587.msg; - instance = JSCompiler_object_inline_componentStack_2587.stck; + JSCompiler_object_inline_componentStack_2583 = + JSCompiler_object_inline_digest_2581.nextSibling && + JSCompiler_object_inline_digest_2581.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2583) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2583.dgst; + var message = JSCompiler_object_inline_componentStack_2583.msg; + instance = JSCompiler_object_inline_componentStack_2583.stck; var componentStack = - JSCompiler_object_inline_componentStack_2587.cstck; + JSCompiler_object_inline_componentStack_2583.cstck; } - JSCompiler_object_inline_message_2584 = message; - JSCompiler_object_inline_digest_2585 = JSCompiler_temp; - JSCompiler_object_inline_stack_2586 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2587 = + JSCompiler_object_inline_message_2580 = message; + JSCompiler_object_inline_digest_2581 = JSCompiler_temp; + JSCompiler_object_inline_stack_2582 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2583 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2585 && - ((JSCompiler_object_inline_componentStack_2587 = - JSCompiler_object_inline_message_2584 - ? Error(JSCompiler_object_inline_message_2584) + "POSTPONE" !== JSCompiler_object_inline_digest_2581 && + ((JSCompiler_object_inline_componentStack_2583 = + JSCompiler_object_inline_message_2580 + ? Error(JSCompiler_object_inline_message_2580) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_componentStack_2587.stack = - JSCompiler_object_inline_stack_2586 || ""), - (JSCompiler_object_inline_componentStack_2587.digest = - JSCompiler_object_inline_digest_2585), - (JSCompiler_object_inline_stack_2586 = + (JSCompiler_object_inline_componentStack_2583.stack = + JSCompiler_object_inline_stack_2582 || ""), + (JSCompiler_object_inline_componentStack_2583.digest = + JSCompiler_object_inline_digest_2581), + (JSCompiler_object_inline_stack_2582 = void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2584 = { - value: JSCompiler_object_inline_componentStack_2587, + (JSCompiler_object_inline_message_2580 = { + value: JSCompiler_object_inline_componentStack_2583, source: null, - stack: JSCompiler_object_inline_stack_2586 + stack: JSCompiler_object_inline_stack_2582 }), - "string" === typeof JSCompiler_object_inline_stack_2586 && + "string" === typeof JSCompiler_object_inline_stack_2582 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2587, - JSCompiler_object_inline_message_2584 + JSCompiler_object_inline_componentStack_2583, + JSCompiler_object_inline_message_2580 ), - queueHydrationError(JSCompiler_object_inline_message_2584)); + queueHydrationError(JSCompiler_object_inline_message_2580)); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9622,44 +9617,44 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2587 = + (JSCompiler_object_inline_componentStack_2583 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2587) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2583) ) { - JSCompiler_object_inline_componentStack_2587 = workInProgressRoot; + JSCompiler_object_inline_componentStack_2583 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_componentStack_2587 && - ((JSCompiler_object_inline_stack_2586 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2586 = - 0 !== (JSCompiler_object_inline_stack_2586 & 42) + null !== JSCompiler_object_inline_componentStack_2583 && + ((JSCompiler_object_inline_stack_2582 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2582 = + 0 !== (JSCompiler_object_inline_stack_2582 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2582 )), - (JSCompiler_object_inline_stack_2586 = + (JSCompiler_object_inline_stack_2582 = 0 !== - (JSCompiler_object_inline_stack_2586 & - (JSCompiler_object_inline_componentStack_2587.suspendedLanes | + (JSCompiler_object_inline_stack_2582 & + (JSCompiler_object_inline_componentStack_2583.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2586), - 0 !== JSCompiler_object_inline_stack_2586 && - JSCompiler_object_inline_stack_2586 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2582), + 0 !== JSCompiler_object_inline_stack_2582 && + JSCompiler_object_inline_stack_2582 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2586), + ((prevState.retryLane = JSCompiler_object_inline_stack_2582), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2582 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2583, current, - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2582 ), SelectiveHydrationException) ); - JSCompiler_object_inline_digest_2585.data === + JSCompiler_object_inline_digest_2581.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9667,14 +9662,14 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2585.data === + JSCompiler_object_inline_digest_2581.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2585.nextSibling + JSCompiler_object_inline_digest_2581.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9692,54 +9687,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2586.children + JSCompiler_object_inline_stack_2582.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2584) + if (JSCompiler_object_inline_message_2580) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2584 = - JSCompiler_object_inline_stack_2586.fallback), - (JSCompiler_object_inline_digest_2585 = workInProgress.mode), + (JSCompiler_object_inline_message_2580 = + JSCompiler_object_inline_stack_2582.fallback), + (JSCompiler_object_inline_digest_2581 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2586 = createWorkInProgress( + (JSCompiler_object_inline_stack_2582 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2586.children + children: JSCompiler_object_inline_stack_2582.children } )), - (JSCompiler_object_inline_stack_2586.subtreeFlags = + (JSCompiler_object_inline_stack_2582.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_message_2584 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2580 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2584 + JSCompiler_object_inline_message_2580 )) - : ((JSCompiler_object_inline_message_2584 = createFiberFromFragment( - JSCompiler_object_inline_message_2584, - JSCompiler_object_inline_digest_2585, + : ((JSCompiler_object_inline_message_2580 = createFiberFromFragment( + JSCompiler_object_inline_message_2580, + JSCompiler_object_inline_digest_2581, renderLanes, null )), - (JSCompiler_object_inline_message_2584.flags |= 2)), - (JSCompiler_object_inline_message_2584.return = workInProgress), - (JSCompiler_object_inline_stack_2586.return = workInProgress), - (JSCompiler_object_inline_stack_2586.sibling = - JSCompiler_object_inline_message_2584), - (workInProgress.child = JSCompiler_object_inline_stack_2586), - (JSCompiler_object_inline_stack_2586 = - JSCompiler_object_inline_message_2584), - (JSCompiler_object_inline_message_2584 = workInProgress.child), - (JSCompiler_object_inline_digest_2585 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2585 - ? (JSCompiler_object_inline_digest_2585 = + (JSCompiler_object_inline_message_2580.flags |= 2)), + (JSCompiler_object_inline_message_2580.return = workInProgress), + (JSCompiler_object_inline_stack_2582.return = workInProgress), + (JSCompiler_object_inline_stack_2582.sibling = + JSCompiler_object_inline_message_2580), + (workInProgress.child = JSCompiler_object_inline_stack_2582), + (JSCompiler_object_inline_stack_2582 = + JSCompiler_object_inline_message_2580), + (JSCompiler_object_inline_message_2580 = workInProgress.child), + (JSCompiler_object_inline_digest_2581 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2581 + ? (JSCompiler_object_inline_digest_2581 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2585.cachePool), + JSCompiler_object_inline_digest_2581.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9747,38 +9742,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2585 = { + (JSCompiler_object_inline_digest_2581 = { baseLanes: - JSCompiler_object_inline_digest_2585.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2581.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2584.memoizedState = - JSCompiler_object_inline_digest_2585), - (JSCompiler_object_inline_message_2584.childLanes = + (JSCompiler_object_inline_message_2580.memoizedState = + JSCompiler_object_inline_digest_2581), + (JSCompiler_object_inline_message_2580.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2583, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2582 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2586.children + children: JSCompiler_object_inline_stack_2582.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2587 = + ((JSCompiler_object_inline_componentStack_2583 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2587 + null === JSCompiler_object_inline_componentStack_2583 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2587.push(current)); + : JSCompiler_object_inline_componentStack_2583.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -26940,11 +26935,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26981,10 +26976,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-32b0cad8-20250213" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27456,7 +27451,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js index 2eeacd5c4bb105..cf4f6cdc66398d 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js @@ -17863,14 +17863,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1972 = React.version; if ( - "19.1.0-experimental-cbbe8666-20250213" !== + "19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion$jscomp$inline_1972 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1972, - "19.1.0-experimental-cbbe8666-20250213" + "19.1.0-experimental-32b0cad8-20250213" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -17892,10 +17892,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2500 = { bundleType: 0, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-32b0cad8-20250213" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2501 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -18160,7 +18160,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js index 6ccee63133cdbc..edac9a46117c2e 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js @@ -9591,5 +9591,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js index dd9f66a5cb28ec..293d8766b82a49 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js @@ -6342,4 +6342,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js index 78e34684847a0c..a722735d74274d 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js @@ -9591,5 +9591,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js index adcc7e7c8d2ef0..7b9457f2ce636b 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js @@ -6436,4 +6436,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js index 1b5a3c8f7b4e9c..69c6951b09293d 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js @@ -8499,11 +8499,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -10285,5 +10285,5 @@ startWork(request); }); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js index 8d5418873055b5..7b88a55265410c 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js @@ -6883,12 +6883,12 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion, - "19.1.0-experimental-cbbe8666-20250213" + "19.1.0-experimental-32b0cad8-20250213" ) ); } @@ -7143,4 +7143,4 @@ exports.resumeAndPrerender = function (children, postponedState, options) { startWork(request); }); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js index 96f837a2858de7..cadbe3e3d2c2a1 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js @@ -6361,13 +6361,13 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) { } var isomorphicReactPackageVersion$jscomp$inline_810 = React.version; if ( - "19.1.0-experimental-cbbe8666-20250213" !== + "19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion$jscomp$inline_810 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_810 + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -6458,4 +6458,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js index 714aabe591ae1a..ab660f6165944e 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js @@ -8522,11 +8522,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -10315,5 +10315,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js index d90ff6e65cd000..c3fd2b481fbc39 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js @@ -6992,11 +6992,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -7261,4 +7261,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js index f5fd1ba2461a9f..3b42fba5c99292 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js @@ -8386,11 +8386,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } function createDrainHandler(destination, request) { @@ -10165,5 +10165,5 @@ } }; }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js index 69cd0d8dd0e9bd..be662a13939d96 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js @@ -6871,11 +6871,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -7126,4 +7126,4 @@ exports.resumeToPipeableStream = function (children, postponedState, options) { } }; }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js index 8ff4e2feb62024..11d70b044a7be0 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js @@ -1502,10 +1502,7 @@ } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; - ReactSharedInternals.getCurrentStack = - null === fiber ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = fiber; + setCurrentFiber(fiber); try { return null !== fiber && fiber._debugTask ? fiber._debugTask.run( @@ -1513,12 +1510,18 @@ ) : callback(arg0, arg1, arg2, arg3, arg4); } finally { - current = previousFiber; + setCurrentFiber(previousFiber); } throw Error( "runWithFiberInDEV should never be called in production. This is a bug in React." ); } + function setCurrentFiber(fiber) { + ReactSharedInternals.getCurrentStack = + null === fiber ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = fiber; + } function getToStringValue(value) { switch (typeof value) { case "bigint": @@ -8785,7 +8788,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -9101,7 +9104,7 @@ (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 134217728); _instance = !0; - } else if (null === current$jscomp$0) { + } else if (null === current) { _instance = workInProgress.stateNode; var unresolvedOldProps = workInProgress.memoizedProps; lane = resolveClassComponentProps(Component, unresolvedOldProps); @@ -9181,7 +9184,7 @@ (_instance = !1)); } else { _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); + cloneUpdateQueue(current, workInProgress); state = workInProgress.memoizedProps; foundWillUpdateName = resolveClassComponentProps(Component, state); _instance.props = foundWillUpdateName; @@ -9214,9 +9217,9 @@ state !== newApiName || oldState !== newState || hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps( workInProgress, @@ -9236,9 +9239,9 @@ newState, lane ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (oldContext || ("function" !== typeof _instance.UNSAFE_componentWillUpdate && "function" !== typeof _instance.componentWillUpdate) || @@ -9255,12 +9258,12 @@ "function" === typeof _instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), @@ -9269,24 +9272,21 @@ (_instance.context = lane), (_instance = foundWillUpdateName)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (_instance = !1)); } lane = _instance; - markRef(current$jscomp$0, workInProgress); + markRef(current, workInProgress); state = 0 !== (workInProgress.flags & 128); if (lane || state) { lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; + setCurrentFiber(workInProgress); if (state && "function" !== typeof Component.getDerivedStateFromError) (Component = null), (profilerStartTime = -1); else if ( @@ -9301,10 +9301,10 @@ } } workInProgress.flags |= 1; - null !== current$jscomp$0 && state + null !== current && state ? ((workInProgress.child = reconcileChildFibers( workInProgress, - current$jscomp$0.child, + current.child, null, renderLanes )), @@ -9314,17 +9314,12 @@ Component, renderLanes ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); + : reconcileChildren(current, workInProgress, Component, renderLanes); workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; + current = workInProgress.child; } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, + current = bailoutOnAlreadyFinishedWork( + current, workInProgress, renderLanes ); @@ -9337,7 +9332,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -9389,33 +9384,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2616; - var JSCompiler_object_inline_stack_2615 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2612; + var JSCompiler_object_inline_stack_2611 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2613 = !1; + var JSCompiler_object_inline_message_2609 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2616 = didSuspend) || - (JSCompiler_object_inline_componentStack_2616 = + (JSCompiler_object_inline_componentStack_2612 = didSuspend) || + (JSCompiler_object_inline_componentStack_2612 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2616 && - ((JSCompiler_object_inline_message_2613 = !0), + JSCompiler_object_inline_componentStack_2612 && + ((JSCompiler_object_inline_message_2609 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2616 = + JSCompiler_object_inline_componentStack_2612 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2613 + JSCompiler_object_inline_message_2609 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2614 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2610 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2614)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2610)) { c: { - var instance = JSCompiler_object_inline_digest_2614; + var instance = JSCompiler_object_inline_digest_2610; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -9457,87 +9452,87 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2614 + JSCompiler_object_inline_digest_2610 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2614 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2610 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2614 && - ((JSCompiler_object_inline_digest_2614 = - JSCompiler_object_inline_digest_2614.dehydrated), - null !== JSCompiler_object_inline_digest_2614) + null !== JSCompiler_object_inline_digest_2610 && + ((JSCompiler_object_inline_digest_2610 = + JSCompiler_object_inline_digest_2610.dehydrated), + null !== JSCompiler_object_inline_digest_2610) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2614) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2610) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2614 = - JSCompiler_object_inline_stack_2615.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2615.fallback; - if (JSCompiler_object_inline_message_2613) + JSCompiler_object_inline_digest_2610 = + JSCompiler_object_inline_stack_2611.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2611.fallback; + if (JSCompiler_object_inline_message_2609) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2615 = + (JSCompiler_object_inline_stack_2611 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2614, + JSCompiler_object_inline_digest_2610, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2613 = workInProgress.child), - (JSCompiler_object_inline_message_2613.memoizedState = + (JSCompiler_object_inline_message_2609 = workInProgress.child), + (JSCompiler_object_inline_message_2609.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2613.childLanes = + (JSCompiler_object_inline_message_2609.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2612, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2611 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2615.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2611.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2615 = + (JSCompiler_object_inline_stack_2611 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2614, + JSCompiler_object_inline_digest_2610, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2613 = workInProgress.child), - (JSCompiler_object_inline_message_2613.memoizedState = + (JSCompiler_object_inline_message_2609 = workInProgress.child), + (JSCompiler_object_inline_message_2609.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2613.childLanes = + (JSCompiler_object_inline_message_2609.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2612, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2611 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2614 + JSCompiler_object_inline_digest_2610 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2614 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2614) + ((JSCompiler_object_inline_digest_2610 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2610) ) { if (didSuspend) workInProgress.flags & 256 @@ -9554,94 +9549,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2613 = - JSCompiler_object_inline_stack_2615.fallback), - (JSCompiler_object_inline_digest_2614 = workInProgress.mode), - (JSCompiler_object_inline_stack_2615 = + (JSCompiler_object_inline_message_2609 = + JSCompiler_object_inline_stack_2611.fallback), + (JSCompiler_object_inline_digest_2610 = workInProgress.mode), + (JSCompiler_object_inline_stack_2611 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2615.children + children: JSCompiler_object_inline_stack_2611.children }, - JSCompiler_object_inline_digest_2614 + JSCompiler_object_inline_digest_2610 )), - (JSCompiler_object_inline_message_2613 = + (JSCompiler_object_inline_message_2609 = createFiberFromFragment( - JSCompiler_object_inline_message_2613, - JSCompiler_object_inline_digest_2614, + JSCompiler_object_inline_message_2609, + JSCompiler_object_inline_digest_2610, renderLanes, null )), - (JSCompiler_object_inline_message_2613.flags |= 2), - (JSCompiler_object_inline_stack_2615.return = workInProgress), - (JSCompiler_object_inline_message_2613.return = workInProgress), - (JSCompiler_object_inline_stack_2615.sibling = - JSCompiler_object_inline_message_2613), - (workInProgress.child = JSCompiler_object_inline_stack_2615), + (JSCompiler_object_inline_message_2609.flags |= 2), + (JSCompiler_object_inline_stack_2611.return = workInProgress), + (JSCompiler_object_inline_message_2609.return = workInProgress), + (JSCompiler_object_inline_stack_2611.sibling = + JSCompiler_object_inline_message_2609), + (workInProgress.child = JSCompiler_object_inline_stack_2611), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2615 = workInProgress.child), - (JSCompiler_object_inline_stack_2615.memoizedState = + (JSCompiler_object_inline_stack_2611 = workInProgress.child), + (JSCompiler_object_inline_stack_2611.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2615.childLanes = + (JSCompiler_object_inline_stack_2611.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2612, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2613)); + (workInProgress = JSCompiler_object_inline_message_2609)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2614)) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2610)) ) { - JSCompiler_object_inline_componentStack_2616 = - JSCompiler_object_inline_digest_2614.nextSibling && - JSCompiler_object_inline_digest_2614.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2616) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2616.dgst; - var message = JSCompiler_object_inline_componentStack_2616.msg; - instance = JSCompiler_object_inline_componentStack_2616.stck; + JSCompiler_object_inline_componentStack_2612 = + JSCompiler_object_inline_digest_2610.nextSibling && + JSCompiler_object_inline_digest_2610.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2612) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2612.dgst; + var message = JSCompiler_object_inline_componentStack_2612.msg; + instance = JSCompiler_object_inline_componentStack_2612.stck; var componentStack = - JSCompiler_object_inline_componentStack_2616.cstck; + JSCompiler_object_inline_componentStack_2612.cstck; } - JSCompiler_object_inline_message_2613 = message; - JSCompiler_object_inline_digest_2614 = JSCompiler_temp; - JSCompiler_object_inline_stack_2615 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2616 = + JSCompiler_object_inline_message_2609 = message; + JSCompiler_object_inline_digest_2610 = JSCompiler_temp; + JSCompiler_object_inline_stack_2611 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2612 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2614 && - ((JSCompiler_object_inline_componentStack_2616 = - JSCompiler_object_inline_message_2613 - ? Error(JSCompiler_object_inline_message_2613) + "POSTPONE" !== JSCompiler_object_inline_digest_2610 && + ((JSCompiler_object_inline_componentStack_2612 = + JSCompiler_object_inline_message_2609 + ? Error(JSCompiler_object_inline_message_2609) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_componentStack_2616.stack = - JSCompiler_object_inline_stack_2615 || ""), - (JSCompiler_object_inline_componentStack_2616.digest = - JSCompiler_object_inline_digest_2614), - (JSCompiler_object_inline_stack_2615 = + (JSCompiler_object_inline_componentStack_2612.stack = + JSCompiler_object_inline_stack_2611 || ""), + (JSCompiler_object_inline_componentStack_2612.digest = + JSCompiler_object_inline_digest_2610), + (JSCompiler_object_inline_stack_2611 = void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2613 = { - value: JSCompiler_object_inline_componentStack_2616, + (JSCompiler_object_inline_message_2609 = { + value: JSCompiler_object_inline_componentStack_2612, source: null, - stack: JSCompiler_object_inline_stack_2615 + stack: JSCompiler_object_inline_stack_2611 }), - "string" === typeof JSCompiler_object_inline_stack_2615 && + "string" === typeof JSCompiler_object_inline_stack_2611 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2616, - JSCompiler_object_inline_message_2613 + JSCompiler_object_inline_componentStack_2612, + JSCompiler_object_inline_message_2609 ), - queueHydrationError(JSCompiler_object_inline_message_2613)); + queueHydrationError(JSCompiler_object_inline_message_2609)); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9655,44 +9650,44 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2616 = + (JSCompiler_object_inline_componentStack_2612 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2616) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2612) ) { - JSCompiler_object_inline_componentStack_2616 = workInProgressRoot; + JSCompiler_object_inline_componentStack_2612 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_componentStack_2616 && - ((JSCompiler_object_inline_stack_2615 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2615 = - 0 !== (JSCompiler_object_inline_stack_2615 & 42) + null !== JSCompiler_object_inline_componentStack_2612 && + ((JSCompiler_object_inline_stack_2611 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2611 = + 0 !== (JSCompiler_object_inline_stack_2611 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2611 )), - (JSCompiler_object_inline_stack_2615 = + (JSCompiler_object_inline_stack_2611 = 0 !== - (JSCompiler_object_inline_stack_2615 & - (JSCompiler_object_inline_componentStack_2616.suspendedLanes | + (JSCompiler_object_inline_stack_2611 & + (JSCompiler_object_inline_componentStack_2612.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2615), - 0 !== JSCompiler_object_inline_stack_2615 && - JSCompiler_object_inline_stack_2615 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2611), + 0 !== JSCompiler_object_inline_stack_2611 && + JSCompiler_object_inline_stack_2611 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2615), + ((prevState.retryLane = JSCompiler_object_inline_stack_2611), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2611 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2612, current, - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2611 ), SelectiveHydrationException) ); - JSCompiler_object_inline_digest_2614.data === + JSCompiler_object_inline_digest_2610.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9700,14 +9695,14 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2614.data === + JSCompiler_object_inline_digest_2610.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2614.nextSibling + JSCompiler_object_inline_digest_2610.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9725,54 +9720,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2615.children + JSCompiler_object_inline_stack_2611.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2613) + if (JSCompiler_object_inline_message_2609) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2613 = - JSCompiler_object_inline_stack_2615.fallback), - (JSCompiler_object_inline_digest_2614 = workInProgress.mode), + (JSCompiler_object_inline_message_2609 = + JSCompiler_object_inline_stack_2611.fallback), + (JSCompiler_object_inline_digest_2610 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2615 = createWorkInProgress( + (JSCompiler_object_inline_stack_2611 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2615.children + children: JSCompiler_object_inline_stack_2611.children } )), - (JSCompiler_object_inline_stack_2615.subtreeFlags = + (JSCompiler_object_inline_stack_2611.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_message_2613 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2609 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2613 + JSCompiler_object_inline_message_2609 )) - : ((JSCompiler_object_inline_message_2613 = createFiberFromFragment( - JSCompiler_object_inline_message_2613, - JSCompiler_object_inline_digest_2614, + : ((JSCompiler_object_inline_message_2609 = createFiberFromFragment( + JSCompiler_object_inline_message_2609, + JSCompiler_object_inline_digest_2610, renderLanes, null )), - (JSCompiler_object_inline_message_2613.flags |= 2)), - (JSCompiler_object_inline_message_2613.return = workInProgress), - (JSCompiler_object_inline_stack_2615.return = workInProgress), - (JSCompiler_object_inline_stack_2615.sibling = - JSCompiler_object_inline_message_2613), - (workInProgress.child = JSCompiler_object_inline_stack_2615), - (JSCompiler_object_inline_stack_2615 = - JSCompiler_object_inline_message_2613), - (JSCompiler_object_inline_message_2613 = workInProgress.child), - (JSCompiler_object_inline_digest_2614 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2614 - ? (JSCompiler_object_inline_digest_2614 = + (JSCompiler_object_inline_message_2609.flags |= 2)), + (JSCompiler_object_inline_message_2609.return = workInProgress), + (JSCompiler_object_inline_stack_2611.return = workInProgress), + (JSCompiler_object_inline_stack_2611.sibling = + JSCompiler_object_inline_message_2609), + (workInProgress.child = JSCompiler_object_inline_stack_2611), + (JSCompiler_object_inline_stack_2611 = + JSCompiler_object_inline_message_2609), + (JSCompiler_object_inline_message_2609 = workInProgress.child), + (JSCompiler_object_inline_digest_2610 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2610 + ? (JSCompiler_object_inline_digest_2610 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2614.cachePool), + JSCompiler_object_inline_digest_2610.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9780,38 +9775,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2614 = { + (JSCompiler_object_inline_digest_2610 = { baseLanes: - JSCompiler_object_inline_digest_2614.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2610.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2613.memoizedState = - JSCompiler_object_inline_digest_2614), - (JSCompiler_object_inline_message_2613.childLanes = + (JSCompiler_object_inline_message_2609.memoizedState = + JSCompiler_object_inline_digest_2610), + (JSCompiler_object_inline_message_2609.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2612, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2611 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2615.children + children: JSCompiler_object_inline_stack_2611.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2616 = + ((JSCompiler_object_inline_componentStack_2612 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2616 + null === JSCompiler_object_inline_componentStack_2612 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2616.push(current)); + : JSCompiler_object_inline_componentStack_2612.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -27221,11 +27216,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-experimental-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27262,10 +27257,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-32b0cad8-20250213" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27573,5 +27568,5 @@ } }; }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js index 830e57bbbaa9ee..a3c360e7ab7924 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js @@ -16764,14 +16764,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1853 = React.version; if ( - "19.1.0-experimental-cbbe8666-20250213" !== + "19.1.0-experimental-32b0cad8-20250213" !== isomorphicReactPackageVersion$jscomp$inline_1853 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1853, - "19.1.0-experimental-cbbe8666-20250213" + "19.1.0-experimental-32b0cad8-20250213" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16793,10 +16793,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2393 = { bundleType: 0, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-32b0cad8-20250213" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2394 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17051,4 +17051,4 @@ exports.observeVisibleRects = function ( } }; }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js index e0c0a366d76e45..f1d74d2e86ae38 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js @@ -416,7 +416,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js index a314de83b3fc22..596d7057b2e210 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js @@ -207,4 +207,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js index e9c3f1e251647d..f7b3760865e1a9 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js @@ -336,5 +336,5 @@ })) : Internals.d.m(href)); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js index c348f1e587ad3a..1de799900b969b 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js @@ -149,4 +149,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom-experimental/package.json b/packages/next/src/compiled/react-dom-experimental/package.json index 91464223eb963b..fd7096d77e967d 100644 --- a/packages/next/src/compiled/react-dom-experimental/package.json +++ b/packages/next/src/compiled/react-dom-experimental/package.json @@ -72,10 +72,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.0.0-experimental-cbbe8666-20250213" + "scheduler": "0.0.0-experimental-32b0cad8-20250213" }, "peerDependencies": { - "react": "0.0.0-experimental-cbbe8666-20250213" + "react": "0.0.0-experimental-32b0cad8-20250213" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js index a239cd51457c65..cc31660e8e523b 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js @@ -1365,6 +1365,27 @@ "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -1413,29 +1434,96 @@ return "\nError generating stack: " + x.message + "\n" + x.stack; } } + function describeFunctionComponentFrameWithoutLineNumber(fn) { + return (fn = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(fn) + : ""; + } function getCurrentFiberOwnerNameInDevOrNull() { if (null === current) return null; var owner = current._debugOwner; return null != owner ? getComponentNameFromOwner(owner) : null; } function getCurrentFiberStackInDev() { - return null === current ? "" : getStackByFiberInDevAndProd(current); + if (null === current) return ""; + var workInProgress = current; + try { + var info = ""; + 6 === workInProgress.tag && (workInProgress = workInProgress.return); + switch (workInProgress.tag) { + case 26: + case 27: + case 5: + info += describeBuiltInComponentFrame(workInProgress.type); + break; + case 13: + info += describeBuiltInComponentFrame("Suspense"); + break; + case 19: + info += describeBuiltInComponentFrame("SuspenseList"); + break; + case 30: + case 0: + case 15: + case 1: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type + )); + break; + case 11: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type.render + )); + } + for (; workInProgress; ) + if ("number" === typeof workInProgress.tag) { + var fiber = workInProgress; + workInProgress = fiber._debugOwner; + var debugStack = fiber._debugStack; + workInProgress && + debugStack && + ("string" !== typeof debugStack && + (fiber._debugStack = debugStack = formatOwnerStack(debugStack)), + "" !== debugStack && (info += "\n" + debugStack)); + } else if (null != workInProgress.debugStack) { + var ownerStack = workInProgress.debugStack; + (workInProgress = workInProgress.owner) && + ownerStack && + (info += "\n" + formatOwnerStack(ownerStack)); + } else break; + var JSCompiler_inline_result = info; + } catch (x) { + JSCompiler_inline_result = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result; } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; - ReactSharedInternals.getCurrentStack = - null === fiber ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = fiber; + setCurrentFiber(fiber); try { - return callback(arg0, arg1, arg2, arg3, arg4); + return null !== fiber && fiber._debugTask + ? fiber._debugTask.run( + callback.bind(null, arg0, arg1, arg2, arg3, arg4) + ) + : callback(arg0, arg1, arg2, arg3, arg4); } finally { - current = previousFiber; + setCurrentFiber(previousFiber); } throw Error( "runWithFiberInDEV should never be called in production. This is a bug in React." ); } + function setCurrentFiber(fiber) { + ReactSharedInternals.getCurrentStack = + null === fiber ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = fiber; + } function getToStringValue(value) { switch (typeof value) { case "bigint": @@ -2488,37 +2576,50 @@ : findInvalidAncestorForTag(childTag, ancestorInfo); ancestorInfo = parentInfo || ancestorInfo; if (!ancestorInfo) return !0; - ancestorInfo = ancestorInfo.tag; - var warnKey = String(!!parentInfo) + "|" + childTag + "|" + ancestorInfo; - if (didWarn[warnKey]) return !1; - didWarn[warnKey] = !0; - var ancestor = (warnKey = current) - ? findAncestor(warnKey.return, ancestorInfo) - : null; - warnKey = - null !== warnKey && null !== ancestor - ? describeAncestors(ancestor, warnKey, null) - : ""; - ancestor = "<" + childTag + ">"; + var ancestorTag = ancestorInfo.tag; + ancestorInfo = String(!!parentInfo) + "|" + childTag + "|" + ancestorTag; + if (didWarn[ancestorInfo]) return !1; + didWarn[ancestorInfo] = !0; + var ancestor = (ancestorInfo = current) + ? findAncestor(ancestorInfo.return, ancestorTag) + : null, + ancestorDescription = + null !== ancestorInfo && null !== ancestor + ? describeAncestors(ancestor, ancestorInfo, null) + : "", + tagDisplayName = "<" + childTag + ">"; parentInfo ? ((parentInfo = ""), - "table" === ancestorInfo && + "table" === ancestorTag && "tr" === childTag && (parentInfo += " Add a , or to your code to match the DOM tree generated by the browser."), console.error( "In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s", - ancestor, - ancestorInfo, + tagDisplayName, + ancestorTag, parentInfo, - warnKey + ancestorDescription )) : console.error( "In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s", - ancestor, - ancestorInfo, - warnKey + tagDisplayName, + ancestorTag, + ancestorDescription ); + ancestorInfo && + ((childTag = ancestorInfo.return), + null === ancestor || + null === childTag || + (ancestor === childTag && + childTag._debugOwner === ancestorInfo._debugOwner) || + runWithFiberInDEV(ancestor, function () { + console.error( + "<%s> cannot contain a nested %s.\nSee this log for the ancestor stack trace.", + ancestorTag, + tagDisplayName + ); + })); return !1; } function validateTextNesting(childText, parentTag, implicitRootScope) { @@ -6631,6 +6732,7 @@ )), (current.return = returnFiber), (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6705,6 +6807,7 @@ )), (current.return = returnFiber), (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6727,6 +6830,7 @@ )), (newChild.return = returnFiber), (newChild._debugOwner = returnFiber), + (newChild._debugTask = returnFiber._debugTask), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -6774,6 +6878,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -7311,6 +7416,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), validateFragmentProps(newChild, lanes, returnFiber), (returnFiber = lanes)) @@ -7477,6 +7583,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), (returnFiber = lanes)), placeSingleChild(returnFiber) @@ -7506,10 +7613,12 @@ fiber.return = returnFiber; var debugInfo = (fiber._debugInfo = currentDebugInfo); fiber._debugOwner = returnFiber._debugOwner; + fiber._debugTask = returnFiber._debugTask; if (null != debugInfo) for (var i = debugInfo.length - 1; 0 <= i; i--) if ("string" === typeof debugInfo[i].stack) { fiber._debugOwner = debugInfo[i]; + fiber._debugTask = debugInfo[i].debugTask; break; } return fiber; @@ -7590,63 +7699,62 @@ } return null; } - function defaultOnUncaughtError(error, errorInfo) { + function defaultOnUncaughtError(error) { reportGlobalError(error); - error = componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components."; - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack, - componentStack = - null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; - try { - console.warn( - "%s\n\n%s\n", - error, - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." - ); - } finally { - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; - } + console.warn( + "%s\n\n%s\n", + componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components.", + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); } - function defaultOnCaughtError(error, errorInfo) { + function defaultOnCaughtError(error) { var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component." : "The above error occurred in one of your React components.", recreateMessage = "React will try to recreate this component tree from scratch using the error boundary you provided, " + - ((errorBoundaryName || "Anonymous") + "."), - prevGetCurrentStack = ReactSharedInternals.getCurrentStack, - componentStack = - null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; - try { + ((errorBoundaryName || "Anonymous") + "."); + if ( "object" === typeof error && null !== error && "string" === typeof error.environmentName - ? bindToConsole( - "error", - [ - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage - ], - error.environmentName - )() - : console.error( - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage + ) { + var JSCompiler_inline_result = error.environmentName; + error = [ + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ].slice(0); + "string" === typeof error[0] + ? error.splice( + 0, + 1, + badgeFormat + error[0], + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ) + : error.splice( + 0, + 0, + badgeFormat, + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle ); - } finally { - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; - } + error.unshift(console); + JSCompiler_inline_result = bind.apply(console.error, error); + JSCompiler_inline_result(); + } else + console.error( + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ); } function defaultOnRecoverableError(error) { reportGlobalError(error); @@ -8265,7 +8373,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -8581,7 +8689,7 @@ (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 134217728); _instance = !0; - } else if (null === current$jscomp$0) { + } else if (null === current) { _instance = workInProgress.stateNode; var unresolvedOldProps = workInProgress.memoizedProps; lane = resolveClassComponentProps(Component, unresolvedOldProps); @@ -8661,7 +8769,7 @@ (_instance = !1)); } else { _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); + cloneUpdateQueue(current, workInProgress); state = workInProgress.memoizedProps; foundWillUpdateName = resolveClassComponentProps(Component, state); _instance.props = foundWillUpdateName; @@ -8694,9 +8802,9 @@ state !== newApiName || oldState !== newState || hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps( workInProgress, @@ -8716,9 +8824,9 @@ newState, lane ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (oldContext || ("function" !== typeof _instance.UNSAFE_componentWillUpdate && "function" !== typeof _instance.componentWillUpdate) || @@ -8735,12 +8843,12 @@ "function" === typeof _instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), @@ -8749,24 +8857,21 @@ (_instance.context = lane), (_instance = foundWillUpdateName)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (_instance = !1)); } lane = _instance; - markRef(current$jscomp$0, workInProgress); + markRef(current, workInProgress); state = 0 !== (workInProgress.flags & 128); if (lane || state) { lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; + setCurrentFiber(workInProgress); if (state && "function" !== typeof Component.getDerivedStateFromError) (Component = null), (profilerStartTime = -1); else { @@ -8783,10 +8888,10 @@ markComponentRenderStopped(); } workInProgress.flags |= 1; - null !== current$jscomp$0 && state + null !== current && state ? ((workInProgress.child = reconcileChildFibers( workInProgress, - current$jscomp$0.child, + current.child, null, renderLanes )), @@ -8796,17 +8901,12 @@ Component, renderLanes ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); + : reconcileChildren(current, workInProgress, Component, renderLanes); workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; + current = workInProgress.child; } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, + current = bailoutOnAlreadyFinishedWork( + current, workInProgress, renderLanes ); @@ -8819,7 +8919,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -8871,32 +8971,32 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2425; - var JSCompiler_object_inline_stack_2426 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2427; + var JSCompiler_object_inline_stack_2428 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2427 = !1; + var JSCompiler_object_inline_componentStack_2429 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2425 = didSuspend) || - (JSCompiler_object_inline_digest_2425 = + (JSCompiler_object_inline_digest_2427 = didSuspend) || + (JSCompiler_object_inline_digest_2427 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2425 && - ((JSCompiler_object_inline_componentStack_2427 = !0), + JSCompiler_object_inline_digest_2427 && + ((JSCompiler_object_inline_componentStack_2429 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2425 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2427 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2427 + JSCompiler_object_inline_componentStack_2429 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2424 = nextHydratableInstance; + var JSCompiler_object_inline_message_2426 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2424)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2426)) { c: { - var instance = JSCompiler_object_inline_message_2424; + var instance = JSCompiler_object_inline_message_2426; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8938,77 +9038,77 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2424 + JSCompiler_object_inline_message_2426 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2424 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2426 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2424 && - ((JSCompiler_object_inline_message_2424 = - JSCompiler_object_inline_message_2424.dehydrated), - null !== JSCompiler_object_inline_message_2424) + null !== JSCompiler_object_inline_message_2426 && + ((JSCompiler_object_inline_message_2426 = + JSCompiler_object_inline_message_2426.dehydrated), + null !== JSCompiler_object_inline_message_2426) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2424) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2426) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2424 = - JSCompiler_object_inline_stack_2426.children; - JSCompiler_object_inline_stack_2426 = - JSCompiler_object_inline_stack_2426.fallback; - if (JSCompiler_object_inline_componentStack_2427) + JSCompiler_object_inline_message_2426 = + JSCompiler_object_inline_stack_2428.children; + JSCompiler_object_inline_stack_2428 = + JSCompiler_object_inline_stack_2428.fallback; + if (JSCompiler_object_inline_componentStack_2429) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2427 = + (JSCompiler_object_inline_componentStack_2429 = workInProgress.mode), - (JSCompiler_object_inline_message_2424 = + (JSCompiler_object_inline_message_2426 = mountWorkInProgressOffscreenFiber( { mode: "hidden", - children: JSCompiler_object_inline_message_2424 + children: JSCompiler_object_inline_message_2426 }, - JSCompiler_object_inline_componentStack_2427 + JSCompiler_object_inline_componentStack_2429 )), - (JSCompiler_object_inline_stack_2426 = createFiberFromFragment( - JSCompiler_object_inline_stack_2426, - JSCompiler_object_inline_componentStack_2427, + (JSCompiler_object_inline_stack_2428 = createFiberFromFragment( + JSCompiler_object_inline_stack_2428, + JSCompiler_object_inline_componentStack_2429, renderLanes, null )), - (JSCompiler_object_inline_message_2424.return = workInProgress), - (JSCompiler_object_inline_stack_2426.return = workInProgress), - (JSCompiler_object_inline_message_2424.sibling = - JSCompiler_object_inline_stack_2426), - (workInProgress.child = JSCompiler_object_inline_message_2424), - (JSCompiler_object_inline_componentStack_2427 = + (JSCompiler_object_inline_message_2426.return = workInProgress), + (JSCompiler_object_inline_stack_2428.return = workInProgress), + (JSCompiler_object_inline_message_2426.sibling = + JSCompiler_object_inline_stack_2428), + (workInProgress.child = JSCompiler_object_inline_message_2426), + (JSCompiler_object_inline_componentStack_2429 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2427.memoizedState = + (JSCompiler_object_inline_componentStack_2429.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2427.childLanes = + (JSCompiler_object_inline_componentStack_2429.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2425, + JSCompiler_object_inline_digest_2427, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2426 + JSCompiler_object_inline_stack_2428 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2424 + JSCompiler_object_inline_message_2426 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2424 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2424) + ((JSCompiler_object_inline_message_2426 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2426) ) { if (didSuspend) workInProgress.flags & 256 @@ -9025,94 +9125,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2427 = - JSCompiler_object_inline_stack_2426.fallback), - (JSCompiler_object_inline_message_2424 = workInProgress.mode), - (JSCompiler_object_inline_stack_2426 = + (JSCompiler_object_inline_componentStack_2429 = + JSCompiler_object_inline_stack_2428.fallback), + (JSCompiler_object_inline_message_2426 = workInProgress.mode), + (JSCompiler_object_inline_stack_2428 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2426.children + children: JSCompiler_object_inline_stack_2428.children }, - JSCompiler_object_inline_message_2424 + JSCompiler_object_inline_message_2426 )), - (JSCompiler_object_inline_componentStack_2427 = + (JSCompiler_object_inline_componentStack_2429 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2427, - JSCompiler_object_inline_message_2424, + JSCompiler_object_inline_componentStack_2429, + JSCompiler_object_inline_message_2426, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2427.flags |= 2), - (JSCompiler_object_inline_stack_2426.return = workInProgress), - (JSCompiler_object_inline_componentStack_2427.return = + (JSCompiler_object_inline_componentStack_2429.flags |= 2), + (JSCompiler_object_inline_stack_2428.return = workInProgress), + (JSCompiler_object_inline_componentStack_2429.return = workInProgress), - (JSCompiler_object_inline_stack_2426.sibling = - JSCompiler_object_inline_componentStack_2427), - (workInProgress.child = JSCompiler_object_inline_stack_2426), + (JSCompiler_object_inline_stack_2428.sibling = + JSCompiler_object_inline_componentStack_2429), + (workInProgress.child = JSCompiler_object_inline_stack_2428), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2426 = workInProgress.child), - (JSCompiler_object_inline_stack_2426.memoizedState = + (JSCompiler_object_inline_stack_2428 = workInProgress.child), + (JSCompiler_object_inline_stack_2428.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2426.childLanes = + (JSCompiler_object_inline_stack_2428.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2425, + JSCompiler_object_inline_digest_2427, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2427)); + JSCompiler_object_inline_componentStack_2429)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2424)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2426)) ) { - JSCompiler_object_inline_digest_2425 = - JSCompiler_object_inline_message_2424.nextSibling && - JSCompiler_object_inline_message_2424.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2425) { - JSCompiler_temp = JSCompiler_object_inline_digest_2425.dgst; - var message = JSCompiler_object_inline_digest_2425.msg; - instance = JSCompiler_object_inline_digest_2425.stck; - var componentStack = JSCompiler_object_inline_digest_2425.cstck; + JSCompiler_object_inline_digest_2427 = + JSCompiler_object_inline_message_2426.nextSibling && + JSCompiler_object_inline_message_2426.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2427) { + JSCompiler_temp = JSCompiler_object_inline_digest_2427.dgst; + var message = JSCompiler_object_inline_digest_2427.msg; + instance = JSCompiler_object_inline_digest_2427.stck; + var componentStack = JSCompiler_object_inline_digest_2427.cstck; } - JSCompiler_object_inline_message_2424 = message; - JSCompiler_object_inline_digest_2425 = JSCompiler_temp; - JSCompiler_object_inline_stack_2426 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2427 = + JSCompiler_object_inline_message_2426 = message; + JSCompiler_object_inline_digest_2427 = JSCompiler_temp; + JSCompiler_object_inline_stack_2428 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2429 = componentStack; - JSCompiler_object_inline_componentStack_2427 = - JSCompiler_object_inline_message_2424 - ? Error(JSCompiler_object_inline_message_2424) + JSCompiler_object_inline_componentStack_2429 = + JSCompiler_object_inline_message_2426 + ? Error(JSCompiler_object_inline_message_2426) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2427.stack = - JSCompiler_object_inline_stack_2426 || ""; - JSCompiler_object_inline_componentStack_2427.digest = - JSCompiler_object_inline_digest_2425; - JSCompiler_object_inline_digest_2425 = + JSCompiler_object_inline_componentStack_2429.stack = + JSCompiler_object_inline_stack_2428 || ""; + JSCompiler_object_inline_componentStack_2429.digest = + JSCompiler_object_inline_digest_2427; + JSCompiler_object_inline_digest_2427 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2426 = { - value: JSCompiler_object_inline_componentStack_2427, + JSCompiler_object_inline_stack_2428 = { + value: JSCompiler_object_inline_componentStack_2429, source: null, - stack: JSCompiler_object_inline_digest_2425 + stack: JSCompiler_object_inline_digest_2427 }; - "string" === typeof JSCompiler_object_inline_digest_2425 && + "string" === typeof JSCompiler_object_inline_digest_2427 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2427, - JSCompiler_object_inline_stack_2426 + JSCompiler_object_inline_componentStack_2429, + JSCompiler_object_inline_stack_2428 ); - queueHydrationError(JSCompiler_object_inline_stack_2426); + queueHydrationError(JSCompiler_object_inline_stack_2428); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9126,44 +9226,44 @@ renderLanes, !1 ), - (JSCompiler_object_inline_digest_2425 = + (JSCompiler_object_inline_digest_2427 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2425) + didReceiveUpdate || JSCompiler_object_inline_digest_2427) ) { - JSCompiler_object_inline_digest_2425 = workInProgressRoot; + JSCompiler_object_inline_digest_2427 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2425 && - ((JSCompiler_object_inline_stack_2426 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2426 = - 0 !== (JSCompiler_object_inline_stack_2426 & 42) + null !== JSCompiler_object_inline_digest_2427 && + ((JSCompiler_object_inline_stack_2428 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2428 = + 0 !== (JSCompiler_object_inline_stack_2428 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2426 + JSCompiler_object_inline_stack_2428 )), - (JSCompiler_object_inline_stack_2426 = + (JSCompiler_object_inline_stack_2428 = 0 !== - (JSCompiler_object_inline_stack_2426 & - (JSCompiler_object_inline_digest_2425.suspendedLanes | + (JSCompiler_object_inline_stack_2428 & + (JSCompiler_object_inline_digest_2427.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2426), - 0 !== JSCompiler_object_inline_stack_2426 && - JSCompiler_object_inline_stack_2426 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2428), + 0 !== JSCompiler_object_inline_stack_2428 && + JSCompiler_object_inline_stack_2428 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2426), + ((prevState.retryLane = JSCompiler_object_inline_stack_2428), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2426 + JSCompiler_object_inline_stack_2428 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2425, + JSCompiler_object_inline_digest_2427, current, - JSCompiler_object_inline_stack_2426 + JSCompiler_object_inline_stack_2428 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2424.data === + JSCompiler_object_inline_message_2426.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9171,14 +9271,14 @@ renderLanes ); } else - JSCompiler_object_inline_message_2424.data === + JSCompiler_object_inline_message_2426.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2424.nextSibling + JSCompiler_object_inline_message_2426.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9196,57 +9296,57 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2426.children + JSCompiler_object_inline_stack_2428.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2427) + if (JSCompiler_object_inline_componentStack_2429) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2427 = - JSCompiler_object_inline_stack_2426.fallback), - (JSCompiler_object_inline_message_2424 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2429 = + JSCompiler_object_inline_stack_2428.fallback), + (JSCompiler_object_inline_message_2426 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2426 = createWorkInProgress( + (JSCompiler_object_inline_stack_2428 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2426.children + children: JSCompiler_object_inline_stack_2428.children } )), - (JSCompiler_object_inline_stack_2426.subtreeFlags = + (JSCompiler_object_inline_stack_2428.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_componentStack_2427 = + ? (JSCompiler_object_inline_componentStack_2429 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2427 + JSCompiler_object_inline_componentStack_2429 )) - : ((JSCompiler_object_inline_componentStack_2427 = + : ((JSCompiler_object_inline_componentStack_2429 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2427, - JSCompiler_object_inline_message_2424, + JSCompiler_object_inline_componentStack_2429, + JSCompiler_object_inline_message_2426, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2427.flags |= 2)), - (JSCompiler_object_inline_componentStack_2427.return = + (JSCompiler_object_inline_componentStack_2429.flags |= 2)), + (JSCompiler_object_inline_componentStack_2429.return = workInProgress), - (JSCompiler_object_inline_stack_2426.return = workInProgress), - (JSCompiler_object_inline_stack_2426.sibling = - JSCompiler_object_inline_componentStack_2427), - (workInProgress.child = JSCompiler_object_inline_stack_2426), - (JSCompiler_object_inline_stack_2426 = - JSCompiler_object_inline_componentStack_2427), - (JSCompiler_object_inline_componentStack_2427 = workInProgress.child), - (JSCompiler_object_inline_message_2424 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2424 - ? (JSCompiler_object_inline_message_2424 = + (JSCompiler_object_inline_stack_2428.return = workInProgress), + (JSCompiler_object_inline_stack_2428.sibling = + JSCompiler_object_inline_componentStack_2429), + (workInProgress.child = JSCompiler_object_inline_stack_2428), + (JSCompiler_object_inline_stack_2428 = + JSCompiler_object_inline_componentStack_2429), + (JSCompiler_object_inline_componentStack_2429 = workInProgress.child), + (JSCompiler_object_inline_message_2426 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2426 + ? (JSCompiler_object_inline_message_2426 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2424.cachePool), + JSCompiler_object_inline_message_2426.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9254,37 +9354,37 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2424 = { + (JSCompiler_object_inline_message_2426 = { baseLanes: - JSCompiler_object_inline_message_2424.baseLanes | renderLanes, + JSCompiler_object_inline_message_2426.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2427.memoizedState = - JSCompiler_object_inline_message_2424), - (JSCompiler_object_inline_componentStack_2427.childLanes = + (JSCompiler_object_inline_componentStack_2429.memoizedState = + JSCompiler_object_inline_message_2426), + (JSCompiler_object_inline_componentStack_2429.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2425, + JSCompiler_object_inline_digest_2427, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2426 + JSCompiler_object_inline_stack_2428 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2426.children + children: JSCompiler_object_inline_stack_2428.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2425 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2425 + ((JSCompiler_object_inline_digest_2427 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2427 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2425.push(current)); + : JSCompiler_object_inline_digest_2427.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -9697,6 +9797,8 @@ workInProgress.mode, workInProgress.lanes ); + renderLanes._debugStack = workInProgress._debugStack; + renderLanes._debugTask = workInProgress._debugTask; var returnFiber = workInProgress.return; if (null === returnFiber) throw Error("Cannot swap the root fiber."); current.alternate = null; @@ -12822,7 +12924,11 @@ this.actualDuration = -0; this.actualStartTime = -1.1; this.treeBaseDuration = this.selfBaseDuration = -0; - this._debugOwner = this._debugInfo = null; + this._debugTask = + this._debugStack = + this._debugOwner = + this._debugInfo = + null; this._debugNeedsRemount = !1; this._debugHookTypes = null; hasBadMapPolyfill || @@ -12846,6 +12952,8 @@ (workInProgress.type = current.type), (workInProgress.stateNode = current.stateNode), (workInProgress._debugOwner = current._debugOwner), + (workInProgress._debugStack = current._debugStack), + (workInProgress._debugTask = current._debugTask), (workInProgress._debugHookTypes = current._debugHookTypes), (workInProgress.alternate = current), (current.alternate = workInProgress)) @@ -13065,6 +13173,8 @@ lanes ); mode._debugOwner = element._owner; + mode._debugStack = element._debugStack; + mode._debugTask = element._debugTask; return mode; } function createFiberFromFragment(elements, mode, lanes, key) { @@ -16230,6 +16340,15 @@ }); } } + function executeDispatch(event, listener, currentTarget) { + event.currentTarget = currentTarget; + try { + listener(event); + } catch (error) { + reportGlobalError(error); + } + event.currentTarget = null; + } function processDispatchQueue(dispatchQueue, eventSystemFlags) { eventSystemFlags = 0 !== (eventSystemFlags & 4); for (var i = 0; i < dispatchQueue.length; i++) { @@ -16250,14 +16369,15 @@ _dispatchListeners$i = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) break a; - previousInstance = event; - previousInstance.currentTarget = currentTarget; - try { - _dispatchListeners$i(previousInstance); - } catch (error) { - reportGlobalError(error); - } - previousInstance.currentTarget = null; + null !== instance + ? runWithFiberInDEV( + instance, + executeDispatch, + event, + _dispatchListeners$i, + currentTarget + ) + : executeDispatch(event, _dispatchListeners$i, currentTarget); previousInstance = instance; } else @@ -16272,14 +16392,15 @@ _dispatchListeners$i = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) break a; - previousInstance = event; - previousInstance.currentTarget = currentTarget; - try { - _dispatchListeners$i(previousInstance); - } catch (error) { - reportGlobalError(error); - } - previousInstance.currentTarget = null; + null !== instance + ? runWithFiberInDEV( + instance, + executeDispatch, + event, + _dispatchListeners$i, + currentTarget + ) + : executeDispatch(event, _dispatchListeners$i, currentTarget); previousInstance = instance; } } @@ -20291,38 +20412,6 @@ resource.state.loading |= Inserted; } } - function bindToConsole(methodName, args, badgeName) { - var offset = 0; - switch (methodName) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - return bind.apply(console[methodName], [console].concat(args)); - case "assert": - offset = 1; - } - args = args.slice(0); - "string" === typeof args[offset] - ? args.splice( - offset, - 1, - badgeFormat + args[offset], - badgeStyle, - pad + badgeName + pad, - resetStyle - ) - : args.splice( - offset, - 0, - badgeFormat, - badgeStyle, - pad + badgeName + pad, - resetStyle - ); - args.unshift(console); - return bind.apply(console[methodName], args); - } function FiberRootNode( containerInfo, tag, @@ -24665,11 +24754,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-canary-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-canary-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24706,10 +24795,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213" + reconcilerVersion: "19.1.0-canary-32b0cad8-20250213" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24853,7 +24942,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js index c066445793dd21..a958d7af336334 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js @@ -15250,14 +15250,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1762 = React.version; if ( - "19.1.0-canary-cbbe8666-20250213" !== + "19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion$jscomp$inline_1762 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1762, - "19.1.0-canary-cbbe8666-20250213" + "19.1.0-canary-32b0cad8-20250213" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15279,10 +15279,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2243 = { bundleType: 0, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213" + reconcilerVersion: "19.1.0-canary-32b0cad8-20250213" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2244 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -15386,4 +15386,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js index 29446aea4aad40..dd5a0e2064a7a7 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js @@ -1373,6 +1373,27 @@ "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -1421,29 +1442,96 @@ return "\nError generating stack: " + x.message + "\n" + x.stack; } } + function describeFunctionComponentFrameWithoutLineNumber(fn) { + return (fn = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(fn) + : ""; + } function getCurrentFiberOwnerNameInDevOrNull() { if (null === current) return null; var owner = current._debugOwner; return null != owner ? getComponentNameFromOwner(owner) : null; } function getCurrentFiberStackInDev() { - return null === current ? "" : getStackByFiberInDevAndProd(current); + if (null === current) return ""; + var workInProgress = current; + try { + var info = ""; + 6 === workInProgress.tag && (workInProgress = workInProgress.return); + switch (workInProgress.tag) { + case 26: + case 27: + case 5: + info += describeBuiltInComponentFrame(workInProgress.type); + break; + case 13: + info += describeBuiltInComponentFrame("Suspense"); + break; + case 19: + info += describeBuiltInComponentFrame("SuspenseList"); + break; + case 30: + case 0: + case 15: + case 1: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type + )); + break; + case 11: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type.render + )); + } + for (; workInProgress; ) + if ("number" === typeof workInProgress.tag) { + var fiber = workInProgress; + workInProgress = fiber._debugOwner; + var debugStack = fiber._debugStack; + workInProgress && + debugStack && + ("string" !== typeof debugStack && + (fiber._debugStack = debugStack = formatOwnerStack(debugStack)), + "" !== debugStack && (info += "\n" + debugStack)); + } else if (null != workInProgress.debugStack) { + var ownerStack = workInProgress.debugStack; + (workInProgress = workInProgress.owner) && + ownerStack && + (info += "\n" + formatOwnerStack(ownerStack)); + } else break; + var JSCompiler_inline_result = info; + } catch (x) { + JSCompiler_inline_result = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result; } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; - ReactSharedInternals.getCurrentStack = - null === fiber ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = fiber; + setCurrentFiber(fiber); try { - return callback(arg0, arg1, arg2, arg3, arg4); + return null !== fiber && fiber._debugTask + ? fiber._debugTask.run( + callback.bind(null, arg0, arg1, arg2, arg3, arg4) + ) + : callback(arg0, arg1, arg2, arg3, arg4); } finally { - current = previousFiber; + setCurrentFiber(previousFiber); } throw Error( "runWithFiberInDEV should never be called in production. This is a bug in React." ); } + function setCurrentFiber(fiber) { + ReactSharedInternals.getCurrentStack = + null === fiber ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = fiber; + } function getToStringValue(value) { switch (typeof value) { case "bigint": @@ -2496,37 +2584,50 @@ : findInvalidAncestorForTag(childTag, ancestorInfo); ancestorInfo = parentInfo || ancestorInfo; if (!ancestorInfo) return !0; - ancestorInfo = ancestorInfo.tag; - var warnKey = String(!!parentInfo) + "|" + childTag + "|" + ancestorInfo; - if (didWarn[warnKey]) return !1; - didWarn[warnKey] = !0; - var ancestor = (warnKey = current) - ? findAncestor(warnKey.return, ancestorInfo) - : null; - warnKey = - null !== warnKey && null !== ancestor - ? describeAncestors(ancestor, warnKey, null) - : ""; - ancestor = "<" + childTag + ">"; + var ancestorTag = ancestorInfo.tag; + ancestorInfo = String(!!parentInfo) + "|" + childTag + "|" + ancestorTag; + if (didWarn[ancestorInfo]) return !1; + didWarn[ancestorInfo] = !0; + var ancestor = (ancestorInfo = current) + ? findAncestor(ancestorInfo.return, ancestorTag) + : null, + ancestorDescription = + null !== ancestorInfo && null !== ancestor + ? describeAncestors(ancestor, ancestorInfo, null) + : "", + tagDisplayName = "<" + childTag + ">"; parentInfo ? ((parentInfo = ""), - "table" === ancestorInfo && + "table" === ancestorTag && "tr" === childTag && (parentInfo += " Add a , or to your code to match the DOM tree generated by the browser."), console.error( "In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s", - ancestor, - ancestorInfo, + tagDisplayName, + ancestorTag, parentInfo, - warnKey + ancestorDescription )) : console.error( "In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s", - ancestor, - ancestorInfo, - warnKey + tagDisplayName, + ancestorTag, + ancestorDescription ); + ancestorInfo && + ((childTag = ancestorInfo.return), + null === ancestor || + null === childTag || + (ancestor === childTag && + childTag._debugOwner === ancestorInfo._debugOwner) || + runWithFiberInDEV(ancestor, function () { + console.error( + "<%s> cannot contain a nested %s.\nSee this log for the ancestor stack trace.", + ancestorTag, + tagDisplayName + ); + })); return !1; } function validateTextNesting(childText, parentTag, implicitRootScope) { @@ -6639,6 +6740,7 @@ )), (current.return = returnFiber), (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6713,6 +6815,7 @@ )), (current.return = returnFiber), (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6735,6 +6838,7 @@ )), (newChild.return = returnFiber), (newChild._debugOwner = returnFiber), + (newChild._debugTask = returnFiber._debugTask), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -6782,6 +6886,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -7319,6 +7424,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), validateFragmentProps(newChild, lanes, returnFiber), (returnFiber = lanes)) @@ -7485,6 +7591,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), (returnFiber = lanes)), placeSingleChild(returnFiber) @@ -7514,10 +7621,12 @@ fiber.return = returnFiber; var debugInfo = (fiber._debugInfo = currentDebugInfo); fiber._debugOwner = returnFiber._debugOwner; + fiber._debugTask = returnFiber._debugTask; if (null != debugInfo) for (var i = debugInfo.length - 1; 0 <= i; i--) if ("string" === typeof debugInfo[i].stack) { fiber._debugOwner = debugInfo[i]; + fiber._debugTask = debugInfo[i].debugTask; break; } return fiber; @@ -7598,63 +7707,62 @@ } return null; } - function defaultOnUncaughtError(error, errorInfo) { + function defaultOnUncaughtError(error) { reportGlobalError(error); - error = componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components."; - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack, - componentStack = - null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; - try { - console.warn( - "%s\n\n%s\n", - error, - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." - ); - } finally { - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; - } + console.warn( + "%s\n\n%s\n", + componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components.", + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); } - function defaultOnCaughtError(error, errorInfo) { + function defaultOnCaughtError(error) { var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component." : "The above error occurred in one of your React components.", recreateMessage = "React will try to recreate this component tree from scratch using the error boundary you provided, " + - ((errorBoundaryName || "Anonymous") + "."), - prevGetCurrentStack = ReactSharedInternals.getCurrentStack, - componentStack = - null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; - try { + ((errorBoundaryName || "Anonymous") + "."); + if ( "object" === typeof error && null !== error && "string" === typeof error.environmentName - ? bindToConsole( - "error", - [ - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage - ], - error.environmentName - )() - : console.error( - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage + ) { + var JSCompiler_inline_result = error.environmentName; + error = [ + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ].slice(0); + "string" === typeof error[0] + ? error.splice( + 0, + 1, + badgeFormat + error[0], + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ) + : error.splice( + 0, + 0, + badgeFormat, + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle ); - } finally { - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; - } + error.unshift(console); + JSCompiler_inline_result = bind.apply(console.error, error); + JSCompiler_inline_result(); + } else + console.error( + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ); } function defaultOnRecoverableError(error) { reportGlobalError(error); @@ -8273,7 +8381,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -8589,7 +8697,7 @@ (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 134217728); _instance = !0; - } else if (null === current$jscomp$0) { + } else if (null === current) { _instance = workInProgress.stateNode; var unresolvedOldProps = workInProgress.memoizedProps; lane = resolveClassComponentProps(Component, unresolvedOldProps); @@ -8669,7 +8777,7 @@ (_instance = !1)); } else { _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); + cloneUpdateQueue(current, workInProgress); state = workInProgress.memoizedProps; foundWillUpdateName = resolveClassComponentProps(Component, state); _instance.props = foundWillUpdateName; @@ -8702,9 +8810,9 @@ state !== newApiName || oldState !== newState || hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps( workInProgress, @@ -8724,9 +8832,9 @@ newState, lane ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) ? (oldContext || ("function" !== typeof _instance.UNSAFE_componentWillUpdate && "function" !== typeof _instance.componentWillUpdate) || @@ -8743,12 +8851,12 @@ "function" === typeof _instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 1024)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = newState)), @@ -8757,24 +8865,21 @@ (_instance.context = lane), (_instance = foundWillUpdateName)) : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || + (state === current.memoizedProps && + oldState === current.memoizedState) || (workInProgress.flags |= 1024), (_instance = !1)); } lane = _instance; - markRef(current$jscomp$0, workInProgress); + markRef(current, workInProgress); state = 0 !== (workInProgress.flags & 128); if (lane || state) { lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; + setCurrentFiber(workInProgress); if (state && "function" !== typeof Component.getDerivedStateFromError) (Component = null), (profilerStartTime = -1); else { @@ -8791,10 +8896,10 @@ markComponentRenderStopped(); } workInProgress.flags |= 1; - null !== current$jscomp$0 && state + null !== current && state ? ((workInProgress.child = reconcileChildFibers( workInProgress, - current$jscomp$0.child, + current.child, null, renderLanes )), @@ -8804,17 +8909,12 @@ Component, renderLanes ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); + : reconcileChildren(current, workInProgress, Component, renderLanes); workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; + current = workInProgress.child; } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, + current = bailoutOnAlreadyFinishedWork( + current, workInProgress, renderLanes ); @@ -8827,7 +8927,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -8879,32 +8979,32 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2430; - var JSCompiler_object_inline_stack_2431 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2432; + var JSCompiler_object_inline_stack_2433 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2432 = !1; + var JSCompiler_object_inline_componentStack_2434 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2430 = didSuspend) || - (JSCompiler_object_inline_digest_2430 = + (JSCompiler_object_inline_digest_2432 = didSuspend) || + (JSCompiler_object_inline_digest_2432 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2430 && - ((JSCompiler_object_inline_componentStack_2432 = !0), + JSCompiler_object_inline_digest_2432 && + ((JSCompiler_object_inline_componentStack_2434 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2430 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2432 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2432 + JSCompiler_object_inline_componentStack_2434 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2429 = nextHydratableInstance; + var JSCompiler_object_inline_message_2431 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2429)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2431)) { c: { - var instance = JSCompiler_object_inline_message_2429; + var instance = JSCompiler_object_inline_message_2431; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8946,77 +9046,77 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2429 + JSCompiler_object_inline_message_2431 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2429 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2431 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2429 && - ((JSCompiler_object_inline_message_2429 = - JSCompiler_object_inline_message_2429.dehydrated), - null !== JSCompiler_object_inline_message_2429) + null !== JSCompiler_object_inline_message_2431 && + ((JSCompiler_object_inline_message_2431 = + JSCompiler_object_inline_message_2431.dehydrated), + null !== JSCompiler_object_inline_message_2431) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2429) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2431) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2429 = - JSCompiler_object_inline_stack_2431.children; - JSCompiler_object_inline_stack_2431 = - JSCompiler_object_inline_stack_2431.fallback; - if (JSCompiler_object_inline_componentStack_2432) + JSCompiler_object_inline_message_2431 = + JSCompiler_object_inline_stack_2433.children; + JSCompiler_object_inline_stack_2433 = + JSCompiler_object_inline_stack_2433.fallback; + if (JSCompiler_object_inline_componentStack_2434) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2432 = + (JSCompiler_object_inline_componentStack_2434 = workInProgress.mode), - (JSCompiler_object_inline_message_2429 = + (JSCompiler_object_inline_message_2431 = mountWorkInProgressOffscreenFiber( { mode: "hidden", - children: JSCompiler_object_inline_message_2429 + children: JSCompiler_object_inline_message_2431 }, - JSCompiler_object_inline_componentStack_2432 + JSCompiler_object_inline_componentStack_2434 )), - (JSCompiler_object_inline_stack_2431 = createFiberFromFragment( - JSCompiler_object_inline_stack_2431, - JSCompiler_object_inline_componentStack_2432, + (JSCompiler_object_inline_stack_2433 = createFiberFromFragment( + JSCompiler_object_inline_stack_2433, + JSCompiler_object_inline_componentStack_2434, renderLanes, null )), - (JSCompiler_object_inline_message_2429.return = workInProgress), - (JSCompiler_object_inline_stack_2431.return = workInProgress), - (JSCompiler_object_inline_message_2429.sibling = - JSCompiler_object_inline_stack_2431), - (workInProgress.child = JSCompiler_object_inline_message_2429), - (JSCompiler_object_inline_componentStack_2432 = + (JSCompiler_object_inline_message_2431.return = workInProgress), + (JSCompiler_object_inline_stack_2433.return = workInProgress), + (JSCompiler_object_inline_message_2431.sibling = + JSCompiler_object_inline_stack_2433), + (workInProgress.child = JSCompiler_object_inline_message_2431), + (JSCompiler_object_inline_componentStack_2434 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2432.memoizedState = + (JSCompiler_object_inline_componentStack_2434.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2432.childLanes = + (JSCompiler_object_inline_componentStack_2434.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2430, + JSCompiler_object_inline_digest_2432, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2431 + JSCompiler_object_inline_stack_2433 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2429 + JSCompiler_object_inline_message_2431 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2429 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2429) + ((JSCompiler_object_inline_message_2431 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2431) ) { if (didSuspend) workInProgress.flags & 256 @@ -9033,94 +9133,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2432 = - JSCompiler_object_inline_stack_2431.fallback), - (JSCompiler_object_inline_message_2429 = workInProgress.mode), - (JSCompiler_object_inline_stack_2431 = + (JSCompiler_object_inline_componentStack_2434 = + JSCompiler_object_inline_stack_2433.fallback), + (JSCompiler_object_inline_message_2431 = workInProgress.mode), + (JSCompiler_object_inline_stack_2433 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2431.children + children: JSCompiler_object_inline_stack_2433.children }, - JSCompiler_object_inline_message_2429 + JSCompiler_object_inline_message_2431 )), - (JSCompiler_object_inline_componentStack_2432 = + (JSCompiler_object_inline_componentStack_2434 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2432, - JSCompiler_object_inline_message_2429, + JSCompiler_object_inline_componentStack_2434, + JSCompiler_object_inline_message_2431, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2432.flags |= 2), - (JSCompiler_object_inline_stack_2431.return = workInProgress), - (JSCompiler_object_inline_componentStack_2432.return = + (JSCompiler_object_inline_componentStack_2434.flags |= 2), + (JSCompiler_object_inline_stack_2433.return = workInProgress), + (JSCompiler_object_inline_componentStack_2434.return = workInProgress), - (JSCompiler_object_inline_stack_2431.sibling = - JSCompiler_object_inline_componentStack_2432), - (workInProgress.child = JSCompiler_object_inline_stack_2431), + (JSCompiler_object_inline_stack_2433.sibling = + JSCompiler_object_inline_componentStack_2434), + (workInProgress.child = JSCompiler_object_inline_stack_2433), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2431 = workInProgress.child), - (JSCompiler_object_inline_stack_2431.memoizedState = + (JSCompiler_object_inline_stack_2433 = workInProgress.child), + (JSCompiler_object_inline_stack_2433.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2431.childLanes = + (JSCompiler_object_inline_stack_2433.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2430, + JSCompiler_object_inline_digest_2432, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2432)); + JSCompiler_object_inline_componentStack_2434)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2429)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2431)) ) { - JSCompiler_object_inline_digest_2430 = - JSCompiler_object_inline_message_2429.nextSibling && - JSCompiler_object_inline_message_2429.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2430) { - JSCompiler_temp = JSCompiler_object_inline_digest_2430.dgst; - var message = JSCompiler_object_inline_digest_2430.msg; - instance = JSCompiler_object_inline_digest_2430.stck; - var componentStack = JSCompiler_object_inline_digest_2430.cstck; + JSCompiler_object_inline_digest_2432 = + JSCompiler_object_inline_message_2431.nextSibling && + JSCompiler_object_inline_message_2431.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2432) { + JSCompiler_temp = JSCompiler_object_inline_digest_2432.dgst; + var message = JSCompiler_object_inline_digest_2432.msg; + instance = JSCompiler_object_inline_digest_2432.stck; + var componentStack = JSCompiler_object_inline_digest_2432.cstck; } - JSCompiler_object_inline_message_2429 = message; - JSCompiler_object_inline_digest_2430 = JSCompiler_temp; - JSCompiler_object_inline_stack_2431 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2432 = + JSCompiler_object_inline_message_2431 = message; + JSCompiler_object_inline_digest_2432 = JSCompiler_temp; + JSCompiler_object_inline_stack_2433 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2434 = componentStack; - JSCompiler_object_inline_componentStack_2432 = - JSCompiler_object_inline_message_2429 - ? Error(JSCompiler_object_inline_message_2429) + JSCompiler_object_inline_componentStack_2434 = + JSCompiler_object_inline_message_2431 + ? Error(JSCompiler_object_inline_message_2431) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2432.stack = - JSCompiler_object_inline_stack_2431 || ""; - JSCompiler_object_inline_componentStack_2432.digest = - JSCompiler_object_inline_digest_2430; - JSCompiler_object_inline_digest_2430 = + JSCompiler_object_inline_componentStack_2434.stack = + JSCompiler_object_inline_stack_2433 || ""; + JSCompiler_object_inline_componentStack_2434.digest = + JSCompiler_object_inline_digest_2432; + JSCompiler_object_inline_digest_2432 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2431 = { - value: JSCompiler_object_inline_componentStack_2432, + JSCompiler_object_inline_stack_2433 = { + value: JSCompiler_object_inline_componentStack_2434, source: null, - stack: JSCompiler_object_inline_digest_2430 + stack: JSCompiler_object_inline_digest_2432 }; - "string" === typeof JSCompiler_object_inline_digest_2430 && + "string" === typeof JSCompiler_object_inline_digest_2432 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2432, - JSCompiler_object_inline_stack_2431 + JSCompiler_object_inline_componentStack_2434, + JSCompiler_object_inline_stack_2433 ); - queueHydrationError(JSCompiler_object_inline_stack_2431); + queueHydrationError(JSCompiler_object_inline_stack_2433); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9134,44 +9234,44 @@ renderLanes, !1 ), - (JSCompiler_object_inline_digest_2430 = + (JSCompiler_object_inline_digest_2432 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2430) + didReceiveUpdate || JSCompiler_object_inline_digest_2432) ) { - JSCompiler_object_inline_digest_2430 = workInProgressRoot; + JSCompiler_object_inline_digest_2432 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2430 && - ((JSCompiler_object_inline_stack_2431 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2431 = - 0 !== (JSCompiler_object_inline_stack_2431 & 42) + null !== JSCompiler_object_inline_digest_2432 && + ((JSCompiler_object_inline_stack_2433 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2433 = + 0 !== (JSCompiler_object_inline_stack_2433 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2431 + JSCompiler_object_inline_stack_2433 )), - (JSCompiler_object_inline_stack_2431 = + (JSCompiler_object_inline_stack_2433 = 0 !== - (JSCompiler_object_inline_stack_2431 & - (JSCompiler_object_inline_digest_2430.suspendedLanes | + (JSCompiler_object_inline_stack_2433 & + (JSCompiler_object_inline_digest_2432.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2431), - 0 !== JSCompiler_object_inline_stack_2431 && - JSCompiler_object_inline_stack_2431 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2433), + 0 !== JSCompiler_object_inline_stack_2433 && + JSCompiler_object_inline_stack_2433 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2431), + ((prevState.retryLane = JSCompiler_object_inline_stack_2433), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2431 + JSCompiler_object_inline_stack_2433 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2430, + JSCompiler_object_inline_digest_2432, current, - JSCompiler_object_inline_stack_2431 + JSCompiler_object_inline_stack_2433 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2429.data === + JSCompiler_object_inline_message_2431.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9179,14 +9279,14 @@ renderLanes ); } else - JSCompiler_object_inline_message_2429.data === + JSCompiler_object_inline_message_2431.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2429.nextSibling + JSCompiler_object_inline_message_2431.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9204,57 +9304,57 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2431.children + JSCompiler_object_inline_stack_2433.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2432) + if (JSCompiler_object_inline_componentStack_2434) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2432 = - JSCompiler_object_inline_stack_2431.fallback), - (JSCompiler_object_inline_message_2429 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2434 = + JSCompiler_object_inline_stack_2433.fallback), + (JSCompiler_object_inline_message_2431 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2431 = createWorkInProgress( + (JSCompiler_object_inline_stack_2433 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2431.children + children: JSCompiler_object_inline_stack_2433.children } )), - (JSCompiler_object_inline_stack_2431.subtreeFlags = + (JSCompiler_object_inline_stack_2433.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_componentStack_2432 = + ? (JSCompiler_object_inline_componentStack_2434 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2432 + JSCompiler_object_inline_componentStack_2434 )) - : ((JSCompiler_object_inline_componentStack_2432 = + : ((JSCompiler_object_inline_componentStack_2434 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2432, - JSCompiler_object_inline_message_2429, + JSCompiler_object_inline_componentStack_2434, + JSCompiler_object_inline_message_2431, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2432.flags |= 2)), - (JSCompiler_object_inline_componentStack_2432.return = + (JSCompiler_object_inline_componentStack_2434.flags |= 2)), + (JSCompiler_object_inline_componentStack_2434.return = workInProgress), - (JSCompiler_object_inline_stack_2431.return = workInProgress), - (JSCompiler_object_inline_stack_2431.sibling = - JSCompiler_object_inline_componentStack_2432), - (workInProgress.child = JSCompiler_object_inline_stack_2431), - (JSCompiler_object_inline_stack_2431 = - JSCompiler_object_inline_componentStack_2432), - (JSCompiler_object_inline_componentStack_2432 = workInProgress.child), - (JSCompiler_object_inline_message_2429 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2429 - ? (JSCompiler_object_inline_message_2429 = + (JSCompiler_object_inline_stack_2433.return = workInProgress), + (JSCompiler_object_inline_stack_2433.sibling = + JSCompiler_object_inline_componentStack_2434), + (workInProgress.child = JSCompiler_object_inline_stack_2433), + (JSCompiler_object_inline_stack_2433 = + JSCompiler_object_inline_componentStack_2434), + (JSCompiler_object_inline_componentStack_2434 = workInProgress.child), + (JSCompiler_object_inline_message_2431 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2431 + ? (JSCompiler_object_inline_message_2431 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2429.cachePool), + JSCompiler_object_inline_message_2431.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9262,37 +9362,37 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2429 = { + (JSCompiler_object_inline_message_2431 = { baseLanes: - JSCompiler_object_inline_message_2429.baseLanes | renderLanes, + JSCompiler_object_inline_message_2431.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2432.memoizedState = - JSCompiler_object_inline_message_2429), - (JSCompiler_object_inline_componentStack_2432.childLanes = + (JSCompiler_object_inline_componentStack_2434.memoizedState = + JSCompiler_object_inline_message_2431), + (JSCompiler_object_inline_componentStack_2434.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2430, + JSCompiler_object_inline_digest_2432, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2431 + JSCompiler_object_inline_stack_2433 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2431.children + children: JSCompiler_object_inline_stack_2433.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2430 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2430 + ((JSCompiler_object_inline_digest_2432 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2432 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2430.push(current)); + : JSCompiler_object_inline_digest_2432.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -9705,6 +9805,8 @@ workInProgress.mode, workInProgress.lanes ); + renderLanes._debugStack = workInProgress._debugStack; + renderLanes._debugTask = workInProgress._debugTask; var returnFiber = workInProgress.return; if (null === returnFiber) throw Error("Cannot swap the root fiber."); current.alternate = null; @@ -12830,7 +12932,11 @@ this.actualDuration = -0; this.actualStartTime = -1.1; this.treeBaseDuration = this.selfBaseDuration = -0; - this._debugOwner = this._debugInfo = null; + this._debugTask = + this._debugStack = + this._debugOwner = + this._debugInfo = + null; this._debugNeedsRemount = !1; this._debugHookTypes = null; hasBadMapPolyfill || @@ -12854,6 +12960,8 @@ (workInProgress.type = current.type), (workInProgress.stateNode = current.stateNode), (workInProgress._debugOwner = current._debugOwner), + (workInProgress._debugStack = current._debugStack), + (workInProgress._debugTask = current._debugTask), (workInProgress._debugHookTypes = current._debugHookTypes), (workInProgress.alternate = current), (current.alternate = workInProgress)) @@ -13073,6 +13181,8 @@ lanes ); mode._debugOwner = element._owner; + mode._debugStack = element._debugStack; + mode._debugTask = element._debugTask; return mode; } function createFiberFromFragment(elements, mode, lanes, key) { @@ -16242,6 +16352,15 @@ }); } } + function executeDispatch(event, listener, currentTarget) { + event.currentTarget = currentTarget; + try { + listener(event); + } catch (error) { + reportGlobalError(error); + } + event.currentTarget = null; + } function processDispatchQueue(dispatchQueue, eventSystemFlags) { eventSystemFlags = 0 !== (eventSystemFlags & 4); for (var i = 0; i < dispatchQueue.length; i++) { @@ -16262,14 +16381,15 @@ _dispatchListeners$i = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) break a; - previousInstance = event; - previousInstance.currentTarget = currentTarget; - try { - _dispatchListeners$i(previousInstance); - } catch (error) { - reportGlobalError(error); - } - previousInstance.currentTarget = null; + null !== instance + ? runWithFiberInDEV( + instance, + executeDispatch, + event, + _dispatchListeners$i, + currentTarget + ) + : executeDispatch(event, _dispatchListeners$i, currentTarget); previousInstance = instance; } else @@ -16284,14 +16404,15 @@ _dispatchListeners$i = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) break a; - previousInstance = event; - previousInstance.currentTarget = currentTarget; - try { - _dispatchListeners$i(previousInstance); - } catch (error) { - reportGlobalError(error); - } - previousInstance.currentTarget = null; + null !== instance + ? runWithFiberInDEV( + instance, + executeDispatch, + event, + _dispatchListeners$i, + currentTarget + ) + : executeDispatch(event, _dispatchListeners$i, currentTarget); previousInstance = instance; } } @@ -20303,38 +20424,6 @@ resource.state.loading |= Inserted; } } - function bindToConsole(methodName, args, badgeName) { - var offset = 0; - switch (methodName) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - return bind.apply(console[methodName], [console].concat(args)); - case "assert": - offset = 1; - } - args = args.slice(0); - "string" === typeof args[offset] - ? args.splice( - offset, - 1, - badgeFormat + args[offset], - badgeStyle, - pad + badgeName + pad, - resetStyle - ) - : args.splice( - offset, - 0, - badgeFormat, - badgeStyle, - pad + badgeName + pad, - resetStyle - ); - args.unshift(console); - return bind.apply(console[methodName], args); - } function FiberRootNode( containerInfo, tag, @@ -24722,11 +24811,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-canary-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-canary-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24763,10 +24852,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213" + reconcilerVersion: "19.1.0-canary-32b0cad8-20250213" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25240,7 +25329,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js index 937a88fe88ada4..796bd201ca668f 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js @@ -15898,14 +15898,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1858 = React.version; if ( - "19.1.0-canary-cbbe8666-20250213" !== + "19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion$jscomp$inline_1858 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1858, - "19.1.0-canary-cbbe8666-20250213" + "19.1.0-canary-32b0cad8-20250213" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15927,10 +15927,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_1865 = { bundleType: 0, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-32b0cad8-20250213", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213", + reconcilerVersion: "19.1.0-canary-32b0cad8-20250213", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$281 = 0; @@ -16210,7 +16210,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js index feb435649e3cc5..b53d19f6f92501 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js @@ -4183,6 +4183,27 @@ "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeComponentStackByType(type) { if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) @@ -4222,18 +4243,6 @@ } return ""; } - function getStackByComponentStackNode(componentStack) { - try { - var info = ""; - do - (info += describeComponentStackByType(componentStack.type)), - (componentStack = componentStack.parent); - while (componentStack); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } function defaultErrorHandler(error) { if ( "object" === typeof error && @@ -4348,7 +4357,9 @@ null, emptyTreeContext, null, - !1 + !1, + emptyContextObject, + null ); pushComponentStack(children); resumableState.pingedTasks.push(children); @@ -4401,7 +4412,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4427,6 +4440,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4444,7 +4458,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4471,6 +4487,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4497,22 +4514,63 @@ }; } function getCurrentStackInDEV() { - return null === currentTaskInDEV || - null === currentTaskInDEV.componentStack - ? "" - : getStackByComponentStackNode(currentTaskInDEV.componentStack); + if (null === currentTaskInDEV || null === currentTaskInDEV.componentStack) + return ""; + var componentStack = currentTaskInDEV.componentStack; + try { + var info = ""; + if ("string" === typeof componentStack.type) + info += describeBuiltInComponentFrame(componentStack.type); + else if ("function" === typeof componentStack.type) { + if (!componentStack.owner) { + var JSCompiler_temp_const = info, + fn = componentStack.type, + name = fn ? fn.displayName || fn.name : ""; + var JSCompiler_inline_result = name + ? describeBuiltInComponentFrame(name) + : ""; + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } else + componentStack.owner || + (info += describeComponentStackByType(componentStack.type)); + for (; componentStack; ) + (JSCompiler_temp_const = null), + null != componentStack.debugStack + ? (JSCompiler_temp_const = formatOwnerStack( + componentStack.debugStack + )) + : ((JSCompiler_inline_result = componentStack), + null != JSCompiler_inline_result.stack && + (JSCompiler_temp_const = + "string" !== typeof JSCompiler_inline_result.stack + ? (JSCompiler_inline_result.stack = formatOwnerStack( + JSCompiler_inline_result.stack + )) + : JSCompiler_inline_result.stack)), + (componentStack = componentStack.owner) && + JSCompiler_temp_const && + (info += "\n" + JSCompiler_temp_const); + var JSCompiler_inline_result$jscomp$0 = info; + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function pushServerComponentStack(task, debugInfo) { if (null != debugInfo) for (var i = 0; i < debugInfo.length; i++) { var componentInfo = debugInfo[i]; "string" === typeof componentInfo.name && - (task.componentStack = { + void 0 !== componentInfo.debugStack && + ((task.componentStack = { parent: task.componentStack, type: componentInfo, owner: componentInfo.owner, - stack: null - }); + stack: componentInfo.debugStack + }), + (task.debugTask = componentInfo.debugTask)); } } function pushComponentStack(task) { @@ -4521,13 +4579,15 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - owner = node._owner; + owner = node._owner, + stack = node._debugStack; pushServerComponentStack(task, node._debugInfo); + task.debugTask = node._debugTask; task.componentStack = { parent: task.componentStack, type: type, owner: owner, - stack: null + stack: stack }; break; case REACT_LAZY_TYPE: @@ -4538,14 +4598,24 @@ pushServerComponentStack(task, node._debugInfo); } } - function getThrownInfo(node) { + function getThrownInfo(node$jscomp$0) { var errorInfo = {}; - node && + node$jscomp$0 && Object.defineProperty(errorInfo, "componentStack", { configurable: !0, enumerable: !0, get: function () { - var stack = getStackByComponentStackNode(node); + try { + var info = "", + node = node$jscomp$0; + do + (info += describeComponentStackByType(node.type)), + (node = node.parent); + while (node); + var stack = info; + } catch (x) { + stack = "\nError generating stack: " + x.message + "\n" + x.stack; + } Object.defineProperty(errorInfo, "componentStack", { value: stack }); @@ -4576,9 +4646,11 @@ boundary.errorStack = null !== error ? wasAborted + error : null; boundary.errorComponentStack = thrownInfo.componentStack; } - function logRecoverableError(request, error, errorInfo) { + function logRecoverableError(request, error, errorInfo, debugTask) { request = request.onError; - error = request(error, errorInfo); + error = debugTask + ? debugTask.run(request.bind(null, error, errorInfo)) + : request(error, errorInfo); if (null != error && "string" !== typeof error) console.error( 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "%s" instead', @@ -4586,11 +4658,13 @@ ); else return error; } - function fatalError(request, error) { - var onShellError = request.onShellError, - onFatalError = request.onFatalError; - onShellError(error); - onFatalError(error); + function fatalError(request, error, errorInfo, debugTask) { + errorInfo = request.onShellError; + var onFatalError = request.onFatalError; + debugTask + ? (debugTask.run(errorInfo.bind(null, error)), + debugTask.run(onFatalError.bind(null, error))) + : (errorInfo(error), onFatalError(error)); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) : ((request.status = 13), (request.fatalError = error)); @@ -5170,7 +5244,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(preambleTask); request.pingedTasks.push(preambleTask); @@ -5358,7 +5434,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedPrimaryTask); request.pingedTasks.push(suspendedPrimaryTask); @@ -5400,7 +5478,8 @@ var errorDigest = logRecoverableError( request, error, - thrownInfo + thrownInfo, + task.debugTask ); encodeErrorForBoundary( newBoundary, @@ -5432,7 +5511,9 @@ task.context, task.treeContext, task.componentStack, - !0 + !0, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedFallbackTask); request.pingedTasks.push(suspendedFallbackTask); @@ -5584,15 +5665,183 @@ (task.replay = prevReplay), (task.blockedSegment = null); } } + function replayElement( + request, + task, + keyPath, + name, + keyOrIndex, + childIndex, + type, + props, + ref, + replay + ) { + childIndex = replay.nodes; + for (var i = 0; i < childIndex.length; i++) { + var node = childIndex[i]; + if (keyOrIndex === node[1]) { + if (4 === node.length) { + if (null !== name && name !== node[0]) + throw Error( + "Expected the resume to render <" + + node[0] + + "> in this slot but instead it rendered <" + + name + + ">. The tree doesn't match so React will fallback to client rendering." + ); + var childNodes = node[2]; + node = node[3]; + name = task.node; + task.replay = { nodes: childNodes, slots: node, pendingTasks: 1 }; + try { + renderElement(request, task, keyPath, type, props, ref); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + } catch (x) { + if ( + "object" === typeof x && + null !== x && + (x === SuspenseException || "function" === typeof x.then) + ) + throw (task.node === name && (task.replay = replay), x); + task.replay.pendingTasks--; + type = getThrownInfo(task.componentStack); + props = request; + request = task.blockedBoundary; + keyPath = x; + ref = node; + node = logRecoverableError(props, keyPath, type, task.debugTask); + abortRemainingReplayNodes( + props, + request, + childNodes, + ref, + keyPath, + node, + type, + !1 + ); + } + task.replay = replay; + } else { + if (type !== REACT_SUSPENSE_TYPE) + throw Error( + "Expected the resume to render in this slot but instead it rendered <" + + (getComponentNameFromType(type) || "Unknown") + + ">. The tree doesn't match so React will fallback to client rendering." + ); + a: { + replay = void 0; + type = node[5]; + ref = node[2]; + name = node[3]; + keyOrIndex = null === node[4] ? [] : node[4][2]; + node = null === node[4] ? null : node[4][3]; + var prevKeyPath = task.keyPath, + previousReplaySet = task.replay, + parentBoundary = task.blockedBoundary, + parentHoistableState = task.hoistableState, + content = props.children, + fallback = props.fallback, + fallbackAbortSet = new Set(); + props = + task.formatContext.insertionMode < HTML_MODE + ? createSuspenseBoundary( + request, + fallbackAbortSet, + createPreambleState(), + createPreambleState() + ) + : createSuspenseBoundary( + request, + fallbackAbortSet, + null, + null + ); + props.parentFlushed = !0; + props.rootSegmentID = type; + task.blockedBoundary = props; + task.hoistableState = props.contentState; + task.keyPath = keyPath; + task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; + try { + renderNode(request, task, content, -1); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + if (0 === props.pendingTasks && props.status === PENDING) { + props.status = COMPLETED; + request.completedBoundaries.push(props); + break a; + } + } catch (error) { + (props.status = CLIENT_RENDERED), + (childNodes = getThrownInfo(task.componentStack)), + (replay = logRecoverableError( + request, + error, + childNodes, + task.debugTask + )), + encodeErrorForBoundary(props, replay, error, childNodes, !1), + task.replay.pendingTasks--, + request.clientRenderedBoundaries.push(props); + } finally { + (task.blockedBoundary = parentBoundary), + (task.hoistableState = parentHoistableState), + (task.replay = previousReplaySet), + (task.keyPath = prevKeyPath); + } + props = createReplayTask( + request, + null, + { nodes: keyOrIndex, slots: node, pendingTasks: 0 }, + fallback, + -1, + parentBoundary, + props.fallbackState, + fallbackAbortSet, + [keyPath[0], "Suspense Fallback", keyPath[2]], + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + !0, + emptyContextObject, + task.debugTask + ); + pushComponentStack(props); + request.pingedTasks.push(props); + } + } + childIndex.splice(i, 1); + break; + } + } + } function renderNodeDestructive(request, task, node, childIndex) { null !== task.replay && "number" === typeof task.replay.slots ? resumeNode(request, task, task.replay.slots, node, childIndex) : ((task.node = node), (task.childIndex = childIndex), (node = task.componentStack), + (childIndex = task.debugTask), pushComponentStack(task), retryNode(request, task), - (task.componentStack = node)); + (task.componentStack = node), + (task.debugTask = childIndex)); } function retryNode(request, task) { var node = task.node, @@ -5602,178 +5851,56 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - key = node.key, - props = node.props; - node = props.ref; - var ref = void 0 !== node ? node : null, - name = getComponentNameFromType(type), - keyOrIndex = - null == key ? (-1 === childIndex ? 0 : childIndex) : key, - keyPath = [task.keyPath, name, keyOrIndex]; - if (null !== task.replay) { - var replay = task.replay; - childIndex = replay.nodes; - for (node = 0; node < childIndex.length; node++) - if (((key = childIndex[node]), keyOrIndex === key[1])) { - if (4 === key.length) { - if (null !== name && name !== key[0]) - throw Error( - "Expected the resume to render <" + - key[0] + - "> in this slot but instead it rendered <" + - name + - ">. The tree doesn't match so React will fallback to client rendering." - ); - var childNodes = key[2]; - key = key[3]; - name = task.node; - task.replay = { - nodes: childNodes, - slots: key, - pendingTasks: 1 - }; - try { - renderElement(request, task, keyPath, type, props, ref); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - } catch (x) { - if ( - "object" === typeof x && - null !== x && - (x === SuspenseException || - "function" === typeof x.then) - ) - throw ( - (task.node === name && (task.replay = replay), x) - ); - task.replay.pendingTasks--; - props = getThrownInfo(task.componentStack); - erroredReplay( - request, - task.blockedBoundary, - x, - props, - childNodes, - key - ); - } - task.replay = replay; - } else { - if (type !== REACT_SUSPENSE_TYPE) - throw Error( - "Expected the resume to render in this slot but instead it rendered <" + - (getComponentNameFromType(type) || "Unknown") + - ">. The tree doesn't match so React will fallback to client rendering." - ); - a: { - type = void 0; - ref = key[5]; - replay = key[2]; - name = key[3]; - keyOrIndex = null === key[4] ? [] : key[4][2]; - key = null === key[4] ? null : key[4][3]; - var prevKeyPath = task.keyPath, - previousReplaySet = task.replay, - parentBoundary = task.blockedBoundary, - parentHoistableState = task.hoistableState, - content = props.children, - fallback = props.fallback, - fallbackAbortSet = new Set(); - props = - task.formatContext.insertionMode < HTML_MODE - ? createSuspenseBoundary( - request, - fallbackAbortSet, - createPreambleState(), - createPreambleState() - ) - : createSuspenseBoundary( - request, - fallbackAbortSet, - null, - null - ); - props.parentFlushed = !0; - props.rootSegmentID = ref; - task.blockedBoundary = props; - task.hoistableState = props.contentState; - task.keyPath = keyPath; - task.replay = { - nodes: replay, - slots: name, - pendingTasks: 1 - }; - try { - renderNode(request, task, content, -1); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - if ( - 0 === props.pendingTasks && - props.status === PENDING - ) { - props.status = COMPLETED; - request.completedBoundaries.push(props); - break a; - } - } catch (error) { - (props.status = CLIENT_RENDERED), - (childNodes = getThrownInfo(task.componentStack)), - (type = logRecoverableError( - request, - error, - childNodes - )), - encodeErrorForBoundary( - props, - type, - error, - childNodes, - !1 - ), - task.replay.pendingTasks--, - request.clientRenderedBoundaries.push(props); - } finally { - (task.blockedBoundary = parentBoundary), - (task.hoistableState = parentHoistableState), - (task.replay = previousReplaySet), - (task.keyPath = prevKeyPath); - } - childNodes = createReplayTask( - request, - null, - { nodes: keyOrIndex, slots: key, pendingTasks: 0 }, - fallback, - -1, - parentBoundary, - props.fallbackState, - fallbackAbortSet, - [keyPath[0], "Suspense Fallback", keyPath[2]], - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - !0 - ); - pushComponentStack(childNodes); - request.pingedTasks.push(childNodes); - } - } - childIndex.splice(node, 1); - break; - } - } else renderElement(request, task, keyPath, type, props, ref); + key = node.key; + node = node.props; + var refProp = node.ref; + refProp = void 0 !== refProp ? refProp : null; + var debugTask = task.debugTask, + name = getComponentNameFromType(type); + key = null == key ? (-1 === childIndex ? 0 : childIndex) : key; + var keyPath = [task.keyPath, name, key]; + null !== task.replay + ? debugTask + ? debugTask.run( + replayElement.bind( + null, + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + ) + : replayElement( + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + : debugTask + ? debugTask.run( + renderElement.bind( + null, + request, + task, + keyPath, + type, + node, + refProp + ) + ) + : renderElement(request, task, keyPath, type, node, refProp); return; case REACT_PORTAL_TYPE: throw Error( @@ -5790,21 +5917,20 @@ return; } null === node || "object" !== typeof node - ? (props = null) - : ((childNodes = + ? (key = null) + : ((type = (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || node["@@iterator"]), - (props = "function" === typeof childNodes ? childNodes : null)); - if (props && (childNodes = props.call(node))) { - if (childNodes === node) { + (key = "function" === typeof type ? type : null)); + if (key && (type = key.call(node))) { + if (type === node) { if ( -1 !== childIndex || null === task.componentStack || "function" !== typeof task.componentStack.type || "[object GeneratorFunction]" !== Object.prototype.toString.call(task.componentStack.type) || - "[object Generator]" !== - Object.prototype.toString.call(childNodes) + "[object Generator]" !== Object.prototype.toString.call(type) ) didWarnAboutGenerators || console.error( @@ -5812,18 +5938,18 @@ ), (didWarnAboutGenerators = !0); } else - node.entries !== props || + node.entries !== key || didWarnAboutMaps || (console.error( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ), (didWarnAboutMaps = !0)); - node = childNodes.next(); + node = type.next(); if (!node.done) { - props = []; - do props.push(node.value), (node = childNodes.next()); + key = []; + do key.push(node.value), (node = type.next()); while (!node.done); - renderChildrenArray(request, task, props, childIndex); + renderChildrenArray(request, task, key, childIndex); } return; } @@ -5844,39 +5970,39 @@ node._currentValue2, childIndex ); - childIndex = Object.prototype.toString.call(node); + request = Object.prototype.toString.call(node); throw Error( "Objects are not valid as a React child (found: " + - ("[object Object]" === childIndex + ("[object Object]" === request ? "object with keys {" + Object.keys(node).join(", ") + "}" - : childIndex) + + : request) + "). If you meant to render a collection of children, use an array instead." ); } "string" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : "number" === typeof node || "bigint" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, "" + node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : ("function" === typeof node && - ((childIndex = node.displayName || node.name || "Component"), + ((request = node.displayName || node.name || "Component"), console.error( "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.", - childIndex, - childIndex + request, + request )), "symbol" === typeof node && console.error( @@ -5885,9 +6011,10 @@ )); } } - function renderChildrenArray(request$jscomp$0, task, children, childIndex) { + function renderChildrenArray(request, task, children, childIndex) { var prevKeyPath = task.keyPath, previousComponentStack = task.componentStack; + var previousDebugTask = task.debugTask; pushServerComponentStack(task, task.node._debugInfo); if ( -1 !== childIndex && @@ -5905,7 +6032,7 @@ node = node[3]; task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 }; try { - renderChildrenArray(request$jscomp$0, task, children, -1); + renderChildrenArray(request, task, children, -1); if ( 1 === task.replay.pendingTasks && 0 < task.replay.nodes.length @@ -5922,14 +6049,25 @@ ) throw x; task.replay.pendingTasks--; - children = getThrownInfo(task.componentStack); - erroredReplay( - request$jscomp$0, - task.blockedBoundary, - x, + var thrownInfo = getThrownInfo(task.componentStack); + children = task.blockedBoundary; + var error = x, + resumeSlots = node; + node = logRecoverableError( + request, + error, + thrownInfo, + task.debugTask + ); + abortRemainingReplayNodes( + request, children, childIndex, - node + resumeSlots, + error, + node, + thrownInfo, + !1 ); } task.replay = replay; @@ -5939,6 +6077,7 @@ } task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } replay = task.treeContext; @@ -5947,98 +6086,98 @@ null !== task.replay && ((j = task.replay.slots), null !== j && "object" === typeof j) ) { - for (childIndex = 0; childIndex < replayNodes; childIndex++) { - node = children[childIndex]; - task.treeContext = pushTreeContext(replay, replayNodes, childIndex); - var resumeSegmentID = j[childIndex]; - "number" === typeof resumeSegmentID - ? (resumeNode( - request$jscomp$0, - task, - resumeSegmentID, - node, - childIndex - ), - delete j[childIndex]) - : renderNode(request$jscomp$0, task, node, childIndex); - } + for (childIndex = 0; childIndex < replayNodes; childIndex++) + (node = children[childIndex]), + (task.treeContext = pushTreeContext( + replay, + replayNodes, + childIndex + )), + (error = j[childIndex]), + "number" === typeof error + ? (resumeNode(request, task, error, node, childIndex), + delete j[childIndex]) + : renderNode(request, task, node, childIndex); task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } for (j = 0; j < replayNodes; j++) { childIndex = children[j]; - var request = request$jscomp$0; + resumeSlots = request; node = task; - resumeSegmentID = childIndex; + error = childIndex; if ( - null !== resumeSegmentID && - "object" === typeof resumeSegmentID && - (resumeSegmentID.$$typeof === REACT_ELEMENT_TYPE || - resumeSegmentID.$$typeof === REACT_PORTAL_TYPE) && - resumeSegmentID._store && - ((!resumeSegmentID._store.validated && null == resumeSegmentID.key) || - 2 === resumeSegmentID._store.validated) + null !== error && + "object" === typeof error && + (error.$$typeof === REACT_ELEMENT_TYPE || + error.$$typeof === REACT_PORTAL_TYPE) && + error._store && + ((!error._store.validated && null == error.key) || + 2 === error._store.validated) ) { - if ("object" !== typeof resumeSegmentID._store) + if ("object" !== typeof error._store) throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ); - resumeSegmentID._store.validated = 1; - var didWarnForKey = request.didWarnForKey; - null == didWarnForKey && - (didWarnForKey = request.didWarnForKey = new WeakSet()); - request = node.componentStack; - if (null !== request && !didWarnForKey.has(request)) { - didWarnForKey.add(request); - var componentName = getComponentNameFromType(resumeSegmentID.type); - didWarnForKey = resumeSegmentID._owner; - var parentOwner = request.owner; - request = ""; + error._store.validated = 1; + thrownInfo = resumeSlots.didWarnForKey; + null == thrownInfo && + (thrownInfo = resumeSlots.didWarnForKey = new WeakSet()); + resumeSlots = node.componentStack; + if (null !== resumeSlots && !thrownInfo.has(resumeSlots)) { + thrownInfo.add(resumeSlots); + var componentName = getComponentNameFromType(error.type); + thrownInfo = error._owner; + var parentOwner = resumeSlots.owner; + resumeSlots = ""; if (parentOwner && "undefined" !== typeof parentOwner.type) { var name = getComponentNameFromType(parentOwner.type); name && - (request = "\n\nCheck the render method of `" + name + "`."); + (resumeSlots = + "\n\nCheck the render method of `" + name + "`."); } - request || + resumeSlots || (componentName && - (request = + (resumeSlots = "\n\nCheck the top-level render call using <" + componentName + ">.")); componentName = ""; - null != didWarnForKey && - parentOwner !== didWarnForKey && + null != thrownInfo && + parentOwner !== thrownInfo && ((parentOwner = null), - "undefined" !== typeof didWarnForKey.type - ? (parentOwner = getComponentNameFromType(didWarnForKey.type)) - : "string" === typeof didWarnForKey.name && - (parentOwner = didWarnForKey.name), + "undefined" !== typeof thrownInfo.type + ? (parentOwner = getComponentNameFromType(thrownInfo.type)) + : "string" === typeof thrownInfo.name && + (parentOwner = thrownInfo.name), parentOwner && (componentName = " It was passed a child from " + parentOwner + ".")); - didWarnForKey = node.componentStack; + thrownInfo = node.componentStack; node.componentStack = { parent: node.componentStack, - type: resumeSegmentID.type, - owner: resumeSegmentID._owner, - stack: null + type: error.type, + owner: error._owner, + stack: error._debugStack }; console.error( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - request, + resumeSlots, componentName ); - node.componentStack = didWarnForKey; + node.componentStack = thrownInfo; } } task.treeContext = pushTreeContext(replay, replayNodes, j); - renderNode(request$jscomp$0, task, childIndex, j); + renderNode(request, task, childIndex, j); } task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; } function untrackBoundary(request, boundary) { request = request.trackedPostpones; @@ -6064,7 +6203,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function spawnNewSuspendedRenderTask(request, task, thenableState) { @@ -6094,7 +6235,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function renderNode(request, task, node, childIndex) { @@ -6103,6 +6246,7 @@ previousKeyPath = task.keyPath, previousTreeContext = task.treeContext, previousComponentStack = task.componentStack, + previousDebugTask = task.debugTask, segment = task.blockedSegment; if (null === segment) try { @@ -6129,6 +6273,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6141,6 +6286,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6175,6 +6321,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6187,6 +6334,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6200,26 +6348,6 @@ switchContext(previousContext); throw node; } - function erroredReplay( - request, - boundary, - error, - errorInfo, - replayNodes, - resumeSlots - ) { - var errorDigest = logRecoverableError(request, error, errorInfo); - abortRemainingReplayNodes( - request, - boundary, - replayNodes, - resumeSlots, - error, - errorDigest, - errorInfo, - !1 - ); - } function abortTaskSoft(task) { var boundary = task.blockedBoundary; task = task.blockedSegment; @@ -6308,14 +6436,14 @@ if (13 !== request.status && request.status !== CLOSED) { boundary = task.replay; if (null === boundary) { - logRecoverableError(request, error, segment); - fatalError(request, error); + logRecoverableError(request, error, segment, null); + fatalError(request, error, segment, null); return; } boundary.pendingTasks--; 0 === boundary.pendingTasks && 0 < boundary.nodes.length && - ((task = logRecoverableError(request, error, segment)), + ((task = logRecoverableError(request, error, segment, null)), abortRemainingReplayNodes( request, null, @@ -6333,7 +6461,7 @@ boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = logRecoverableError(request, error, segment)), + (task = logRecoverableError(request, error, segment, null)), (boundary.status = CLIENT_RENDERED), encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), @@ -6408,7 +6536,7 @@ } } } catch (error) { - logRecoverableError(request, error, {}); + logRecoverableError(request, error, {}, null); } } function completeShell(request) { @@ -6486,10 +6614,10 @@ request.allPendingTasks--; 0 === request.allPendingTasks && completeAll(request); } - function performWork(request$jscomp$1) { + function performWork(request$jscomp$2) { if ( - request$jscomp$1.status !== CLOSED && - 13 !== request$jscomp$1.status + request$jscomp$2.status !== CLOSED && + 13 !== request$jscomp$2.status ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; @@ -6497,16 +6625,16 @@ var prevAsyncDispatcher = ReactSharedInternals.A; ReactSharedInternals.A = DefaultAsyncDispatcher; var prevRequest = currentRequest; - currentRequest = request$jscomp$1; + currentRequest = request$jscomp$2; var prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; var prevResumableState = currentResumableState; - currentResumableState = request$jscomp$1.resumableState; + currentResumableState = request$jscomp$2.resumableState; try { - var pingedTasks = request$jscomp$1.pingedTasks, + var pingedTasks = request$jscomp$2.pingedTasks, i; for (i = 0; i < pingedTasks.length; i++) { - var request = request$jscomp$1, + var request = request$jscomp$2, task = pingedTasks[i], segment = task.blockedSegment; if (null === segment) { @@ -6554,16 +6682,32 @@ } else { request.replay.pendingTasks--; request.abortSet.delete(request); - var errorInfo = getThrownInfo(request.componentStack); - erroredReplay( - request$jscomp$0, - request.blockedBoundary, - 12 === request$jscomp$0.status - ? request$jscomp$0.fatalError - : x, - errorInfo, - request.replay.nodes, - request.replay.slots + var errorInfo = getThrownInfo(request.componentStack), + errorDigest = void 0, + request$jscomp$1 = request$jscomp$0, + boundary = request.blockedBoundary, + error$jscomp$0 = + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, + errorInfo$jscomp$0 = errorInfo, + replayNodes = request.replay.nodes, + resumeSlots = request.replay.slots; + errorDigest = logRecoverableError( + request$jscomp$1, + error$jscomp$0, + errorInfo$jscomp$0, + request.debugTask + ); + abortRemainingReplayNodes( + request$jscomp$1, + boundary, + replayNodes, + resumeSlots, + error$jscomp$0, + errorDigest, + errorInfo$jscomp$0, + !1 ); request$jscomp$0.pendingRootTasks--; 0 === request$jscomp$0.pendingRootTasks && @@ -6576,101 +6720,110 @@ currentTaskInDEV = prevTaskInDEV; } } - } else { - request$jscomp$0 = prevTaskInDEV = void 0; - var task$jscomp$0 = task, - segment$jscomp$0 = segment; - if (segment$jscomp$0.status === PENDING) { - segment$jscomp$0.status = 6; - switchContext(task$jscomp$0.context); - request$jscomp$0 = currentTaskInDEV; - currentTaskInDEV = task$jscomp$0; - var childrenLength = segment$jscomp$0.children.length, - chunkLength = segment$jscomp$0.chunks.length; - try { - retryNode(request, task$jscomp$0), - pushSegmentFinale( - segment$jscomp$0.chunks, - request.renderState, - segment$jscomp$0.lastPushedText, - segment$jscomp$0.textEmbedded - ), - task$jscomp$0.abortSet.delete(task$jscomp$0), - (segment$jscomp$0.status = COMPLETED), - finishedTask( - request, - task$jscomp$0.blockedBoundary, - segment$jscomp$0 - ); - } catch (thrownValue) { - resetHooksState(); - segment$jscomp$0.children.length = childrenLength; - segment$jscomp$0.chunks.length = chunkLength; - var x$jscomp$0 = - thrownValue === SuspenseException - ? getSuspendedThenable() - : 12 === request.status - ? request.fatalError - : thrownValue; - if ( - "object" === typeof x$jscomp$0 && - null !== x$jscomp$0 && - "function" === typeof x$jscomp$0.then - ) { - segment$jscomp$0.status = PENDING; - task$jscomp$0.thenableState = - getThenableStateAfterSuspending(); - var ping$jscomp$0 = task$jscomp$0.ping; - x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); - } else { - var errorInfo$jscomp$0 = getThrownInfo( - task$jscomp$0.componentStack - ); - task$jscomp$0.abortSet.delete(task$jscomp$0); - segment$jscomp$0.status = 4; - var boundary = task$jscomp$0.blockedBoundary; - prevTaskInDEV = logRecoverableError( - request, - x$jscomp$0, - errorInfo$jscomp$0 - ); - null === boundary - ? fatalError(request, x$jscomp$0) - : (boundary.pendingTasks--, - boundary.status !== CLIENT_RENDERED && - ((boundary.status = CLIENT_RENDERED), - encodeErrorForBoundary( - boundary, - prevTaskInDEV, - x$jscomp$0, - errorInfo$jscomp$0, - !1 + } else if ( + ((request$jscomp$0 = prevTaskInDEV = void 0), + (errorDigest = task), + (request$jscomp$1 = segment), + request$jscomp$1.status === PENDING) + ) { + request$jscomp$1.status = 6; + switchContext(errorDigest.context); + request$jscomp$0 = currentTaskInDEV; + currentTaskInDEV = errorDigest; + var childrenLength = request$jscomp$1.children.length, + chunkLength = request$jscomp$1.chunks.length; + try { + retryNode(request, errorDigest), + pushSegmentFinale( + request$jscomp$1.chunks, + request.renderState, + request$jscomp$1.lastPushedText, + request$jscomp$1.textEmbedded + ), + errorDigest.abortSet.delete(errorDigest), + (request$jscomp$1.status = COMPLETED), + finishedTask( + request, + errorDigest.blockedBoundary, + request$jscomp$1 + ); + } catch (thrownValue) { + resetHooksState(); + request$jscomp$1.children.length = childrenLength; + request$jscomp$1.chunks.length = chunkLength; + var x$jscomp$0 = + thrownValue === SuspenseException + ? getSuspendedThenable() + : 12 === request.status + ? request.fatalError + : thrownValue; + if ( + "object" === typeof x$jscomp$0 && + null !== x$jscomp$0 && + "function" === typeof x$jscomp$0.then + ) { + request$jscomp$1.status = PENDING; + errorDigest.thenableState = getThenableStateAfterSuspending(); + var ping$jscomp$0 = errorDigest.ping; + x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); + } else { + var errorInfo$jscomp$1 = getThrownInfo( + errorDigest.componentStack + ); + errorDigest.abortSet.delete(errorDigest); + request$jscomp$1.status = 4; + var boundary$jscomp$0 = errorDigest.blockedBoundary, + debugTask = errorDigest.debugTask; + prevTaskInDEV = logRecoverableError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ); + null === boundary$jscomp$0 + ? fatalError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ) + : (boundary$jscomp$0.pendingTasks--, + boundary$jscomp$0.status !== CLIENT_RENDERED && + ((boundary$jscomp$0.status = CLIENT_RENDERED), + encodeErrorForBoundary( + boundary$jscomp$0, + prevTaskInDEV, + x$jscomp$0, + errorInfo$jscomp$1, + !1 + ), + untrackBoundary(request, boundary$jscomp$0), + boundary$jscomp$0.parentFlushed && + request.clientRenderedBoundaries.push( + boundary$jscomp$0 ), - untrackBoundary(request, boundary), - boundary.parentFlushed && - request.clientRenderedBoundaries.push(boundary), - 0 === request.pendingRootTasks && - null === request.trackedPostpones && - null !== boundary.contentPreamble && - preparePreamble(request))); - request.allPendingTasks--; - 0 === request.allPendingTasks && completeAll(request); - } - } finally { - currentTaskInDEV = request$jscomp$0; + 0 === request.pendingRootTasks && + null === request.trackedPostpones && + null !== boundary$jscomp$0.contentPreamble && + preparePreamble(request))); + request.allPendingTasks--; + 0 === request.allPendingTasks && completeAll(request); } + } finally { + currentTaskInDEV = request$jscomp$0; } } } pingedTasks.splice(0, i); - null !== request$jscomp$1.destination && + null !== request$jscomp$2.destination && flushCompletedQueues( - request$jscomp$1, - request$jscomp$1.destination + request$jscomp$2, + request$jscomp$2.destination ); } catch (error) { - logRecoverableError(request$jscomp$1, error, {}), - fatalError(request$jscomp$1, error); + (pingedTasks = {}), + logRecoverableError(request$jscomp$2, error, pingedTasks, null), + fatalError(request$jscomp$2, error, pingedTasks, null); } finally { (currentResumableState = prevResumableState), (ReactSharedInternals.H = prevDispatcher), @@ -7330,7 +7483,9 @@ try { flushCompletedQueues(request, destination); } catch (error) { - logRecoverableError(request, error, {}), fatalError(request, error); + (destination = {}), + logRecoverableError(request, error, destination, null), + fatalError(request, error, destination, null); } } } @@ -7356,7 +7511,9 @@ null !== request.destination && flushCompletedQueues(request, request.destination); } catch (error$4) { - logRecoverableError(request, error$4, {}), fatalError(request, error$4); + (reason = {}), + logRecoverableError(request, error$4, reason, null), + fatalError(request, error$4, reason, null); } } function onError() {} @@ -8851,5 +9008,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js index e2858d83acd12a..cabefd57a45796 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js @@ -5885,4 +5885,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js index bff25a37072169..684aebc7b24bf0 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js @@ -4183,6 +4183,27 @@ "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeComponentStackByType(type) { if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) @@ -4222,18 +4243,6 @@ } return ""; } - function getStackByComponentStackNode(componentStack) { - try { - var info = ""; - do - (info += describeComponentStackByType(componentStack.type)), - (componentStack = componentStack.parent); - while (componentStack); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } function defaultErrorHandler(error) { if ( "object" === typeof error && @@ -4348,7 +4357,9 @@ null, emptyTreeContext, null, - !1 + !1, + emptyContextObject, + null ); pushComponentStack(children); resumableState.pingedTasks.push(children); @@ -4401,7 +4412,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4427,6 +4440,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4444,7 +4458,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4471,6 +4487,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4497,22 +4514,63 @@ }; } function getCurrentStackInDEV() { - return null === currentTaskInDEV || - null === currentTaskInDEV.componentStack - ? "" - : getStackByComponentStackNode(currentTaskInDEV.componentStack); + if (null === currentTaskInDEV || null === currentTaskInDEV.componentStack) + return ""; + var componentStack = currentTaskInDEV.componentStack; + try { + var info = ""; + if ("string" === typeof componentStack.type) + info += describeBuiltInComponentFrame(componentStack.type); + else if ("function" === typeof componentStack.type) { + if (!componentStack.owner) { + var JSCompiler_temp_const = info, + fn = componentStack.type, + name = fn ? fn.displayName || fn.name : ""; + var JSCompiler_inline_result = name + ? describeBuiltInComponentFrame(name) + : ""; + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } else + componentStack.owner || + (info += describeComponentStackByType(componentStack.type)); + for (; componentStack; ) + (JSCompiler_temp_const = null), + null != componentStack.debugStack + ? (JSCompiler_temp_const = formatOwnerStack( + componentStack.debugStack + )) + : ((JSCompiler_inline_result = componentStack), + null != JSCompiler_inline_result.stack && + (JSCompiler_temp_const = + "string" !== typeof JSCompiler_inline_result.stack + ? (JSCompiler_inline_result.stack = formatOwnerStack( + JSCompiler_inline_result.stack + )) + : JSCompiler_inline_result.stack)), + (componentStack = componentStack.owner) && + JSCompiler_temp_const && + (info += "\n" + JSCompiler_temp_const); + var JSCompiler_inline_result$jscomp$0 = info; + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function pushServerComponentStack(task, debugInfo) { if (null != debugInfo) for (var i = 0; i < debugInfo.length; i++) { var componentInfo = debugInfo[i]; "string" === typeof componentInfo.name && - (task.componentStack = { + void 0 !== componentInfo.debugStack && + ((task.componentStack = { parent: task.componentStack, type: componentInfo, owner: componentInfo.owner, - stack: null - }); + stack: componentInfo.debugStack + }), + (task.debugTask = componentInfo.debugTask)); } } function pushComponentStack(task) { @@ -4521,13 +4579,15 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - owner = node._owner; + owner = node._owner, + stack = node._debugStack; pushServerComponentStack(task, node._debugInfo); + task.debugTask = node._debugTask; task.componentStack = { parent: task.componentStack, type: type, owner: owner, - stack: null + stack: stack }; break; case REACT_LAZY_TYPE: @@ -4538,14 +4598,24 @@ pushServerComponentStack(task, node._debugInfo); } } - function getThrownInfo(node) { + function getThrownInfo(node$jscomp$0) { var errorInfo = {}; - node && + node$jscomp$0 && Object.defineProperty(errorInfo, "componentStack", { configurable: !0, enumerable: !0, get: function () { - var stack = getStackByComponentStackNode(node); + try { + var info = "", + node = node$jscomp$0; + do + (info += describeComponentStackByType(node.type)), + (node = node.parent); + while (node); + var stack = info; + } catch (x) { + stack = "\nError generating stack: " + x.message + "\n" + x.stack; + } Object.defineProperty(errorInfo, "componentStack", { value: stack }); @@ -4576,9 +4646,11 @@ boundary.errorStack = null !== error ? wasAborted + error : null; boundary.errorComponentStack = thrownInfo.componentStack; } - function logRecoverableError(request, error, errorInfo) { + function logRecoverableError(request, error, errorInfo, debugTask) { request = request.onError; - error = request(error, errorInfo); + error = debugTask + ? debugTask.run(request.bind(null, error, errorInfo)) + : request(error, errorInfo); if (null != error && "string" !== typeof error) console.error( 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "%s" instead', @@ -4586,11 +4658,13 @@ ); else return error; } - function fatalError(request, error) { - var onShellError = request.onShellError, - onFatalError = request.onFatalError; - onShellError(error); - onFatalError(error); + function fatalError(request, error, errorInfo, debugTask) { + errorInfo = request.onShellError; + var onFatalError = request.onFatalError; + debugTask + ? (debugTask.run(errorInfo.bind(null, error)), + debugTask.run(onFatalError.bind(null, error))) + : (errorInfo(error), onFatalError(error)); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) : ((request.status = 13), (request.fatalError = error)); @@ -5170,7 +5244,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(preambleTask); request.pingedTasks.push(preambleTask); @@ -5358,7 +5434,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedPrimaryTask); request.pingedTasks.push(suspendedPrimaryTask); @@ -5400,7 +5478,8 @@ var errorDigest = logRecoverableError( request, error, - thrownInfo + thrownInfo, + task.debugTask ); encodeErrorForBoundary( newBoundary, @@ -5432,7 +5511,9 @@ task.context, task.treeContext, task.componentStack, - !0 + !0, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedFallbackTask); request.pingedTasks.push(suspendedFallbackTask); @@ -5584,15 +5665,183 @@ (task.replay = prevReplay), (task.blockedSegment = null); } } + function replayElement( + request, + task, + keyPath, + name, + keyOrIndex, + childIndex, + type, + props, + ref, + replay + ) { + childIndex = replay.nodes; + for (var i = 0; i < childIndex.length; i++) { + var node = childIndex[i]; + if (keyOrIndex === node[1]) { + if (4 === node.length) { + if (null !== name && name !== node[0]) + throw Error( + "Expected the resume to render <" + + node[0] + + "> in this slot but instead it rendered <" + + name + + ">. The tree doesn't match so React will fallback to client rendering." + ); + var childNodes = node[2]; + node = node[3]; + name = task.node; + task.replay = { nodes: childNodes, slots: node, pendingTasks: 1 }; + try { + renderElement(request, task, keyPath, type, props, ref); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + } catch (x) { + if ( + "object" === typeof x && + null !== x && + (x === SuspenseException || "function" === typeof x.then) + ) + throw (task.node === name && (task.replay = replay), x); + task.replay.pendingTasks--; + type = getThrownInfo(task.componentStack); + props = request; + request = task.blockedBoundary; + keyPath = x; + ref = node; + node = logRecoverableError(props, keyPath, type, task.debugTask); + abortRemainingReplayNodes( + props, + request, + childNodes, + ref, + keyPath, + node, + type, + !1 + ); + } + task.replay = replay; + } else { + if (type !== REACT_SUSPENSE_TYPE) + throw Error( + "Expected the resume to render in this slot but instead it rendered <" + + (getComponentNameFromType(type) || "Unknown") + + ">. The tree doesn't match so React will fallback to client rendering." + ); + a: { + replay = void 0; + type = node[5]; + ref = node[2]; + name = node[3]; + keyOrIndex = null === node[4] ? [] : node[4][2]; + node = null === node[4] ? null : node[4][3]; + var prevKeyPath = task.keyPath, + previousReplaySet = task.replay, + parentBoundary = task.blockedBoundary, + parentHoistableState = task.hoistableState, + content = props.children, + fallback = props.fallback, + fallbackAbortSet = new Set(); + props = + task.formatContext.insertionMode < HTML_MODE + ? createSuspenseBoundary( + request, + fallbackAbortSet, + createPreambleState(), + createPreambleState() + ) + : createSuspenseBoundary( + request, + fallbackAbortSet, + null, + null + ); + props.parentFlushed = !0; + props.rootSegmentID = type; + task.blockedBoundary = props; + task.hoistableState = props.contentState; + task.keyPath = keyPath; + task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; + try { + renderNode(request, task, content, -1); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + if (0 === props.pendingTasks && props.status === PENDING) { + props.status = COMPLETED; + request.completedBoundaries.push(props); + break a; + } + } catch (error) { + (props.status = CLIENT_RENDERED), + (childNodes = getThrownInfo(task.componentStack)), + (replay = logRecoverableError( + request, + error, + childNodes, + task.debugTask + )), + encodeErrorForBoundary(props, replay, error, childNodes, !1), + task.replay.pendingTasks--, + request.clientRenderedBoundaries.push(props); + } finally { + (task.blockedBoundary = parentBoundary), + (task.hoistableState = parentHoistableState), + (task.replay = previousReplaySet), + (task.keyPath = prevKeyPath); + } + props = createReplayTask( + request, + null, + { nodes: keyOrIndex, slots: node, pendingTasks: 0 }, + fallback, + -1, + parentBoundary, + props.fallbackState, + fallbackAbortSet, + [keyPath[0], "Suspense Fallback", keyPath[2]], + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + !0, + emptyContextObject, + task.debugTask + ); + pushComponentStack(props); + request.pingedTasks.push(props); + } + } + childIndex.splice(i, 1); + break; + } + } + } function renderNodeDestructive(request, task, node, childIndex) { null !== task.replay && "number" === typeof task.replay.slots ? resumeNode(request, task, task.replay.slots, node, childIndex) : ((task.node = node), (task.childIndex = childIndex), (node = task.componentStack), + (childIndex = task.debugTask), pushComponentStack(task), retryNode(request, task), - (task.componentStack = node)); + (task.componentStack = node), + (task.debugTask = childIndex)); } function retryNode(request, task) { var node = task.node, @@ -5602,178 +5851,56 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - key = node.key, - props = node.props; - node = props.ref; - var ref = void 0 !== node ? node : null, - name = getComponentNameFromType(type), - keyOrIndex = - null == key ? (-1 === childIndex ? 0 : childIndex) : key, - keyPath = [task.keyPath, name, keyOrIndex]; - if (null !== task.replay) { - var replay = task.replay; - childIndex = replay.nodes; - for (node = 0; node < childIndex.length; node++) - if (((key = childIndex[node]), keyOrIndex === key[1])) { - if (4 === key.length) { - if (null !== name && name !== key[0]) - throw Error( - "Expected the resume to render <" + - key[0] + - "> in this slot but instead it rendered <" + - name + - ">. The tree doesn't match so React will fallback to client rendering." - ); - var childNodes = key[2]; - key = key[3]; - name = task.node; - task.replay = { - nodes: childNodes, - slots: key, - pendingTasks: 1 - }; - try { - renderElement(request, task, keyPath, type, props, ref); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - } catch (x) { - if ( - "object" === typeof x && - null !== x && - (x === SuspenseException || - "function" === typeof x.then) - ) - throw ( - (task.node === name && (task.replay = replay), x) - ); - task.replay.pendingTasks--; - props = getThrownInfo(task.componentStack); - erroredReplay( - request, - task.blockedBoundary, - x, - props, - childNodes, - key - ); - } - task.replay = replay; - } else { - if (type !== REACT_SUSPENSE_TYPE) - throw Error( - "Expected the resume to render in this slot but instead it rendered <" + - (getComponentNameFromType(type) || "Unknown") + - ">. The tree doesn't match so React will fallback to client rendering." - ); - a: { - type = void 0; - ref = key[5]; - replay = key[2]; - name = key[3]; - keyOrIndex = null === key[4] ? [] : key[4][2]; - key = null === key[4] ? null : key[4][3]; - var prevKeyPath = task.keyPath, - previousReplaySet = task.replay, - parentBoundary = task.blockedBoundary, - parentHoistableState = task.hoistableState, - content = props.children, - fallback = props.fallback, - fallbackAbortSet = new Set(); - props = - task.formatContext.insertionMode < HTML_MODE - ? createSuspenseBoundary( - request, - fallbackAbortSet, - createPreambleState(), - createPreambleState() - ) - : createSuspenseBoundary( - request, - fallbackAbortSet, - null, - null - ); - props.parentFlushed = !0; - props.rootSegmentID = ref; - task.blockedBoundary = props; - task.hoistableState = props.contentState; - task.keyPath = keyPath; - task.replay = { - nodes: replay, - slots: name, - pendingTasks: 1 - }; - try { - renderNode(request, task, content, -1); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - if ( - 0 === props.pendingTasks && - props.status === PENDING - ) { - props.status = COMPLETED; - request.completedBoundaries.push(props); - break a; - } - } catch (error) { - (props.status = CLIENT_RENDERED), - (childNodes = getThrownInfo(task.componentStack)), - (type = logRecoverableError( - request, - error, - childNodes - )), - encodeErrorForBoundary( - props, - type, - error, - childNodes, - !1 - ), - task.replay.pendingTasks--, - request.clientRenderedBoundaries.push(props); - } finally { - (task.blockedBoundary = parentBoundary), - (task.hoistableState = parentHoistableState), - (task.replay = previousReplaySet), - (task.keyPath = prevKeyPath); - } - childNodes = createReplayTask( - request, - null, - { nodes: keyOrIndex, slots: key, pendingTasks: 0 }, - fallback, - -1, - parentBoundary, - props.fallbackState, - fallbackAbortSet, - [keyPath[0], "Suspense Fallback", keyPath[2]], - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - !0 - ); - pushComponentStack(childNodes); - request.pingedTasks.push(childNodes); - } - } - childIndex.splice(node, 1); - break; - } - } else renderElement(request, task, keyPath, type, props, ref); + key = node.key; + node = node.props; + var refProp = node.ref; + refProp = void 0 !== refProp ? refProp : null; + var debugTask = task.debugTask, + name = getComponentNameFromType(type); + key = null == key ? (-1 === childIndex ? 0 : childIndex) : key; + var keyPath = [task.keyPath, name, key]; + null !== task.replay + ? debugTask + ? debugTask.run( + replayElement.bind( + null, + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + ) + : replayElement( + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + : debugTask + ? debugTask.run( + renderElement.bind( + null, + request, + task, + keyPath, + type, + node, + refProp + ) + ) + : renderElement(request, task, keyPath, type, node, refProp); return; case REACT_PORTAL_TYPE: throw Error( @@ -5790,21 +5917,20 @@ return; } null === node || "object" !== typeof node - ? (props = null) - : ((childNodes = + ? (key = null) + : ((type = (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || node["@@iterator"]), - (props = "function" === typeof childNodes ? childNodes : null)); - if (props && (childNodes = props.call(node))) { - if (childNodes === node) { + (key = "function" === typeof type ? type : null)); + if (key && (type = key.call(node))) { + if (type === node) { if ( -1 !== childIndex || null === task.componentStack || "function" !== typeof task.componentStack.type || "[object GeneratorFunction]" !== Object.prototype.toString.call(task.componentStack.type) || - "[object Generator]" !== - Object.prototype.toString.call(childNodes) + "[object Generator]" !== Object.prototype.toString.call(type) ) didWarnAboutGenerators || console.error( @@ -5812,18 +5938,18 @@ ), (didWarnAboutGenerators = !0); } else - node.entries !== props || + node.entries !== key || didWarnAboutMaps || (console.error( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ), (didWarnAboutMaps = !0)); - node = childNodes.next(); + node = type.next(); if (!node.done) { - props = []; - do props.push(node.value), (node = childNodes.next()); + key = []; + do key.push(node.value), (node = type.next()); while (!node.done); - renderChildrenArray(request, task, props, childIndex); + renderChildrenArray(request, task, key, childIndex); } return; } @@ -5844,39 +5970,39 @@ node._currentValue2, childIndex ); - childIndex = Object.prototype.toString.call(node); + request = Object.prototype.toString.call(node); throw Error( "Objects are not valid as a React child (found: " + - ("[object Object]" === childIndex + ("[object Object]" === request ? "object with keys {" + Object.keys(node).join(", ") + "}" - : childIndex) + + : request) + "). If you meant to render a collection of children, use an array instead." ); } "string" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : "number" === typeof node || "bigint" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, "" + node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : ("function" === typeof node && - ((childIndex = node.displayName || node.name || "Component"), + ((request = node.displayName || node.name || "Component"), console.error( "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.", - childIndex, - childIndex + request, + request )), "symbol" === typeof node && console.error( @@ -5885,9 +6011,10 @@ )); } } - function renderChildrenArray(request$jscomp$0, task, children, childIndex) { + function renderChildrenArray(request, task, children, childIndex) { var prevKeyPath = task.keyPath, previousComponentStack = task.componentStack; + var previousDebugTask = task.debugTask; pushServerComponentStack(task, task.node._debugInfo); if ( -1 !== childIndex && @@ -5905,7 +6032,7 @@ node = node[3]; task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 }; try { - renderChildrenArray(request$jscomp$0, task, children, -1); + renderChildrenArray(request, task, children, -1); if ( 1 === task.replay.pendingTasks && 0 < task.replay.nodes.length @@ -5922,14 +6049,25 @@ ) throw x; task.replay.pendingTasks--; - children = getThrownInfo(task.componentStack); - erroredReplay( - request$jscomp$0, - task.blockedBoundary, - x, + var thrownInfo = getThrownInfo(task.componentStack); + children = task.blockedBoundary; + var error = x, + resumeSlots = node; + node = logRecoverableError( + request, + error, + thrownInfo, + task.debugTask + ); + abortRemainingReplayNodes( + request, children, childIndex, - node + resumeSlots, + error, + node, + thrownInfo, + !1 ); } task.replay = replay; @@ -5939,6 +6077,7 @@ } task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } replay = task.treeContext; @@ -5947,98 +6086,98 @@ null !== task.replay && ((j = task.replay.slots), null !== j && "object" === typeof j) ) { - for (childIndex = 0; childIndex < replayNodes; childIndex++) { - node = children[childIndex]; - task.treeContext = pushTreeContext(replay, replayNodes, childIndex); - var resumeSegmentID = j[childIndex]; - "number" === typeof resumeSegmentID - ? (resumeNode( - request$jscomp$0, - task, - resumeSegmentID, - node, - childIndex - ), - delete j[childIndex]) - : renderNode(request$jscomp$0, task, node, childIndex); - } + for (childIndex = 0; childIndex < replayNodes; childIndex++) + (node = children[childIndex]), + (task.treeContext = pushTreeContext( + replay, + replayNodes, + childIndex + )), + (error = j[childIndex]), + "number" === typeof error + ? (resumeNode(request, task, error, node, childIndex), + delete j[childIndex]) + : renderNode(request, task, node, childIndex); task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } for (j = 0; j < replayNodes; j++) { childIndex = children[j]; - var request = request$jscomp$0; + resumeSlots = request; node = task; - resumeSegmentID = childIndex; + error = childIndex; if ( - null !== resumeSegmentID && - "object" === typeof resumeSegmentID && - (resumeSegmentID.$$typeof === REACT_ELEMENT_TYPE || - resumeSegmentID.$$typeof === REACT_PORTAL_TYPE) && - resumeSegmentID._store && - ((!resumeSegmentID._store.validated && null == resumeSegmentID.key) || - 2 === resumeSegmentID._store.validated) + null !== error && + "object" === typeof error && + (error.$$typeof === REACT_ELEMENT_TYPE || + error.$$typeof === REACT_PORTAL_TYPE) && + error._store && + ((!error._store.validated && null == error.key) || + 2 === error._store.validated) ) { - if ("object" !== typeof resumeSegmentID._store) + if ("object" !== typeof error._store) throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ); - resumeSegmentID._store.validated = 1; - var didWarnForKey = request.didWarnForKey; - null == didWarnForKey && - (didWarnForKey = request.didWarnForKey = new WeakSet()); - request = node.componentStack; - if (null !== request && !didWarnForKey.has(request)) { - didWarnForKey.add(request); - var componentName = getComponentNameFromType(resumeSegmentID.type); - didWarnForKey = resumeSegmentID._owner; - var parentOwner = request.owner; - request = ""; + error._store.validated = 1; + thrownInfo = resumeSlots.didWarnForKey; + null == thrownInfo && + (thrownInfo = resumeSlots.didWarnForKey = new WeakSet()); + resumeSlots = node.componentStack; + if (null !== resumeSlots && !thrownInfo.has(resumeSlots)) { + thrownInfo.add(resumeSlots); + var componentName = getComponentNameFromType(error.type); + thrownInfo = error._owner; + var parentOwner = resumeSlots.owner; + resumeSlots = ""; if (parentOwner && "undefined" !== typeof parentOwner.type) { var name = getComponentNameFromType(parentOwner.type); name && - (request = "\n\nCheck the render method of `" + name + "`."); + (resumeSlots = + "\n\nCheck the render method of `" + name + "`."); } - request || + resumeSlots || (componentName && - (request = + (resumeSlots = "\n\nCheck the top-level render call using <" + componentName + ">.")); componentName = ""; - null != didWarnForKey && - parentOwner !== didWarnForKey && + null != thrownInfo && + parentOwner !== thrownInfo && ((parentOwner = null), - "undefined" !== typeof didWarnForKey.type - ? (parentOwner = getComponentNameFromType(didWarnForKey.type)) - : "string" === typeof didWarnForKey.name && - (parentOwner = didWarnForKey.name), + "undefined" !== typeof thrownInfo.type + ? (parentOwner = getComponentNameFromType(thrownInfo.type)) + : "string" === typeof thrownInfo.name && + (parentOwner = thrownInfo.name), parentOwner && (componentName = " It was passed a child from " + parentOwner + ".")); - didWarnForKey = node.componentStack; + thrownInfo = node.componentStack; node.componentStack = { parent: node.componentStack, - type: resumeSegmentID.type, - owner: resumeSegmentID._owner, - stack: null + type: error.type, + owner: error._owner, + stack: error._debugStack }; console.error( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - request, + resumeSlots, componentName ); - node.componentStack = didWarnForKey; + node.componentStack = thrownInfo; } } task.treeContext = pushTreeContext(replay, replayNodes, j); - renderNode(request$jscomp$0, task, childIndex, j); + renderNode(request, task, childIndex, j); } task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; } function untrackBoundary(request, boundary) { request = request.trackedPostpones; @@ -6064,7 +6203,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function spawnNewSuspendedRenderTask(request, task, thenableState) { @@ -6094,7 +6235,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function renderNode(request, task, node, childIndex) { @@ -6103,6 +6246,7 @@ previousKeyPath = task.keyPath, previousTreeContext = task.treeContext, previousComponentStack = task.componentStack, + previousDebugTask = task.debugTask, segment = task.blockedSegment; if (null === segment) try { @@ -6129,6 +6273,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6141,6 +6286,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6175,6 +6321,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6187,6 +6334,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6200,26 +6348,6 @@ switchContext(previousContext); throw node; } - function erroredReplay( - request, - boundary, - error, - errorInfo, - replayNodes, - resumeSlots - ) { - var errorDigest = logRecoverableError(request, error, errorInfo); - abortRemainingReplayNodes( - request, - boundary, - replayNodes, - resumeSlots, - error, - errorDigest, - errorInfo, - !1 - ); - } function abortTaskSoft(task) { var boundary = task.blockedBoundary; task = task.blockedSegment; @@ -6308,14 +6436,14 @@ if (13 !== request.status && request.status !== CLOSED) { boundary = task.replay; if (null === boundary) { - logRecoverableError(request, error, segment); - fatalError(request, error); + logRecoverableError(request, error, segment, null); + fatalError(request, error, segment, null); return; } boundary.pendingTasks--; 0 === boundary.pendingTasks && 0 < boundary.nodes.length && - ((task = logRecoverableError(request, error, segment)), + ((task = logRecoverableError(request, error, segment, null)), abortRemainingReplayNodes( request, null, @@ -6333,7 +6461,7 @@ boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = logRecoverableError(request, error, segment)), + (task = logRecoverableError(request, error, segment, null)), (boundary.status = CLIENT_RENDERED), encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), @@ -6408,7 +6536,7 @@ } } } catch (error) { - logRecoverableError(request, error, {}); + logRecoverableError(request, error, {}, null); } } function completeShell(request) { @@ -6486,10 +6614,10 @@ request.allPendingTasks--; 0 === request.allPendingTasks && completeAll(request); } - function performWork(request$jscomp$1) { + function performWork(request$jscomp$2) { if ( - request$jscomp$1.status !== CLOSED && - 13 !== request$jscomp$1.status + request$jscomp$2.status !== CLOSED && + 13 !== request$jscomp$2.status ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; @@ -6497,16 +6625,16 @@ var prevAsyncDispatcher = ReactSharedInternals.A; ReactSharedInternals.A = DefaultAsyncDispatcher; var prevRequest = currentRequest; - currentRequest = request$jscomp$1; + currentRequest = request$jscomp$2; var prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; var prevResumableState = currentResumableState; - currentResumableState = request$jscomp$1.resumableState; + currentResumableState = request$jscomp$2.resumableState; try { - var pingedTasks = request$jscomp$1.pingedTasks, + var pingedTasks = request$jscomp$2.pingedTasks, i; for (i = 0; i < pingedTasks.length; i++) { - var request = request$jscomp$1, + var request = request$jscomp$2, task = pingedTasks[i], segment = task.blockedSegment; if (null === segment) { @@ -6554,16 +6682,32 @@ } else { request.replay.pendingTasks--; request.abortSet.delete(request); - var errorInfo = getThrownInfo(request.componentStack); - erroredReplay( - request$jscomp$0, - request.blockedBoundary, - 12 === request$jscomp$0.status - ? request$jscomp$0.fatalError - : x, - errorInfo, - request.replay.nodes, - request.replay.slots + var errorInfo = getThrownInfo(request.componentStack), + errorDigest = void 0, + request$jscomp$1 = request$jscomp$0, + boundary = request.blockedBoundary, + error$jscomp$0 = + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, + errorInfo$jscomp$0 = errorInfo, + replayNodes = request.replay.nodes, + resumeSlots = request.replay.slots; + errorDigest = logRecoverableError( + request$jscomp$1, + error$jscomp$0, + errorInfo$jscomp$0, + request.debugTask + ); + abortRemainingReplayNodes( + request$jscomp$1, + boundary, + replayNodes, + resumeSlots, + error$jscomp$0, + errorDigest, + errorInfo$jscomp$0, + !1 ); request$jscomp$0.pendingRootTasks--; 0 === request$jscomp$0.pendingRootTasks && @@ -6576,101 +6720,110 @@ currentTaskInDEV = prevTaskInDEV; } } - } else { - request$jscomp$0 = prevTaskInDEV = void 0; - var task$jscomp$0 = task, - segment$jscomp$0 = segment; - if (segment$jscomp$0.status === PENDING) { - segment$jscomp$0.status = 6; - switchContext(task$jscomp$0.context); - request$jscomp$0 = currentTaskInDEV; - currentTaskInDEV = task$jscomp$0; - var childrenLength = segment$jscomp$0.children.length, - chunkLength = segment$jscomp$0.chunks.length; - try { - retryNode(request, task$jscomp$0), - pushSegmentFinale( - segment$jscomp$0.chunks, - request.renderState, - segment$jscomp$0.lastPushedText, - segment$jscomp$0.textEmbedded - ), - task$jscomp$0.abortSet.delete(task$jscomp$0), - (segment$jscomp$0.status = COMPLETED), - finishedTask( - request, - task$jscomp$0.blockedBoundary, - segment$jscomp$0 - ); - } catch (thrownValue) { - resetHooksState(); - segment$jscomp$0.children.length = childrenLength; - segment$jscomp$0.chunks.length = chunkLength; - var x$jscomp$0 = - thrownValue === SuspenseException - ? getSuspendedThenable() - : 12 === request.status - ? request.fatalError - : thrownValue; - if ( - "object" === typeof x$jscomp$0 && - null !== x$jscomp$0 && - "function" === typeof x$jscomp$0.then - ) { - segment$jscomp$0.status = PENDING; - task$jscomp$0.thenableState = - getThenableStateAfterSuspending(); - var ping$jscomp$0 = task$jscomp$0.ping; - x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); - } else { - var errorInfo$jscomp$0 = getThrownInfo( - task$jscomp$0.componentStack - ); - task$jscomp$0.abortSet.delete(task$jscomp$0); - segment$jscomp$0.status = 4; - var boundary = task$jscomp$0.blockedBoundary; - prevTaskInDEV = logRecoverableError( - request, - x$jscomp$0, - errorInfo$jscomp$0 - ); - null === boundary - ? fatalError(request, x$jscomp$0) - : (boundary.pendingTasks--, - boundary.status !== CLIENT_RENDERED && - ((boundary.status = CLIENT_RENDERED), - encodeErrorForBoundary( - boundary, - prevTaskInDEV, - x$jscomp$0, - errorInfo$jscomp$0, - !1 + } else if ( + ((request$jscomp$0 = prevTaskInDEV = void 0), + (errorDigest = task), + (request$jscomp$1 = segment), + request$jscomp$1.status === PENDING) + ) { + request$jscomp$1.status = 6; + switchContext(errorDigest.context); + request$jscomp$0 = currentTaskInDEV; + currentTaskInDEV = errorDigest; + var childrenLength = request$jscomp$1.children.length, + chunkLength = request$jscomp$1.chunks.length; + try { + retryNode(request, errorDigest), + pushSegmentFinale( + request$jscomp$1.chunks, + request.renderState, + request$jscomp$1.lastPushedText, + request$jscomp$1.textEmbedded + ), + errorDigest.abortSet.delete(errorDigest), + (request$jscomp$1.status = COMPLETED), + finishedTask( + request, + errorDigest.blockedBoundary, + request$jscomp$1 + ); + } catch (thrownValue) { + resetHooksState(); + request$jscomp$1.children.length = childrenLength; + request$jscomp$1.chunks.length = chunkLength; + var x$jscomp$0 = + thrownValue === SuspenseException + ? getSuspendedThenable() + : 12 === request.status + ? request.fatalError + : thrownValue; + if ( + "object" === typeof x$jscomp$0 && + null !== x$jscomp$0 && + "function" === typeof x$jscomp$0.then + ) { + request$jscomp$1.status = PENDING; + errorDigest.thenableState = getThenableStateAfterSuspending(); + var ping$jscomp$0 = errorDigest.ping; + x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); + } else { + var errorInfo$jscomp$1 = getThrownInfo( + errorDigest.componentStack + ); + errorDigest.abortSet.delete(errorDigest); + request$jscomp$1.status = 4; + var boundary$jscomp$0 = errorDigest.blockedBoundary, + debugTask = errorDigest.debugTask; + prevTaskInDEV = logRecoverableError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ); + null === boundary$jscomp$0 + ? fatalError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ) + : (boundary$jscomp$0.pendingTasks--, + boundary$jscomp$0.status !== CLIENT_RENDERED && + ((boundary$jscomp$0.status = CLIENT_RENDERED), + encodeErrorForBoundary( + boundary$jscomp$0, + prevTaskInDEV, + x$jscomp$0, + errorInfo$jscomp$1, + !1 + ), + untrackBoundary(request, boundary$jscomp$0), + boundary$jscomp$0.parentFlushed && + request.clientRenderedBoundaries.push( + boundary$jscomp$0 ), - untrackBoundary(request, boundary), - boundary.parentFlushed && - request.clientRenderedBoundaries.push(boundary), - 0 === request.pendingRootTasks && - null === request.trackedPostpones && - null !== boundary.contentPreamble && - preparePreamble(request))); - request.allPendingTasks--; - 0 === request.allPendingTasks && completeAll(request); - } - } finally { - currentTaskInDEV = request$jscomp$0; + 0 === request.pendingRootTasks && + null === request.trackedPostpones && + null !== boundary$jscomp$0.contentPreamble && + preparePreamble(request))); + request.allPendingTasks--; + 0 === request.allPendingTasks && completeAll(request); } + } finally { + currentTaskInDEV = request$jscomp$0; } } } pingedTasks.splice(0, i); - null !== request$jscomp$1.destination && + null !== request$jscomp$2.destination && flushCompletedQueues( - request$jscomp$1, - request$jscomp$1.destination + request$jscomp$2, + request$jscomp$2.destination ); } catch (error) { - logRecoverableError(request$jscomp$1, error, {}), - fatalError(request$jscomp$1, error); + (pingedTasks = {}), + logRecoverableError(request$jscomp$2, error, pingedTasks, null), + fatalError(request$jscomp$2, error, pingedTasks, null); } finally { (currentResumableState = prevResumableState), (ReactSharedInternals.H = prevDispatcher), @@ -7330,7 +7483,9 @@ try { flushCompletedQueues(request, destination); } catch (error) { - logRecoverableError(request, error, {}), fatalError(request, error); + (destination = {}), + logRecoverableError(request, error, destination, null), + fatalError(request, error, destination, null); } } } @@ -7356,7 +7511,9 @@ null !== request.destination && flushCompletedQueues(request, request.destination); } catch (error$4) { - logRecoverableError(request, error$4, {}), fatalError(request, error$4); + (reason = {}), + logRecoverableError(request, error$4, reason, null), + fatalError(request, error$4, reason, null); } } function onError() {} @@ -8851,5 +9008,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js index acc8d62989bbe8..4d32392599f8d1 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js @@ -5965,4 +5965,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js index da85692ad30cb5..437c407d0abd50 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js @@ -4322,6 +4322,27 @@ "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeComponentStackByType(type) { if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) @@ -4361,18 +4382,6 @@ } return ""; } - function getStackByComponentStackNode(componentStack) { - try { - var info = ""; - do - (info += describeComponentStackByType(componentStack.type)), - (componentStack = componentStack.parent); - while (componentStack); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } function defaultErrorHandler(error) { if ( "object" === typeof error && @@ -4496,7 +4505,9 @@ null, emptyTreeContext, null, - !1 + !1, + emptyContextObject, + null ); pushComponentStack(children); resumableState.pingedTasks.push(children); @@ -4589,7 +4600,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4615,6 +4628,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4632,7 +4646,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4659,6 +4675,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4685,22 +4702,63 @@ }; } function getCurrentStackInDEV() { - return null === currentTaskInDEV || - null === currentTaskInDEV.componentStack - ? "" - : getStackByComponentStackNode(currentTaskInDEV.componentStack); + if (null === currentTaskInDEV || null === currentTaskInDEV.componentStack) + return ""; + var componentStack = currentTaskInDEV.componentStack; + try { + var info = ""; + if ("string" === typeof componentStack.type) + info += describeBuiltInComponentFrame(componentStack.type); + else if ("function" === typeof componentStack.type) { + if (!componentStack.owner) { + var JSCompiler_temp_const = info, + fn = componentStack.type, + name = fn ? fn.displayName || fn.name : ""; + var JSCompiler_inline_result = name + ? describeBuiltInComponentFrame(name) + : ""; + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } else + componentStack.owner || + (info += describeComponentStackByType(componentStack.type)); + for (; componentStack; ) + (JSCompiler_temp_const = null), + null != componentStack.debugStack + ? (JSCompiler_temp_const = formatOwnerStack( + componentStack.debugStack + )) + : ((JSCompiler_inline_result = componentStack), + null != JSCompiler_inline_result.stack && + (JSCompiler_temp_const = + "string" !== typeof JSCompiler_inline_result.stack + ? (JSCompiler_inline_result.stack = formatOwnerStack( + JSCompiler_inline_result.stack + )) + : JSCompiler_inline_result.stack)), + (componentStack = componentStack.owner) && + JSCompiler_temp_const && + (info += "\n" + JSCompiler_temp_const); + var JSCompiler_inline_result$jscomp$0 = info; + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function pushServerComponentStack(task, debugInfo) { if (null != debugInfo) for (var i = 0; i < debugInfo.length; i++) { var componentInfo = debugInfo[i]; "string" === typeof componentInfo.name && - (task.componentStack = { + void 0 !== componentInfo.debugStack && + ((task.componentStack = { parent: task.componentStack, type: componentInfo, owner: componentInfo.owner, - stack: null - }); + stack: componentInfo.debugStack + }), + (task.debugTask = componentInfo.debugTask)); } } function pushComponentStack(task) { @@ -4709,13 +4767,15 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - owner = node._owner; + owner = node._owner, + stack = node._debugStack; pushServerComponentStack(task, node._debugInfo); + task.debugTask = node._debugTask; task.componentStack = { parent: task.componentStack, type: type, owner: owner, - stack: null + stack: stack }; break; case REACT_LAZY_TYPE: @@ -4726,14 +4786,24 @@ pushServerComponentStack(task, node._debugInfo); } } - function getThrownInfo(node) { + function getThrownInfo(node$jscomp$0) { var errorInfo = {}; - node && + node$jscomp$0 && Object.defineProperty(errorInfo, "componentStack", { configurable: !0, enumerable: !0, get: function () { - var stack = getStackByComponentStackNode(node); + try { + var info = "", + node = node$jscomp$0; + do + (info += describeComponentStackByType(node.type)), + (node = node.parent); + while (node); + var stack = info; + } catch (x) { + stack = "\nError generating stack: " + x.message + "\n" + x.stack; + } Object.defineProperty(errorInfo, "componentStack", { value: stack }); @@ -4764,9 +4834,11 @@ boundary.errorStack = null !== error ? wasAborted + error : null; boundary.errorComponentStack = thrownInfo.componentStack; } - function logRecoverableError(request, error, errorInfo) { + function logRecoverableError(request, error, errorInfo, debugTask) { request = request.onError; - error = request(error, errorInfo); + error = debugTask + ? debugTask.run(request.bind(null, error, errorInfo)) + : request(error, errorInfo); if (null != error && "string" !== typeof error) console.error( 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "%s" instead', @@ -4774,11 +4846,13 @@ ); else return error; } - function fatalError(request, error) { - var onShellError = request.onShellError, - onFatalError = request.onFatalError; - onShellError(error); - onFatalError(error); + function fatalError(request, error, errorInfo, debugTask) { + errorInfo = request.onShellError; + var onFatalError = request.onFatalError; + debugTask + ? (debugTask.run(errorInfo.bind(null, error)), + debugTask.run(onFatalError.bind(null, error))) + : (errorInfo(error), onFatalError(error)); null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) @@ -5359,7 +5433,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(preambleTask); request.pingedTasks.push(preambleTask); @@ -5544,7 +5620,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedPrimaryTask); request.pingedTasks.push(suspendedPrimaryTask); @@ -5583,7 +5661,8 @@ var errorDigest = logRecoverableError( request, error, - thrownInfo + thrownInfo, + task.debugTask ); encodeErrorForBoundary( newBoundary, @@ -5615,7 +5694,9 @@ task.context, task.treeContext, task.componentStack, - !0 + !0, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedFallbackTask); request.pingedTasks.push(suspendedFallbackTask); @@ -5767,15 +5848,183 @@ (task.replay = prevReplay), (task.blockedSegment = null); } } + function replayElement( + request, + task, + keyPath, + name, + keyOrIndex, + childIndex, + type, + props, + ref, + replay + ) { + childIndex = replay.nodes; + for (var i = 0; i < childIndex.length; i++) { + var node = childIndex[i]; + if (keyOrIndex === node[1]) { + if (4 === node.length) { + if (null !== name && name !== node[0]) + throw Error( + "Expected the resume to render <" + + node[0] + + "> in this slot but instead it rendered <" + + name + + ">. The tree doesn't match so React will fallback to client rendering." + ); + var childNodes = node[2]; + node = node[3]; + name = task.node; + task.replay = { nodes: childNodes, slots: node, pendingTasks: 1 }; + try { + renderElement(request, task, keyPath, type, props, ref); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + } catch (x) { + if ( + "object" === typeof x && + null !== x && + (x === SuspenseException || "function" === typeof x.then) + ) + throw (task.node === name && (task.replay = replay), x); + task.replay.pendingTasks--; + type = getThrownInfo(task.componentStack); + props = request; + request = task.blockedBoundary; + keyPath = x; + ref = node; + node = logRecoverableError(props, keyPath, type, task.debugTask); + abortRemainingReplayNodes( + props, + request, + childNodes, + ref, + keyPath, + node, + type, + !1 + ); + } + task.replay = replay; + } else { + if (type !== REACT_SUSPENSE_TYPE) + throw Error( + "Expected the resume to render in this slot but instead it rendered <" + + (getComponentNameFromType(type) || "Unknown") + + ">. The tree doesn't match so React will fallback to client rendering." + ); + a: { + replay = void 0; + type = node[5]; + ref = node[2]; + name = node[3]; + keyOrIndex = null === node[4] ? [] : node[4][2]; + node = null === node[4] ? null : node[4][3]; + var prevKeyPath = task.keyPath, + previousReplaySet = task.replay, + parentBoundary = task.blockedBoundary, + parentHoistableState = task.hoistableState, + content = props.children, + fallback = props.fallback, + fallbackAbortSet = new Set(); + props = + task.formatContext.insertionMode < HTML_MODE + ? createSuspenseBoundary( + request, + fallbackAbortSet, + createPreambleState(), + createPreambleState() + ) + : createSuspenseBoundary( + request, + fallbackAbortSet, + null, + null + ); + props.parentFlushed = !0; + props.rootSegmentID = type; + task.blockedBoundary = props; + task.hoistableState = props.contentState; + task.keyPath = keyPath; + task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; + try { + renderNode(request, task, content, -1); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + if (0 === props.pendingTasks && props.status === PENDING) { + props.status = COMPLETED; + request.completedBoundaries.push(props); + break a; + } + } catch (error) { + (props.status = CLIENT_RENDERED), + (childNodes = getThrownInfo(task.componentStack)), + (replay = logRecoverableError( + request, + error, + childNodes, + task.debugTask + )), + encodeErrorForBoundary(props, replay, error, childNodes, !1), + task.replay.pendingTasks--, + request.clientRenderedBoundaries.push(props); + } finally { + (task.blockedBoundary = parentBoundary), + (task.hoistableState = parentHoistableState), + (task.replay = previousReplaySet), + (task.keyPath = prevKeyPath); + } + props = createReplayTask( + request, + null, + { nodes: keyOrIndex, slots: node, pendingTasks: 0 }, + fallback, + -1, + parentBoundary, + props.fallbackState, + fallbackAbortSet, + [keyPath[0], "Suspense Fallback", keyPath[2]], + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + !0, + emptyContextObject, + task.debugTask + ); + pushComponentStack(props); + request.pingedTasks.push(props); + } + } + childIndex.splice(i, 1); + break; + } + } + } function renderNodeDestructive(request, task, node, childIndex) { null !== task.replay && "number" === typeof task.replay.slots ? resumeNode(request, task, task.replay.slots, node, childIndex) : ((task.node = node), (task.childIndex = childIndex), (node = task.componentStack), + (childIndex = task.debugTask), pushComponentStack(task), retryNode(request, task), - (task.componentStack = node)); + (task.componentStack = node), + (task.debugTask = childIndex)); } function retryNode(request, task) { var node = task.node, @@ -5785,178 +6034,56 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - key = node.key, - props = node.props; - node = props.ref; - var ref = void 0 !== node ? node : null, - name = getComponentNameFromType(type), - keyOrIndex = - null == key ? (-1 === childIndex ? 0 : childIndex) : key, - keyPath = [task.keyPath, name, keyOrIndex]; - if (null !== task.replay) { - var replay = task.replay; - childIndex = replay.nodes; - for (node = 0; node < childIndex.length; node++) - if (((key = childIndex[node]), keyOrIndex === key[1])) { - if (4 === key.length) { - if (null !== name && name !== key[0]) - throw Error( - "Expected the resume to render <" + - key[0] + - "> in this slot but instead it rendered <" + - name + - ">. The tree doesn't match so React will fallback to client rendering." - ); - var childNodes = key[2]; - key = key[3]; - name = task.node; - task.replay = { - nodes: childNodes, - slots: key, - pendingTasks: 1 - }; - try { - renderElement(request, task, keyPath, type, props, ref); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - } catch (x) { - if ( - "object" === typeof x && - null !== x && - (x === SuspenseException || - "function" === typeof x.then) - ) - throw ( - (task.node === name && (task.replay = replay), x) - ); - task.replay.pendingTasks--; - props = getThrownInfo(task.componentStack); - erroredReplay( - request, - task.blockedBoundary, - x, - props, - childNodes, - key - ); - } - task.replay = replay; - } else { - if (type !== REACT_SUSPENSE_TYPE) - throw Error( - "Expected the resume to render in this slot but instead it rendered <" + - (getComponentNameFromType(type) || "Unknown") + - ">. The tree doesn't match so React will fallback to client rendering." - ); - a: { - type = void 0; - ref = key[5]; - replay = key[2]; - name = key[3]; - keyOrIndex = null === key[4] ? [] : key[4][2]; - key = null === key[4] ? null : key[4][3]; - var prevKeyPath = task.keyPath, - previousReplaySet = task.replay, - parentBoundary = task.blockedBoundary, - parentHoistableState = task.hoistableState, - content = props.children, - fallback = props.fallback, - fallbackAbortSet = new Set(); - props = - task.formatContext.insertionMode < HTML_MODE - ? createSuspenseBoundary( - request, - fallbackAbortSet, - createPreambleState(), - createPreambleState() - ) - : createSuspenseBoundary( - request, - fallbackAbortSet, - null, - null - ); - props.parentFlushed = !0; - props.rootSegmentID = ref; - task.blockedBoundary = props; - task.hoistableState = props.contentState; - task.keyPath = keyPath; - task.replay = { - nodes: replay, - slots: name, - pendingTasks: 1 - }; - try { - renderNode(request, task, content, -1); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - if ( - 0 === props.pendingTasks && - props.status === PENDING - ) { - props.status = COMPLETED; - request.completedBoundaries.push(props); - break a; - } - } catch (error) { - (props.status = CLIENT_RENDERED), - (childNodes = getThrownInfo(task.componentStack)), - (type = logRecoverableError( - request, - error, - childNodes - )), - encodeErrorForBoundary( - props, - type, - error, - childNodes, - !1 - ), - task.replay.pendingTasks--, - request.clientRenderedBoundaries.push(props); - } finally { - (task.blockedBoundary = parentBoundary), - (task.hoistableState = parentHoistableState), - (task.replay = previousReplaySet), - (task.keyPath = prevKeyPath); - } - childNodes = createReplayTask( - request, - null, - { nodes: keyOrIndex, slots: key, pendingTasks: 0 }, - fallback, - -1, - parentBoundary, - props.fallbackState, - fallbackAbortSet, - [keyPath[0], "Suspense Fallback", keyPath[2]], - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - !0 - ); - pushComponentStack(childNodes); - request.pingedTasks.push(childNodes); - } - } - childIndex.splice(node, 1); - break; - } - } else renderElement(request, task, keyPath, type, props, ref); + key = node.key; + node = node.props; + var refProp = node.ref; + refProp = void 0 !== refProp ? refProp : null; + var debugTask = task.debugTask, + name = getComponentNameFromType(type); + key = null == key ? (-1 === childIndex ? 0 : childIndex) : key; + var keyPath = [task.keyPath, name, key]; + null !== task.replay + ? debugTask + ? debugTask.run( + replayElement.bind( + null, + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + ) + : replayElement( + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + : debugTask + ? debugTask.run( + renderElement.bind( + null, + request, + task, + keyPath, + type, + node, + refProp + ) + ) + : renderElement(request, task, keyPath, type, node, refProp); return; case REACT_PORTAL_TYPE: throw Error( @@ -5973,21 +6100,20 @@ return; } null === node || "object" !== typeof node - ? (props = null) - : ((childNodes = + ? (key = null) + : ((type = (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || node["@@iterator"]), - (props = "function" === typeof childNodes ? childNodes : null)); - if (props && (childNodes = props.call(node))) { - if (childNodes === node) { + (key = "function" === typeof type ? type : null)); + if (key && (type = key.call(node))) { + if (type === node) { if ( -1 !== childIndex || null === task.componentStack || "function" !== typeof task.componentStack.type || "[object GeneratorFunction]" !== Object.prototype.toString.call(task.componentStack.type) || - "[object Generator]" !== - Object.prototype.toString.call(childNodes) + "[object Generator]" !== Object.prototype.toString.call(type) ) didWarnAboutGenerators || console.error( @@ -5995,18 +6121,18 @@ ), (didWarnAboutGenerators = !0); } else - node.entries !== props || + node.entries !== key || didWarnAboutMaps || (console.error( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ), (didWarnAboutMaps = !0)); - node = childNodes.next(); + node = type.next(); if (!node.done) { - props = []; - do props.push(node.value), (node = childNodes.next()); + key = []; + do key.push(node.value), (node = type.next()); while (!node.done); - renderChildrenArray(request, task, props, childIndex); + renderChildrenArray(request, task, key, childIndex); } return; } @@ -6027,39 +6153,39 @@ node._currentValue, childIndex ); - childIndex = Object.prototype.toString.call(node); + request = Object.prototype.toString.call(node); throw Error( "Objects are not valid as a React child (found: " + - ("[object Object]" === childIndex + ("[object Object]" === request ? "object with keys {" + Object.keys(node).join(", ") + "}" - : childIndex) + + : request) + "). If you meant to render a collection of children, use an array instead." ); } "string" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : "number" === typeof node || "bigint" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, "" + node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : ("function" === typeof node && - ((childIndex = node.displayName || node.name || "Component"), + ((request = node.displayName || node.name || "Component"), console.error( "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.", - childIndex, - childIndex + request, + request )), "symbol" === typeof node && console.error( @@ -6068,9 +6194,10 @@ )); } } - function renderChildrenArray(request$jscomp$0, task, children, childIndex) { + function renderChildrenArray(request, task, children, childIndex) { var prevKeyPath = task.keyPath, previousComponentStack = task.componentStack; + var previousDebugTask = task.debugTask; pushServerComponentStack(task, task.node._debugInfo); if ( -1 !== childIndex && @@ -6088,7 +6215,7 @@ node = node[3]; task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 }; try { - renderChildrenArray(request$jscomp$0, task, children, -1); + renderChildrenArray(request, task, children, -1); if ( 1 === task.replay.pendingTasks && 0 < task.replay.nodes.length @@ -6105,14 +6232,25 @@ ) throw x; task.replay.pendingTasks--; - children = getThrownInfo(task.componentStack); - erroredReplay( - request$jscomp$0, - task.blockedBoundary, - x, + var thrownInfo = getThrownInfo(task.componentStack); + children = task.blockedBoundary; + var error = x, + resumeSlots = node; + node = logRecoverableError( + request, + error, + thrownInfo, + task.debugTask + ); + abortRemainingReplayNodes( + request, children, childIndex, - node + resumeSlots, + error, + node, + thrownInfo, + !1 ); } task.replay = replay; @@ -6122,6 +6260,7 @@ } task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } replay = task.treeContext; @@ -6130,98 +6269,98 @@ null !== task.replay && ((j = task.replay.slots), null !== j && "object" === typeof j) ) { - for (childIndex = 0; childIndex < replayNodes; childIndex++) { - node = children[childIndex]; - task.treeContext = pushTreeContext(replay, replayNodes, childIndex); - var resumeSegmentID = j[childIndex]; - "number" === typeof resumeSegmentID - ? (resumeNode( - request$jscomp$0, - task, - resumeSegmentID, - node, - childIndex - ), - delete j[childIndex]) - : renderNode(request$jscomp$0, task, node, childIndex); - } + for (childIndex = 0; childIndex < replayNodes; childIndex++) + (node = children[childIndex]), + (task.treeContext = pushTreeContext( + replay, + replayNodes, + childIndex + )), + (error = j[childIndex]), + "number" === typeof error + ? (resumeNode(request, task, error, node, childIndex), + delete j[childIndex]) + : renderNode(request, task, node, childIndex); task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } for (j = 0; j < replayNodes; j++) { childIndex = children[j]; - var request = request$jscomp$0; + resumeSlots = request; node = task; - resumeSegmentID = childIndex; + error = childIndex; if ( - null !== resumeSegmentID && - "object" === typeof resumeSegmentID && - (resumeSegmentID.$$typeof === REACT_ELEMENT_TYPE || - resumeSegmentID.$$typeof === REACT_PORTAL_TYPE) && - resumeSegmentID._store && - ((!resumeSegmentID._store.validated && null == resumeSegmentID.key) || - 2 === resumeSegmentID._store.validated) + null !== error && + "object" === typeof error && + (error.$$typeof === REACT_ELEMENT_TYPE || + error.$$typeof === REACT_PORTAL_TYPE) && + error._store && + ((!error._store.validated && null == error.key) || + 2 === error._store.validated) ) { - if ("object" !== typeof resumeSegmentID._store) + if ("object" !== typeof error._store) throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ); - resumeSegmentID._store.validated = 1; - var didWarnForKey = request.didWarnForKey; - null == didWarnForKey && - (didWarnForKey = request.didWarnForKey = new WeakSet()); - request = node.componentStack; - if (null !== request && !didWarnForKey.has(request)) { - didWarnForKey.add(request); - var componentName = getComponentNameFromType(resumeSegmentID.type); - didWarnForKey = resumeSegmentID._owner; - var parentOwner = request.owner; - request = ""; + error._store.validated = 1; + thrownInfo = resumeSlots.didWarnForKey; + null == thrownInfo && + (thrownInfo = resumeSlots.didWarnForKey = new WeakSet()); + resumeSlots = node.componentStack; + if (null !== resumeSlots && !thrownInfo.has(resumeSlots)) { + thrownInfo.add(resumeSlots); + var componentName = getComponentNameFromType(error.type); + thrownInfo = error._owner; + var parentOwner = resumeSlots.owner; + resumeSlots = ""; if (parentOwner && "undefined" !== typeof parentOwner.type) { var name = getComponentNameFromType(parentOwner.type); name && - (request = "\n\nCheck the render method of `" + name + "`."); + (resumeSlots = + "\n\nCheck the render method of `" + name + "`."); } - request || + resumeSlots || (componentName && - (request = + (resumeSlots = "\n\nCheck the top-level render call using <" + componentName + ">.")); componentName = ""; - null != didWarnForKey && - parentOwner !== didWarnForKey && + null != thrownInfo && + parentOwner !== thrownInfo && ((parentOwner = null), - "undefined" !== typeof didWarnForKey.type - ? (parentOwner = getComponentNameFromType(didWarnForKey.type)) - : "string" === typeof didWarnForKey.name && - (parentOwner = didWarnForKey.name), + "undefined" !== typeof thrownInfo.type + ? (parentOwner = getComponentNameFromType(thrownInfo.type)) + : "string" === typeof thrownInfo.name && + (parentOwner = thrownInfo.name), parentOwner && (componentName = " It was passed a child from " + parentOwner + ".")); - didWarnForKey = node.componentStack; + thrownInfo = node.componentStack; node.componentStack = { parent: node.componentStack, - type: resumeSegmentID.type, - owner: resumeSegmentID._owner, - stack: null + type: error.type, + owner: error._owner, + stack: error._debugStack }; console.error( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - request, + resumeSlots, componentName ); - node.componentStack = didWarnForKey; + node.componentStack = thrownInfo; } } task.treeContext = pushTreeContext(replay, replayNodes, j); - renderNode(request$jscomp$0, task, childIndex, j); + renderNode(request, task, childIndex, j); } task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; } function untrackBoundary(request, boundary) { request = request.trackedPostpones; @@ -6247,7 +6386,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function spawnNewSuspendedRenderTask(request, task, thenableState) { @@ -6277,7 +6418,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function renderNode(request, task, node, childIndex) { @@ -6286,6 +6429,7 @@ previousKeyPath = task.keyPath, previousTreeContext = task.treeContext, previousComponentStack = task.componentStack, + previousDebugTask = task.debugTask, segment = task.blockedSegment; if (null === segment) try { @@ -6312,6 +6456,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6324,6 +6469,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6358,6 +6504,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6370,6 +6517,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6383,26 +6531,6 @@ switchContext(previousContext); throw node; } - function erroredReplay( - request, - boundary, - error, - errorInfo, - replayNodes, - resumeSlots - ) { - var errorDigest = logRecoverableError(request, error, errorInfo); - abortRemainingReplayNodes( - request, - boundary, - replayNodes, - resumeSlots, - error, - errorDigest, - errorInfo, - !1 - ); - } function abortTaskSoft(task) { var boundary = task.blockedBoundary; task = task.blockedSegment; @@ -6491,14 +6619,14 @@ if (13 !== request.status && request.status !== CLOSED) { boundary = task.replay; if (null === boundary) { - logRecoverableError(request, error, segment); - fatalError(request, error); + logRecoverableError(request, error, segment, null); + fatalError(request, error, segment, null); return; } boundary.pendingTasks--; 0 === boundary.pendingTasks && 0 < boundary.nodes.length && - ((task = logRecoverableError(request, error, segment)), + ((task = logRecoverableError(request, error, segment, null)), abortRemainingReplayNodes( request, null, @@ -6516,7 +6644,7 @@ boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = logRecoverableError(request, error, segment)), + (task = logRecoverableError(request, error, segment, null)), (boundary.status = CLIENT_RENDERED), encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), @@ -6591,7 +6719,7 @@ } } } catch (error) { - logRecoverableError(request, error, {}); + logRecoverableError(request, error, {}, null); } } function completeShell(request) { @@ -6669,10 +6797,10 @@ request.allPendingTasks--; 0 === request.allPendingTasks && completeAll(request); } - function performWork(request$jscomp$1) { + function performWork(request$jscomp$2) { if ( - request$jscomp$1.status !== CLOSED && - 13 !== request$jscomp$1.status + request$jscomp$2.status !== CLOSED && + 13 !== request$jscomp$2.status ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; @@ -6680,16 +6808,16 @@ var prevAsyncDispatcher = ReactSharedInternals.A; ReactSharedInternals.A = DefaultAsyncDispatcher; var prevRequest = currentRequest; - currentRequest = request$jscomp$1; + currentRequest = request$jscomp$2; var prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; var prevResumableState = currentResumableState; - currentResumableState = request$jscomp$1.resumableState; + currentResumableState = request$jscomp$2.resumableState; try { - var pingedTasks = request$jscomp$1.pingedTasks, + var pingedTasks = request$jscomp$2.pingedTasks, i; for (i = 0; i < pingedTasks.length; i++) { - var request = request$jscomp$1, + var request = request$jscomp$2, task = pingedTasks[i], segment = task.blockedSegment; if (null === segment) { @@ -6737,16 +6865,32 @@ } else { request.replay.pendingTasks--; request.abortSet.delete(request); - var errorInfo = getThrownInfo(request.componentStack); - erroredReplay( - request$jscomp$0, - request.blockedBoundary, - 12 === request$jscomp$0.status - ? request$jscomp$0.fatalError - : x, - errorInfo, - request.replay.nodes, - request.replay.slots + var errorInfo = getThrownInfo(request.componentStack), + errorDigest = void 0, + request$jscomp$1 = request$jscomp$0, + boundary = request.blockedBoundary, + error$jscomp$0 = + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, + errorInfo$jscomp$0 = errorInfo, + replayNodes = request.replay.nodes, + resumeSlots = request.replay.slots; + errorDigest = logRecoverableError( + request$jscomp$1, + error$jscomp$0, + errorInfo$jscomp$0, + request.debugTask + ); + abortRemainingReplayNodes( + request$jscomp$1, + boundary, + replayNodes, + resumeSlots, + error$jscomp$0, + errorDigest, + errorInfo$jscomp$0, + !1 ); request$jscomp$0.pendingRootTasks--; 0 === request$jscomp$0.pendingRootTasks && @@ -6759,98 +6903,107 @@ currentTaskInDEV = prevTaskInDEV; } } - } else { - request$jscomp$0 = prevTaskInDEV = void 0; - var task$jscomp$0 = task, - segment$jscomp$0 = segment; - if (segment$jscomp$0.status === PENDING) { - segment$jscomp$0.status = 6; - switchContext(task$jscomp$0.context); - request$jscomp$0 = currentTaskInDEV; - currentTaskInDEV = task$jscomp$0; - var childrenLength = segment$jscomp$0.children.length, - chunkLength = segment$jscomp$0.chunks.length; - try { - retryNode(request, task$jscomp$0), - segment$jscomp$0.lastPushedText && - segment$jscomp$0.textEmbedded && - segment$jscomp$0.chunks.push(textSeparator), - task$jscomp$0.abortSet.delete(task$jscomp$0), - (segment$jscomp$0.status = COMPLETED), - finishedTask( - request, - task$jscomp$0.blockedBoundary, - segment$jscomp$0 - ); - } catch (thrownValue) { - resetHooksState(); - segment$jscomp$0.children.length = childrenLength; - segment$jscomp$0.chunks.length = chunkLength; - var x$jscomp$0 = - thrownValue === SuspenseException - ? getSuspendedThenable() - : 12 === request.status - ? request.fatalError - : thrownValue; - if ( - "object" === typeof x$jscomp$0 && - null !== x$jscomp$0 && - "function" === typeof x$jscomp$0.then - ) { - segment$jscomp$0.status = PENDING; - task$jscomp$0.thenableState = - getThenableStateAfterSuspending(); - var ping$jscomp$0 = task$jscomp$0.ping; - x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); - } else { - var errorInfo$jscomp$0 = getThrownInfo( - task$jscomp$0.componentStack - ); - task$jscomp$0.abortSet.delete(task$jscomp$0); - segment$jscomp$0.status = 4; - var boundary = task$jscomp$0.blockedBoundary; - prevTaskInDEV = logRecoverableError( - request, - x$jscomp$0, - errorInfo$jscomp$0 - ); - null === boundary - ? fatalError(request, x$jscomp$0) - : (boundary.pendingTasks--, - boundary.status !== CLIENT_RENDERED && - ((boundary.status = CLIENT_RENDERED), - encodeErrorForBoundary( - boundary, - prevTaskInDEV, - x$jscomp$0, - errorInfo$jscomp$0, - !1 + } else if ( + ((request$jscomp$0 = prevTaskInDEV = void 0), + (errorDigest = task), + (request$jscomp$1 = segment), + request$jscomp$1.status === PENDING) + ) { + request$jscomp$1.status = 6; + switchContext(errorDigest.context); + request$jscomp$0 = currentTaskInDEV; + currentTaskInDEV = errorDigest; + var childrenLength = request$jscomp$1.children.length, + chunkLength = request$jscomp$1.chunks.length; + try { + retryNode(request, errorDigest), + request$jscomp$1.lastPushedText && + request$jscomp$1.textEmbedded && + request$jscomp$1.chunks.push(textSeparator), + errorDigest.abortSet.delete(errorDigest), + (request$jscomp$1.status = COMPLETED), + finishedTask( + request, + errorDigest.blockedBoundary, + request$jscomp$1 + ); + } catch (thrownValue) { + resetHooksState(); + request$jscomp$1.children.length = childrenLength; + request$jscomp$1.chunks.length = chunkLength; + var x$jscomp$0 = + thrownValue === SuspenseException + ? getSuspendedThenable() + : 12 === request.status + ? request.fatalError + : thrownValue; + if ( + "object" === typeof x$jscomp$0 && + null !== x$jscomp$0 && + "function" === typeof x$jscomp$0.then + ) { + request$jscomp$1.status = PENDING; + errorDigest.thenableState = getThenableStateAfterSuspending(); + var ping$jscomp$0 = errorDigest.ping; + x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); + } else { + var errorInfo$jscomp$1 = getThrownInfo( + errorDigest.componentStack + ); + errorDigest.abortSet.delete(errorDigest); + request$jscomp$1.status = 4; + var boundary$jscomp$0 = errorDigest.blockedBoundary, + debugTask = errorDigest.debugTask; + prevTaskInDEV = logRecoverableError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ); + null === boundary$jscomp$0 + ? fatalError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ) + : (boundary$jscomp$0.pendingTasks--, + boundary$jscomp$0.status !== CLIENT_RENDERED && + ((boundary$jscomp$0.status = CLIENT_RENDERED), + encodeErrorForBoundary( + boundary$jscomp$0, + prevTaskInDEV, + x$jscomp$0, + errorInfo$jscomp$1, + !1 + ), + untrackBoundary(request, boundary$jscomp$0), + boundary$jscomp$0.parentFlushed && + request.clientRenderedBoundaries.push( + boundary$jscomp$0 ), - untrackBoundary(request, boundary), - boundary.parentFlushed && - request.clientRenderedBoundaries.push(boundary), - 0 === request.pendingRootTasks && - null === request.trackedPostpones && - null !== boundary.contentPreamble && - preparePreamble(request))); - request.allPendingTasks--; - 0 === request.allPendingTasks && completeAll(request); - } - } finally { - currentTaskInDEV = request$jscomp$0; + 0 === request.pendingRootTasks && + null === request.trackedPostpones && + null !== boundary$jscomp$0.contentPreamble && + preparePreamble(request))); + request.allPendingTasks--; + 0 === request.allPendingTasks && completeAll(request); } + } finally { + currentTaskInDEV = request$jscomp$0; } } } pingedTasks.splice(0, i); - null !== request$jscomp$1.destination && + null !== request$jscomp$2.destination && flushCompletedQueues( - request$jscomp$1, - request$jscomp$1.destination + request$jscomp$2, + request$jscomp$2.destination ); } catch (error) { - logRecoverableError(request$jscomp$1, error, {}), - fatalError(request$jscomp$1, error); + (pingedTasks = {}), + logRecoverableError(request$jscomp$2, error, pingedTasks, null), + fatalError(request$jscomp$2, error, pingedTasks, null); } finally { (currentResumableState = prevResumableState), (ReactSharedInternals.H = prevDispatcher), @@ -7551,7 +7704,9 @@ try { flushCompletedQueues(request, destination); } catch (error) { - logRecoverableError(request, error, {}), fatalError(request, error); + (destination = {}), + logRecoverableError(request, error, destination, null), + fatalError(request, error, destination, null); } } } @@ -7577,16 +7732,18 @@ null !== request.destination && flushCompletedQueues(request, request.destination); } catch (error$4) { - logRecoverableError(request, error$4, {}), fatalError(request, error$4); + (reason = {}), + logRecoverableError(request, error$4, reason, null), + fatalError(request, error$4, reason, null); } } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-canary-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-canary-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react"), @@ -9240,5 +9397,5 @@ startWork(request); }); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js index 269df36f19d7e7..3b1a3569d226e8 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js @@ -6225,12 +6225,12 @@ function abort(request, reason) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion, - "19.1.0-canary-cbbe8666-20250213" + "19.1.0-canary-32b0cad8-20250213" ) ); } @@ -6377,4 +6377,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js index 5660f0f9712a24..80af3db0cbbad9 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js @@ -5863,13 +5863,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_761 = React.version; if ( - "19.1.0-canary-cbbe8666-20250213" !== + "19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion$jscomp$inline_761 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_761 + - "\n - react-dom: 19.1.0-canary-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-canary-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -5960,4 +5960,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js index 72f7e79e3beca1..b0500e3d1ab087 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js @@ -4324,6 +4324,27 @@ "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeComponentStackByType(type) { if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) @@ -4363,18 +4384,6 @@ } return ""; } - function getStackByComponentStackNode(componentStack) { - try { - var info = ""; - do - (info += describeComponentStackByType(componentStack.type)), - (componentStack = componentStack.parent); - while (componentStack); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } function defaultErrorHandler(error) { if ( "object" === typeof error && @@ -4498,7 +4507,9 @@ null, emptyTreeContext, null, - !1 + !1, + emptyContextObject, + null ); pushComponentStack(children); resumableState.pingedTasks.push(children); @@ -4599,7 +4610,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4625,6 +4638,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4642,7 +4656,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4669,6 +4685,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4695,22 +4712,63 @@ }; } function getCurrentStackInDEV() { - return null === currentTaskInDEV || - null === currentTaskInDEV.componentStack - ? "" - : getStackByComponentStackNode(currentTaskInDEV.componentStack); + if (null === currentTaskInDEV || null === currentTaskInDEV.componentStack) + return ""; + var componentStack = currentTaskInDEV.componentStack; + try { + var info = ""; + if ("string" === typeof componentStack.type) + info += describeBuiltInComponentFrame(componentStack.type); + else if ("function" === typeof componentStack.type) { + if (!componentStack.owner) { + var JSCompiler_temp_const = info, + fn = componentStack.type, + name = fn ? fn.displayName || fn.name : ""; + var JSCompiler_inline_result = name + ? describeBuiltInComponentFrame(name) + : ""; + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } else + componentStack.owner || + (info += describeComponentStackByType(componentStack.type)); + for (; componentStack; ) + (JSCompiler_temp_const = null), + null != componentStack.debugStack + ? (JSCompiler_temp_const = formatOwnerStack( + componentStack.debugStack + )) + : ((JSCompiler_inline_result = componentStack), + null != JSCompiler_inline_result.stack && + (JSCompiler_temp_const = + "string" !== typeof JSCompiler_inline_result.stack + ? (JSCompiler_inline_result.stack = formatOwnerStack( + JSCompiler_inline_result.stack + )) + : JSCompiler_inline_result.stack)), + (componentStack = componentStack.owner) && + JSCompiler_temp_const && + (info += "\n" + JSCompiler_temp_const); + var JSCompiler_inline_result$jscomp$0 = info; + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function pushServerComponentStack(task, debugInfo) { if (null != debugInfo) for (var i = 0; i < debugInfo.length; i++) { var componentInfo = debugInfo[i]; "string" === typeof componentInfo.name && - (task.componentStack = { + void 0 !== componentInfo.debugStack && + ((task.componentStack = { parent: task.componentStack, type: componentInfo, owner: componentInfo.owner, - stack: null - }); + stack: componentInfo.debugStack + }), + (task.debugTask = componentInfo.debugTask)); } } function pushComponentStack(task) { @@ -4719,13 +4777,15 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - owner = node._owner; + owner = node._owner, + stack = node._debugStack; pushServerComponentStack(task, node._debugInfo); + task.debugTask = node._debugTask; task.componentStack = { parent: task.componentStack, type: type, owner: owner, - stack: null + stack: stack }; break; case REACT_LAZY_TYPE: @@ -4736,14 +4796,24 @@ pushServerComponentStack(task, node._debugInfo); } } - function getThrownInfo(node) { + function getThrownInfo(node$jscomp$0) { var errorInfo = {}; - node && + node$jscomp$0 && Object.defineProperty(errorInfo, "componentStack", { configurable: !0, enumerable: !0, get: function () { - var stack = getStackByComponentStackNode(node); + try { + var info = "", + node = node$jscomp$0; + do + (info += describeComponentStackByType(node.type)), + (node = node.parent); + while (node); + var stack = info; + } catch (x) { + stack = "\nError generating stack: " + x.message + "\n" + x.stack; + } Object.defineProperty(errorInfo, "componentStack", { value: stack }); @@ -4774,9 +4844,11 @@ boundary.errorStack = null !== error ? wasAborted + error : null; boundary.errorComponentStack = thrownInfo.componentStack; } - function logRecoverableError(request, error, errorInfo) { + function logRecoverableError(request, error, errorInfo, debugTask) { request = request.onError; - error = request(error, errorInfo); + error = debugTask + ? debugTask.run(request.bind(null, error, errorInfo)) + : request(error, errorInfo); if (null != error && "string" !== typeof error) console.error( 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "%s" instead', @@ -4784,11 +4856,13 @@ ); else return error; } - function fatalError(request, error) { - var onShellError = request.onShellError, - onFatalError = request.onFatalError; - onShellError(error); - onFatalError(error); + function fatalError(request, error, errorInfo, debugTask) { + errorInfo = request.onShellError; + var onFatalError = request.onFatalError; + debugTask + ? (debugTask.run(errorInfo.bind(null, error)), + debugTask.run(onFatalError.bind(null, error))) + : (errorInfo(error), onFatalError(error)); null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) @@ -5369,7 +5443,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(preambleTask); request.pingedTasks.push(preambleTask); @@ -5554,7 +5630,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedPrimaryTask); request.pingedTasks.push(suspendedPrimaryTask); @@ -5593,7 +5671,8 @@ var errorDigest = logRecoverableError( request, error, - thrownInfo + thrownInfo, + task.debugTask ); encodeErrorForBoundary( newBoundary, @@ -5625,7 +5704,9 @@ task.context, task.treeContext, task.componentStack, - !0 + !0, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedFallbackTask); request.pingedTasks.push(suspendedFallbackTask); @@ -5777,15 +5858,183 @@ (task.replay = prevReplay), (task.blockedSegment = null); } } + function replayElement( + request, + task, + keyPath, + name, + keyOrIndex, + childIndex, + type, + props, + ref, + replay + ) { + childIndex = replay.nodes; + for (var i = 0; i < childIndex.length; i++) { + var node = childIndex[i]; + if (keyOrIndex === node[1]) { + if (4 === node.length) { + if (null !== name && name !== node[0]) + throw Error( + "Expected the resume to render <" + + node[0] + + "> in this slot but instead it rendered <" + + name + + ">. The tree doesn't match so React will fallback to client rendering." + ); + var childNodes = node[2]; + node = node[3]; + name = task.node; + task.replay = { nodes: childNodes, slots: node, pendingTasks: 1 }; + try { + renderElement(request, task, keyPath, type, props, ref); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + } catch (x) { + if ( + "object" === typeof x && + null !== x && + (x === SuspenseException || "function" === typeof x.then) + ) + throw (task.node === name && (task.replay = replay), x); + task.replay.pendingTasks--; + type = getThrownInfo(task.componentStack); + props = request; + request = task.blockedBoundary; + keyPath = x; + ref = node; + node = logRecoverableError(props, keyPath, type, task.debugTask); + abortRemainingReplayNodes( + props, + request, + childNodes, + ref, + keyPath, + node, + type, + !1 + ); + } + task.replay = replay; + } else { + if (type !== REACT_SUSPENSE_TYPE) + throw Error( + "Expected the resume to render in this slot but instead it rendered <" + + (getComponentNameFromType(type) || "Unknown") + + ">. The tree doesn't match so React will fallback to client rendering." + ); + a: { + replay = void 0; + type = node[5]; + ref = node[2]; + name = node[3]; + keyOrIndex = null === node[4] ? [] : node[4][2]; + node = null === node[4] ? null : node[4][3]; + var prevKeyPath = task.keyPath, + previousReplaySet = task.replay, + parentBoundary = task.blockedBoundary, + parentHoistableState = task.hoistableState, + content = props.children, + fallback = props.fallback, + fallbackAbortSet = new Set(); + props = + task.formatContext.insertionMode < HTML_MODE + ? createSuspenseBoundary( + request, + fallbackAbortSet, + createPreambleState(), + createPreambleState() + ) + : createSuspenseBoundary( + request, + fallbackAbortSet, + null, + null + ); + props.parentFlushed = !0; + props.rootSegmentID = type; + task.blockedBoundary = props; + task.hoistableState = props.contentState; + task.keyPath = keyPath; + task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; + try { + renderNode(request, task, content, -1); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + if (0 === props.pendingTasks && props.status === PENDING) { + props.status = COMPLETED; + request.completedBoundaries.push(props); + break a; + } + } catch (error) { + (props.status = CLIENT_RENDERED), + (childNodes = getThrownInfo(task.componentStack)), + (replay = logRecoverableError( + request, + error, + childNodes, + task.debugTask + )), + encodeErrorForBoundary(props, replay, error, childNodes, !1), + task.replay.pendingTasks--, + request.clientRenderedBoundaries.push(props); + } finally { + (task.blockedBoundary = parentBoundary), + (task.hoistableState = parentHoistableState), + (task.replay = previousReplaySet), + (task.keyPath = prevKeyPath); + } + props = createReplayTask( + request, + null, + { nodes: keyOrIndex, slots: node, pendingTasks: 0 }, + fallback, + -1, + parentBoundary, + props.fallbackState, + fallbackAbortSet, + [keyPath[0], "Suspense Fallback", keyPath[2]], + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + !0, + emptyContextObject, + task.debugTask + ); + pushComponentStack(props); + request.pingedTasks.push(props); + } + } + childIndex.splice(i, 1); + break; + } + } + } function renderNodeDestructive(request, task, node, childIndex) { null !== task.replay && "number" === typeof task.replay.slots ? resumeNode(request, task, task.replay.slots, node, childIndex) : ((task.node = node), (task.childIndex = childIndex), (node = task.componentStack), + (childIndex = task.debugTask), pushComponentStack(task), retryNode(request, task), - (task.componentStack = node)); + (task.componentStack = node), + (task.debugTask = childIndex)); } function retryNode(request, task) { var node = task.node, @@ -5795,178 +6044,56 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - key = node.key, - props = node.props; - node = props.ref; - var ref = void 0 !== node ? node : null, - name = getComponentNameFromType(type), - keyOrIndex = - null == key ? (-1 === childIndex ? 0 : childIndex) : key, - keyPath = [task.keyPath, name, keyOrIndex]; - if (null !== task.replay) { - var replay = task.replay; - childIndex = replay.nodes; - for (node = 0; node < childIndex.length; node++) - if (((key = childIndex[node]), keyOrIndex === key[1])) { - if (4 === key.length) { - if (null !== name && name !== key[0]) - throw Error( - "Expected the resume to render <" + - key[0] + - "> in this slot but instead it rendered <" + - name + - ">. The tree doesn't match so React will fallback to client rendering." - ); - var childNodes = key[2]; - key = key[3]; - name = task.node; - task.replay = { - nodes: childNodes, - slots: key, - pendingTasks: 1 - }; - try { - renderElement(request, task, keyPath, type, props, ref); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - } catch (x) { - if ( - "object" === typeof x && - null !== x && - (x === SuspenseException || - "function" === typeof x.then) - ) - throw ( - (task.node === name && (task.replay = replay), x) - ); - task.replay.pendingTasks--; - props = getThrownInfo(task.componentStack); - erroredReplay( - request, - task.blockedBoundary, - x, - props, - childNodes, - key - ); - } - task.replay = replay; - } else { - if (type !== REACT_SUSPENSE_TYPE) - throw Error( - "Expected the resume to render in this slot but instead it rendered <" + - (getComponentNameFromType(type) || "Unknown") + - ">. The tree doesn't match so React will fallback to client rendering." - ); - a: { - type = void 0; - ref = key[5]; - replay = key[2]; - name = key[3]; - keyOrIndex = null === key[4] ? [] : key[4][2]; - key = null === key[4] ? null : key[4][3]; - var prevKeyPath = task.keyPath, - previousReplaySet = task.replay, - parentBoundary = task.blockedBoundary, - parentHoistableState = task.hoistableState, - content = props.children, - fallback = props.fallback, - fallbackAbortSet = new Set(); - props = - task.formatContext.insertionMode < HTML_MODE - ? createSuspenseBoundary( - request, - fallbackAbortSet, - createPreambleState(), - createPreambleState() - ) - : createSuspenseBoundary( - request, - fallbackAbortSet, - null, - null - ); - props.parentFlushed = !0; - props.rootSegmentID = ref; - task.blockedBoundary = props; - task.hoistableState = props.contentState; - task.keyPath = keyPath; - task.replay = { - nodes: replay, - slots: name, - pendingTasks: 1 - }; - try { - renderNode(request, task, content, -1); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - if ( - 0 === props.pendingTasks && - props.status === PENDING - ) { - props.status = COMPLETED; - request.completedBoundaries.push(props); - break a; - } - } catch (error) { - (props.status = CLIENT_RENDERED), - (childNodes = getThrownInfo(task.componentStack)), - (type = logRecoverableError( - request, - error, - childNodes - )), - encodeErrorForBoundary( - props, - type, - error, - childNodes, - !1 - ), - task.replay.pendingTasks--, - request.clientRenderedBoundaries.push(props); - } finally { - (task.blockedBoundary = parentBoundary), - (task.hoistableState = parentHoistableState), - (task.replay = previousReplaySet), - (task.keyPath = prevKeyPath); - } - childNodes = createReplayTask( - request, - null, - { nodes: keyOrIndex, slots: key, pendingTasks: 0 }, - fallback, - -1, - parentBoundary, - props.fallbackState, - fallbackAbortSet, - [keyPath[0], "Suspense Fallback", keyPath[2]], - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - !0 - ); - pushComponentStack(childNodes); - request.pingedTasks.push(childNodes); - } - } - childIndex.splice(node, 1); - break; - } - } else renderElement(request, task, keyPath, type, props, ref); + key = node.key; + node = node.props; + var refProp = node.ref; + refProp = void 0 !== refProp ? refProp : null; + var debugTask = task.debugTask, + name = getComponentNameFromType(type); + key = null == key ? (-1 === childIndex ? 0 : childIndex) : key; + var keyPath = [task.keyPath, name, key]; + null !== task.replay + ? debugTask + ? debugTask.run( + replayElement.bind( + null, + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + ) + : replayElement( + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + : debugTask + ? debugTask.run( + renderElement.bind( + null, + request, + task, + keyPath, + type, + node, + refProp + ) + ) + : renderElement(request, task, keyPath, type, node, refProp); return; case REACT_PORTAL_TYPE: throw Error( @@ -5983,21 +6110,20 @@ return; } null === node || "object" !== typeof node - ? (props = null) - : ((childNodes = + ? (key = null) + : ((type = (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || node["@@iterator"]), - (props = "function" === typeof childNodes ? childNodes : null)); - if (props && (childNodes = props.call(node))) { - if (childNodes === node) { + (key = "function" === typeof type ? type : null)); + if (key && (type = key.call(node))) { + if (type === node) { if ( -1 !== childIndex || null === task.componentStack || "function" !== typeof task.componentStack.type || "[object GeneratorFunction]" !== Object.prototype.toString.call(task.componentStack.type) || - "[object Generator]" !== - Object.prototype.toString.call(childNodes) + "[object Generator]" !== Object.prototype.toString.call(type) ) didWarnAboutGenerators || console.error( @@ -6005,18 +6131,18 @@ ), (didWarnAboutGenerators = !0); } else - node.entries !== props || + node.entries !== key || didWarnAboutMaps || (console.error( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ), (didWarnAboutMaps = !0)); - node = childNodes.next(); + node = type.next(); if (!node.done) { - props = []; - do props.push(node.value), (node = childNodes.next()); + key = []; + do key.push(node.value), (node = type.next()); while (!node.done); - renderChildrenArray(request, task, props, childIndex); + renderChildrenArray(request, task, key, childIndex); } return; } @@ -6037,39 +6163,39 @@ node._currentValue, childIndex ); - childIndex = Object.prototype.toString.call(node); + request = Object.prototype.toString.call(node); throw Error( "Objects are not valid as a React child (found: " + - ("[object Object]" === childIndex + ("[object Object]" === request ? "object with keys {" + Object.keys(node).join(", ") + "}" - : childIndex) + + : request) + "). If you meant to render a collection of children, use an array instead." ); } "string" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : "number" === typeof node || "bigint" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, "" + node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : ("function" === typeof node && - ((childIndex = node.displayName || node.name || "Component"), + ((request = node.displayName || node.name || "Component"), console.error( "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.", - childIndex, - childIndex + request, + request )), "symbol" === typeof node && console.error( @@ -6078,9 +6204,10 @@ )); } } - function renderChildrenArray(request$jscomp$0, task, children, childIndex) { + function renderChildrenArray(request, task, children, childIndex) { var prevKeyPath = task.keyPath, previousComponentStack = task.componentStack; + var previousDebugTask = task.debugTask; pushServerComponentStack(task, task.node._debugInfo); if ( -1 !== childIndex && @@ -6098,7 +6225,7 @@ node = node[3]; task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 }; try { - renderChildrenArray(request$jscomp$0, task, children, -1); + renderChildrenArray(request, task, children, -1); if ( 1 === task.replay.pendingTasks && 0 < task.replay.nodes.length @@ -6115,14 +6242,25 @@ ) throw x; task.replay.pendingTasks--; - children = getThrownInfo(task.componentStack); - erroredReplay( - request$jscomp$0, - task.blockedBoundary, - x, + var thrownInfo = getThrownInfo(task.componentStack); + children = task.blockedBoundary; + var error = x, + resumeSlots = node; + node = logRecoverableError( + request, + error, + thrownInfo, + task.debugTask + ); + abortRemainingReplayNodes( + request, children, childIndex, - node + resumeSlots, + error, + node, + thrownInfo, + !1 ); } task.replay = replay; @@ -6132,6 +6270,7 @@ } task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } replay = task.treeContext; @@ -6140,98 +6279,98 @@ null !== task.replay && ((j = task.replay.slots), null !== j && "object" === typeof j) ) { - for (childIndex = 0; childIndex < replayNodes; childIndex++) { - node = children[childIndex]; - task.treeContext = pushTreeContext(replay, replayNodes, childIndex); - var resumeSegmentID = j[childIndex]; - "number" === typeof resumeSegmentID - ? (resumeNode( - request$jscomp$0, - task, - resumeSegmentID, - node, - childIndex - ), - delete j[childIndex]) - : renderNode(request$jscomp$0, task, node, childIndex); - } + for (childIndex = 0; childIndex < replayNodes; childIndex++) + (node = children[childIndex]), + (task.treeContext = pushTreeContext( + replay, + replayNodes, + childIndex + )), + (error = j[childIndex]), + "number" === typeof error + ? (resumeNode(request, task, error, node, childIndex), + delete j[childIndex]) + : renderNode(request, task, node, childIndex); task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } for (j = 0; j < replayNodes; j++) { childIndex = children[j]; - var request = request$jscomp$0; + resumeSlots = request; node = task; - resumeSegmentID = childIndex; + error = childIndex; if ( - null !== resumeSegmentID && - "object" === typeof resumeSegmentID && - (resumeSegmentID.$$typeof === REACT_ELEMENT_TYPE || - resumeSegmentID.$$typeof === REACT_PORTAL_TYPE) && - resumeSegmentID._store && - ((!resumeSegmentID._store.validated && null == resumeSegmentID.key) || - 2 === resumeSegmentID._store.validated) + null !== error && + "object" === typeof error && + (error.$$typeof === REACT_ELEMENT_TYPE || + error.$$typeof === REACT_PORTAL_TYPE) && + error._store && + ((!error._store.validated && null == error.key) || + 2 === error._store.validated) ) { - if ("object" !== typeof resumeSegmentID._store) + if ("object" !== typeof error._store) throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ); - resumeSegmentID._store.validated = 1; - var didWarnForKey = request.didWarnForKey; - null == didWarnForKey && - (didWarnForKey = request.didWarnForKey = new WeakSet()); - request = node.componentStack; - if (null !== request && !didWarnForKey.has(request)) { - didWarnForKey.add(request); - var componentName = getComponentNameFromType(resumeSegmentID.type); - didWarnForKey = resumeSegmentID._owner; - var parentOwner = request.owner; - request = ""; + error._store.validated = 1; + thrownInfo = resumeSlots.didWarnForKey; + null == thrownInfo && + (thrownInfo = resumeSlots.didWarnForKey = new WeakSet()); + resumeSlots = node.componentStack; + if (null !== resumeSlots && !thrownInfo.has(resumeSlots)) { + thrownInfo.add(resumeSlots); + var componentName = getComponentNameFromType(error.type); + thrownInfo = error._owner; + var parentOwner = resumeSlots.owner; + resumeSlots = ""; if (parentOwner && "undefined" !== typeof parentOwner.type) { var name = getComponentNameFromType(parentOwner.type); name && - (request = "\n\nCheck the render method of `" + name + "`."); + (resumeSlots = + "\n\nCheck the render method of `" + name + "`."); } - request || + resumeSlots || (componentName && - (request = + (resumeSlots = "\n\nCheck the top-level render call using <" + componentName + ">.")); componentName = ""; - null != didWarnForKey && - parentOwner !== didWarnForKey && + null != thrownInfo && + parentOwner !== thrownInfo && ((parentOwner = null), - "undefined" !== typeof didWarnForKey.type - ? (parentOwner = getComponentNameFromType(didWarnForKey.type)) - : "string" === typeof didWarnForKey.name && - (parentOwner = didWarnForKey.name), + "undefined" !== typeof thrownInfo.type + ? (parentOwner = getComponentNameFromType(thrownInfo.type)) + : "string" === typeof thrownInfo.name && + (parentOwner = thrownInfo.name), parentOwner && (componentName = " It was passed a child from " + parentOwner + ".")); - didWarnForKey = node.componentStack; + thrownInfo = node.componentStack; node.componentStack = { parent: node.componentStack, - type: resumeSegmentID.type, - owner: resumeSegmentID._owner, - stack: null + type: error.type, + owner: error._owner, + stack: error._debugStack }; console.error( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - request, + resumeSlots, componentName ); - node.componentStack = didWarnForKey; + node.componentStack = thrownInfo; } } task.treeContext = pushTreeContext(replay, replayNodes, j); - renderNode(request$jscomp$0, task, childIndex, j); + renderNode(request, task, childIndex, j); } task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; } function untrackBoundary(request, boundary) { request = request.trackedPostpones; @@ -6257,7 +6396,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function spawnNewSuspendedRenderTask(request, task, thenableState) { @@ -6287,7 +6428,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function renderNode(request, task, node, childIndex) { @@ -6296,6 +6439,7 @@ previousKeyPath = task.keyPath, previousTreeContext = task.treeContext, previousComponentStack = task.componentStack, + previousDebugTask = task.debugTask, segment = task.blockedSegment; if (null === segment) try { @@ -6322,6 +6466,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6334,6 +6479,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6368,6 +6514,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6380,6 +6527,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6393,26 +6541,6 @@ switchContext(previousContext); throw node; } - function erroredReplay( - request, - boundary, - error, - errorInfo, - replayNodes, - resumeSlots - ) { - var errorDigest = logRecoverableError(request, error, errorInfo); - abortRemainingReplayNodes( - request, - boundary, - replayNodes, - resumeSlots, - error, - errorDigest, - errorInfo, - !1 - ); - } function abortTaskSoft(task) { var boundary = task.blockedBoundary; task = task.blockedSegment; @@ -6501,14 +6629,14 @@ if (13 !== request.status && request.status !== CLOSED) { boundary = task.replay; if (null === boundary) { - logRecoverableError(request, error, segment); - fatalError(request, error); + logRecoverableError(request, error, segment, null); + fatalError(request, error, segment, null); return; } boundary.pendingTasks--; 0 === boundary.pendingTasks && 0 < boundary.nodes.length && - ((task = logRecoverableError(request, error, segment)), + ((task = logRecoverableError(request, error, segment, null)), abortRemainingReplayNodes( request, null, @@ -6526,7 +6654,7 @@ boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = logRecoverableError(request, error, segment)), + (task = logRecoverableError(request, error, segment, null)), (boundary.status = CLIENT_RENDERED), encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), @@ -6601,7 +6729,7 @@ } } } catch (error) { - logRecoverableError(request, error, {}); + logRecoverableError(request, error, {}, null); } } function completeShell(request) { @@ -6679,10 +6807,10 @@ request.allPendingTasks--; 0 === request.allPendingTasks && completeAll(request); } - function performWork(request$jscomp$1) { + function performWork(request$jscomp$2) { if ( - request$jscomp$1.status !== CLOSED && - 13 !== request$jscomp$1.status + request$jscomp$2.status !== CLOSED && + 13 !== request$jscomp$2.status ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; @@ -6690,16 +6818,16 @@ var prevAsyncDispatcher = ReactSharedInternals.A; ReactSharedInternals.A = DefaultAsyncDispatcher; var prevRequest = currentRequest; - currentRequest = request$jscomp$1; + currentRequest = request$jscomp$2; var prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; var prevResumableState = currentResumableState; - currentResumableState = request$jscomp$1.resumableState; + currentResumableState = request$jscomp$2.resumableState; try { - var pingedTasks = request$jscomp$1.pingedTasks, + var pingedTasks = request$jscomp$2.pingedTasks, i; for (i = 0; i < pingedTasks.length; i++) { - var request = request$jscomp$1, + var request = request$jscomp$2, task = pingedTasks[i], segment = task.blockedSegment; if (null === segment) { @@ -6747,16 +6875,32 @@ } else { request.replay.pendingTasks--; request.abortSet.delete(request); - var errorInfo = getThrownInfo(request.componentStack); - erroredReplay( - request$jscomp$0, - request.blockedBoundary, - 12 === request$jscomp$0.status - ? request$jscomp$0.fatalError - : x, - errorInfo, - request.replay.nodes, - request.replay.slots + var errorInfo = getThrownInfo(request.componentStack), + errorDigest = void 0, + request$jscomp$1 = request$jscomp$0, + boundary = request.blockedBoundary, + error$jscomp$0 = + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, + errorInfo$jscomp$0 = errorInfo, + replayNodes = request.replay.nodes, + resumeSlots = request.replay.slots; + errorDigest = logRecoverableError( + request$jscomp$1, + error$jscomp$0, + errorInfo$jscomp$0, + request.debugTask + ); + abortRemainingReplayNodes( + request$jscomp$1, + boundary, + replayNodes, + resumeSlots, + error$jscomp$0, + errorDigest, + errorInfo$jscomp$0, + !1 ); request$jscomp$0.pendingRootTasks--; 0 === request$jscomp$0.pendingRootTasks && @@ -6769,98 +6913,107 @@ currentTaskInDEV = prevTaskInDEV; } } - } else { - request$jscomp$0 = prevTaskInDEV = void 0; - var task$jscomp$0 = task, - segment$jscomp$0 = segment; - if (segment$jscomp$0.status === PENDING) { - segment$jscomp$0.status = 6; - switchContext(task$jscomp$0.context); - request$jscomp$0 = currentTaskInDEV; - currentTaskInDEV = task$jscomp$0; - var childrenLength = segment$jscomp$0.children.length, - chunkLength = segment$jscomp$0.chunks.length; - try { - retryNode(request, task$jscomp$0), - segment$jscomp$0.lastPushedText && - segment$jscomp$0.textEmbedded && - segment$jscomp$0.chunks.push(textSeparator), - task$jscomp$0.abortSet.delete(task$jscomp$0), - (segment$jscomp$0.status = COMPLETED), - finishedTask( - request, - task$jscomp$0.blockedBoundary, - segment$jscomp$0 - ); - } catch (thrownValue) { - resetHooksState(); - segment$jscomp$0.children.length = childrenLength; - segment$jscomp$0.chunks.length = chunkLength; - var x$jscomp$0 = - thrownValue === SuspenseException - ? getSuspendedThenable() - : 12 === request.status - ? request.fatalError - : thrownValue; - if ( - "object" === typeof x$jscomp$0 && - null !== x$jscomp$0 && - "function" === typeof x$jscomp$0.then - ) { - segment$jscomp$0.status = PENDING; - task$jscomp$0.thenableState = - getThenableStateAfterSuspending(); - var ping$jscomp$0 = task$jscomp$0.ping; - x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); - } else { - var errorInfo$jscomp$0 = getThrownInfo( - task$jscomp$0.componentStack - ); - task$jscomp$0.abortSet.delete(task$jscomp$0); - segment$jscomp$0.status = 4; - var boundary = task$jscomp$0.blockedBoundary; - prevTaskInDEV = logRecoverableError( - request, - x$jscomp$0, - errorInfo$jscomp$0 - ); - null === boundary - ? fatalError(request, x$jscomp$0) - : (boundary.pendingTasks--, - boundary.status !== CLIENT_RENDERED && - ((boundary.status = CLIENT_RENDERED), - encodeErrorForBoundary( - boundary, - prevTaskInDEV, - x$jscomp$0, - errorInfo$jscomp$0, - !1 + } else if ( + ((request$jscomp$0 = prevTaskInDEV = void 0), + (errorDigest = task), + (request$jscomp$1 = segment), + request$jscomp$1.status === PENDING) + ) { + request$jscomp$1.status = 6; + switchContext(errorDigest.context); + request$jscomp$0 = currentTaskInDEV; + currentTaskInDEV = errorDigest; + var childrenLength = request$jscomp$1.children.length, + chunkLength = request$jscomp$1.chunks.length; + try { + retryNode(request, errorDigest), + request$jscomp$1.lastPushedText && + request$jscomp$1.textEmbedded && + request$jscomp$1.chunks.push(textSeparator), + errorDigest.abortSet.delete(errorDigest), + (request$jscomp$1.status = COMPLETED), + finishedTask( + request, + errorDigest.blockedBoundary, + request$jscomp$1 + ); + } catch (thrownValue) { + resetHooksState(); + request$jscomp$1.children.length = childrenLength; + request$jscomp$1.chunks.length = chunkLength; + var x$jscomp$0 = + thrownValue === SuspenseException + ? getSuspendedThenable() + : 12 === request.status + ? request.fatalError + : thrownValue; + if ( + "object" === typeof x$jscomp$0 && + null !== x$jscomp$0 && + "function" === typeof x$jscomp$0.then + ) { + request$jscomp$1.status = PENDING; + errorDigest.thenableState = getThenableStateAfterSuspending(); + var ping$jscomp$0 = errorDigest.ping; + x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); + } else { + var errorInfo$jscomp$1 = getThrownInfo( + errorDigest.componentStack + ); + errorDigest.abortSet.delete(errorDigest); + request$jscomp$1.status = 4; + var boundary$jscomp$0 = errorDigest.blockedBoundary, + debugTask = errorDigest.debugTask; + prevTaskInDEV = logRecoverableError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ); + null === boundary$jscomp$0 + ? fatalError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ) + : (boundary$jscomp$0.pendingTasks--, + boundary$jscomp$0.status !== CLIENT_RENDERED && + ((boundary$jscomp$0.status = CLIENT_RENDERED), + encodeErrorForBoundary( + boundary$jscomp$0, + prevTaskInDEV, + x$jscomp$0, + errorInfo$jscomp$1, + !1 + ), + untrackBoundary(request, boundary$jscomp$0), + boundary$jscomp$0.parentFlushed && + request.clientRenderedBoundaries.push( + boundary$jscomp$0 ), - untrackBoundary(request, boundary), - boundary.parentFlushed && - request.clientRenderedBoundaries.push(boundary), - 0 === request.pendingRootTasks && - null === request.trackedPostpones && - null !== boundary.contentPreamble && - preparePreamble(request))); - request.allPendingTasks--; - 0 === request.allPendingTasks && completeAll(request); - } - } finally { - currentTaskInDEV = request$jscomp$0; + 0 === request.pendingRootTasks && + null === request.trackedPostpones && + null !== boundary$jscomp$0.contentPreamble && + preparePreamble(request))); + request.allPendingTasks--; + 0 === request.allPendingTasks && completeAll(request); } + } finally { + currentTaskInDEV = request$jscomp$0; } } } pingedTasks.splice(0, i); - null !== request$jscomp$1.destination && + null !== request$jscomp$2.destination && flushCompletedQueues( - request$jscomp$1, - request$jscomp$1.destination + request$jscomp$2, + request$jscomp$2.destination ); } catch (error) { - logRecoverableError(request$jscomp$1, error, {}), - fatalError(request$jscomp$1, error); + (pingedTasks = {}), + logRecoverableError(request$jscomp$2, error, pingedTasks, null), + fatalError(request$jscomp$2, error, pingedTasks, null); } finally { (currentResumableState = prevResumableState), (ReactSharedInternals.H = prevDispatcher), @@ -7574,7 +7727,9 @@ try { flushCompletedQueues(request, destination); } catch (error) { - logRecoverableError(request, error, {}), fatalError(request, error); + (destination = {}), + logRecoverableError(request, error, destination, null), + fatalError(request, error, destination, null); } } } @@ -7600,16 +7755,18 @@ null !== request.destination && flushCompletedQueues(request, request.destination); } catch (error$4) { - logRecoverableError(request, error$4, {}), fatalError(request, error$4); + (reason = {}), + logRecoverableError(request, error$4, reason, null), + fatalError(request, error$4, reason, null); } } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-canary-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-canary-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react"), @@ -9270,5 +9427,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js index 256fb94c3dab12..d82e24f7f6c46a 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js @@ -6320,11 +6320,11 @@ function abort(request, reason) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-canary-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-canary-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6481,4 +6481,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js index 624535bd13358d..a5f434e07d2257 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js @@ -4227,6 +4227,27 @@ "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeComponentStackByType(type) { if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) @@ -4266,18 +4287,6 @@ } return ""; } - function getStackByComponentStackNode(componentStack) { - try { - var info = ""; - do - (info += describeComponentStackByType(componentStack.type)), - (componentStack = componentStack.parent); - while (componentStack); - return info; - } catch (x) { - return "\nError generating stack: " + x.message + "\n" + x.stack; - } - } function defaultErrorHandler(error) { if ( "object" === typeof error && @@ -4401,7 +4410,9 @@ null, emptyTreeContext, null, - !1 + !1, + emptyContextObject, + null ); pushComponentStack(children); resumableState.pingedTasks.push(children); @@ -4499,7 +4510,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4525,6 +4538,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4542,7 +4556,9 @@ context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4569,6 +4585,7 @@ thenableState: thenableState, isFallback: isFallback }; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -4595,22 +4612,63 @@ }; } function getCurrentStackInDEV() { - return null === currentTaskInDEV || - null === currentTaskInDEV.componentStack - ? "" - : getStackByComponentStackNode(currentTaskInDEV.componentStack); + if (null === currentTaskInDEV || null === currentTaskInDEV.componentStack) + return ""; + var componentStack = currentTaskInDEV.componentStack; + try { + var info = ""; + if ("string" === typeof componentStack.type) + info += describeBuiltInComponentFrame(componentStack.type); + else if ("function" === typeof componentStack.type) { + if (!componentStack.owner) { + var JSCompiler_temp_const = info, + fn = componentStack.type, + name = fn ? fn.displayName || fn.name : ""; + var JSCompiler_inline_result = name + ? describeBuiltInComponentFrame(name) + : ""; + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } else + componentStack.owner || + (info += describeComponentStackByType(componentStack.type)); + for (; componentStack; ) + (JSCompiler_temp_const = null), + null != componentStack.debugStack + ? (JSCompiler_temp_const = formatOwnerStack( + componentStack.debugStack + )) + : ((JSCompiler_inline_result = componentStack), + null != JSCompiler_inline_result.stack && + (JSCompiler_temp_const = + "string" !== typeof JSCompiler_inline_result.stack + ? (JSCompiler_inline_result.stack = formatOwnerStack( + JSCompiler_inline_result.stack + )) + : JSCompiler_inline_result.stack)), + (componentStack = componentStack.owner) && + JSCompiler_temp_const && + (info += "\n" + JSCompiler_temp_const); + var JSCompiler_inline_result$jscomp$0 = info; + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function pushServerComponentStack(task, debugInfo) { if (null != debugInfo) for (var i = 0; i < debugInfo.length; i++) { var componentInfo = debugInfo[i]; "string" === typeof componentInfo.name && - (task.componentStack = { + void 0 !== componentInfo.debugStack && + ((task.componentStack = { parent: task.componentStack, type: componentInfo, owner: componentInfo.owner, - stack: null - }); + stack: componentInfo.debugStack + }), + (task.debugTask = componentInfo.debugTask)); } } function pushComponentStack(task) { @@ -4619,13 +4677,15 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - owner = node._owner; + owner = node._owner, + stack = node._debugStack; pushServerComponentStack(task, node._debugInfo); + task.debugTask = node._debugTask; task.componentStack = { parent: task.componentStack, type: type, owner: owner, - stack: null + stack: stack }; break; case REACT_LAZY_TYPE: @@ -4636,14 +4696,24 @@ pushServerComponentStack(task, node._debugInfo); } } - function getThrownInfo(node) { + function getThrownInfo(node$jscomp$0) { var errorInfo = {}; - node && + node$jscomp$0 && Object.defineProperty(errorInfo, "componentStack", { configurable: !0, enumerable: !0, get: function () { - var stack = getStackByComponentStackNode(node); + try { + var info = "", + node = node$jscomp$0; + do + (info += describeComponentStackByType(node.type)), + (node = node.parent); + while (node); + var stack = info; + } catch (x) { + stack = "\nError generating stack: " + x.message + "\n" + x.stack; + } Object.defineProperty(errorInfo, "componentStack", { value: stack }); @@ -4674,9 +4744,11 @@ boundary.errorStack = null !== error ? wasAborted + error : null; boundary.errorComponentStack = thrownInfo.componentStack; } - function logRecoverableError(request, error, errorInfo) { + function logRecoverableError(request, error, errorInfo, debugTask) { request = request.onError; - error = request(error, errorInfo); + error = debugTask + ? debugTask.run(request.bind(null, error, errorInfo)) + : request(error, errorInfo); if (null != error && "string" !== typeof error) console.error( 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "%s" instead', @@ -4684,11 +4756,13 @@ ); else return error; } - function fatalError(request, error) { - var onShellError = request.onShellError, - onFatalError = request.onFatalError; - onShellError(error); - onFatalError(error); + function fatalError(request, error, errorInfo, debugTask) { + errorInfo = request.onShellError; + var onFatalError = request.onFatalError; + debugTask + ? (debugTask.run(errorInfo.bind(null, error)), + debugTask.run(onFatalError.bind(null, error))) + : (errorInfo(error), onFatalError(error)); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) : ((request.status = 13), (request.fatalError = error)); @@ -5268,7 +5342,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(preambleTask); request.pingedTasks.push(preambleTask); @@ -5453,7 +5529,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedPrimaryTask); request.pingedTasks.push(suspendedPrimaryTask); @@ -5492,7 +5570,8 @@ var errorDigest = logRecoverableError( request, error, - thrownInfo + thrownInfo, + task.debugTask ); encodeErrorForBoundary( newBoundary, @@ -5524,7 +5603,9 @@ task.context, task.treeContext, task.componentStack, - !0 + !0, + emptyContextObject, + task.debugTask ); pushComponentStack(suspendedFallbackTask); request.pingedTasks.push(suspendedFallbackTask); @@ -5676,15 +5757,183 @@ (task.replay = prevReplay), (task.blockedSegment = null); } } + function replayElement( + request, + task, + keyPath, + name, + keyOrIndex, + childIndex, + type, + props, + ref, + replay + ) { + childIndex = replay.nodes; + for (var i = 0; i < childIndex.length; i++) { + var node = childIndex[i]; + if (keyOrIndex === node[1]) { + if (4 === node.length) { + if (null !== name && name !== node[0]) + throw Error( + "Expected the resume to render <" + + node[0] + + "> in this slot but instead it rendered <" + + name + + ">. The tree doesn't match so React will fallback to client rendering." + ); + var childNodes = node[2]; + node = node[3]; + name = task.node; + task.replay = { nodes: childNodes, slots: node, pendingTasks: 1 }; + try { + renderElement(request, task, keyPath, type, props, ref); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + } catch (x) { + if ( + "object" === typeof x && + null !== x && + (x === SuspenseException || "function" === typeof x.then) + ) + throw (task.node === name && (task.replay = replay), x); + task.replay.pendingTasks--; + type = getThrownInfo(task.componentStack); + props = request; + request = task.blockedBoundary; + keyPath = x; + ref = node; + node = logRecoverableError(props, keyPath, type, task.debugTask); + abortRemainingReplayNodes( + props, + request, + childNodes, + ref, + keyPath, + node, + type, + !1 + ); + } + task.replay = replay; + } else { + if (type !== REACT_SUSPENSE_TYPE) + throw Error( + "Expected the resume to render in this slot but instead it rendered <" + + (getComponentNameFromType(type) || "Unknown") + + ">. The tree doesn't match so React will fallback to client rendering." + ); + a: { + replay = void 0; + type = node[5]; + ref = node[2]; + name = node[3]; + keyOrIndex = null === node[4] ? [] : node[4][2]; + node = null === node[4] ? null : node[4][3]; + var prevKeyPath = task.keyPath, + previousReplaySet = task.replay, + parentBoundary = task.blockedBoundary, + parentHoistableState = task.hoistableState, + content = props.children, + fallback = props.fallback, + fallbackAbortSet = new Set(); + props = + task.formatContext.insertionMode < HTML_MODE + ? createSuspenseBoundary( + request, + fallbackAbortSet, + createPreambleState(), + createPreambleState() + ) + : createSuspenseBoundary( + request, + fallbackAbortSet, + null, + null + ); + props.parentFlushed = !0; + props.rootSegmentID = type; + task.blockedBoundary = props; + task.hoistableState = props.contentState; + task.keyPath = keyPath; + task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; + try { + renderNode(request, task, content, -1); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + if (0 === props.pendingTasks && props.status === PENDING) { + props.status = COMPLETED; + request.completedBoundaries.push(props); + break a; + } + } catch (error) { + (props.status = CLIENT_RENDERED), + (childNodes = getThrownInfo(task.componentStack)), + (replay = logRecoverableError( + request, + error, + childNodes, + task.debugTask + )), + encodeErrorForBoundary(props, replay, error, childNodes, !1), + task.replay.pendingTasks--, + request.clientRenderedBoundaries.push(props); + } finally { + (task.blockedBoundary = parentBoundary), + (task.hoistableState = parentHoistableState), + (task.replay = previousReplaySet), + (task.keyPath = prevKeyPath); + } + props = createReplayTask( + request, + null, + { nodes: keyOrIndex, slots: node, pendingTasks: 0 }, + fallback, + -1, + parentBoundary, + props.fallbackState, + fallbackAbortSet, + [keyPath[0], "Suspense Fallback", keyPath[2]], + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + !0, + emptyContextObject, + task.debugTask + ); + pushComponentStack(props); + request.pingedTasks.push(props); + } + } + childIndex.splice(i, 1); + break; + } + } + } function renderNodeDestructive(request, task, node, childIndex) { null !== task.replay && "number" === typeof task.replay.slots ? resumeNode(request, task, task.replay.slots, node, childIndex) : ((task.node = node), (task.childIndex = childIndex), (node = task.componentStack), + (childIndex = task.debugTask), pushComponentStack(task), retryNode(request, task), - (task.componentStack = node)); + (task.componentStack = node), + (task.debugTask = childIndex)); } function retryNode(request, task) { var node = task.node, @@ -5694,178 +5943,56 @@ switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - key = node.key, - props = node.props; - node = props.ref; - var ref = void 0 !== node ? node : null, - name = getComponentNameFromType(type), - keyOrIndex = - null == key ? (-1 === childIndex ? 0 : childIndex) : key, - keyPath = [task.keyPath, name, keyOrIndex]; - if (null !== task.replay) { - var replay = task.replay; - childIndex = replay.nodes; - for (node = 0; node < childIndex.length; node++) - if (((key = childIndex[node]), keyOrIndex === key[1])) { - if (4 === key.length) { - if (null !== name && name !== key[0]) - throw Error( - "Expected the resume to render <" + - key[0] + - "> in this slot but instead it rendered <" + - name + - ">. The tree doesn't match so React will fallback to client rendering." - ); - var childNodes = key[2]; - key = key[3]; - name = task.node; - task.replay = { - nodes: childNodes, - slots: key, - pendingTasks: 1 - }; - try { - renderElement(request, task, keyPath, type, props, ref); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - } catch (x) { - if ( - "object" === typeof x && - null !== x && - (x === SuspenseException || - "function" === typeof x.then) - ) - throw ( - (task.node === name && (task.replay = replay), x) - ); - task.replay.pendingTasks--; - props = getThrownInfo(task.componentStack); - erroredReplay( - request, - task.blockedBoundary, - x, - props, - childNodes, - key - ); - } - task.replay = replay; - } else { - if (type !== REACT_SUSPENSE_TYPE) - throw Error( - "Expected the resume to render in this slot but instead it rendered <" + - (getComponentNameFromType(type) || "Unknown") + - ">. The tree doesn't match so React will fallback to client rendering." - ); - a: { - type = void 0; - ref = key[5]; - replay = key[2]; - name = key[3]; - keyOrIndex = null === key[4] ? [] : key[4][2]; - key = null === key[4] ? null : key[4][3]; - var prevKeyPath = task.keyPath, - previousReplaySet = task.replay, - parentBoundary = task.blockedBoundary, - parentHoistableState = task.hoistableState, - content = props.children, - fallback = props.fallback, - fallbackAbortSet = new Set(); - props = - task.formatContext.insertionMode < HTML_MODE - ? createSuspenseBoundary( - request, - fallbackAbortSet, - createPreambleState(), - createPreambleState() - ) - : createSuspenseBoundary( - request, - fallbackAbortSet, - null, - null - ); - props.parentFlushed = !0; - props.rootSegmentID = ref; - task.blockedBoundary = props; - task.hoistableState = props.contentState; - task.keyPath = keyPath; - task.replay = { - nodes: replay, - slots: name, - pendingTasks: 1 - }; - try { - renderNode(request, task, content, -1); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - if ( - 0 === props.pendingTasks && - props.status === PENDING - ) { - props.status = COMPLETED; - request.completedBoundaries.push(props); - break a; - } - } catch (error) { - (props.status = CLIENT_RENDERED), - (childNodes = getThrownInfo(task.componentStack)), - (type = logRecoverableError( - request, - error, - childNodes - )), - encodeErrorForBoundary( - props, - type, - error, - childNodes, - !1 - ), - task.replay.pendingTasks--, - request.clientRenderedBoundaries.push(props); - } finally { - (task.blockedBoundary = parentBoundary), - (task.hoistableState = parentHoistableState), - (task.replay = previousReplaySet), - (task.keyPath = prevKeyPath); - } - childNodes = createReplayTask( - request, - null, - { nodes: keyOrIndex, slots: key, pendingTasks: 0 }, - fallback, - -1, - parentBoundary, - props.fallbackState, - fallbackAbortSet, - [keyPath[0], "Suspense Fallback", keyPath[2]], - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - !0 - ); - pushComponentStack(childNodes); - request.pingedTasks.push(childNodes); - } - } - childIndex.splice(node, 1); - break; - } - } else renderElement(request, task, keyPath, type, props, ref); + key = node.key; + node = node.props; + var refProp = node.ref; + refProp = void 0 !== refProp ? refProp : null; + var debugTask = task.debugTask, + name = getComponentNameFromType(type); + key = null == key ? (-1 === childIndex ? 0 : childIndex) : key; + var keyPath = [task.keyPath, name, key]; + null !== task.replay + ? debugTask + ? debugTask.run( + replayElement.bind( + null, + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + ) + : replayElement( + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + : debugTask + ? debugTask.run( + renderElement.bind( + null, + request, + task, + keyPath, + type, + node, + refProp + ) + ) + : renderElement(request, task, keyPath, type, node, refProp); return; case REACT_PORTAL_TYPE: throw Error( @@ -5882,21 +6009,20 @@ return; } null === node || "object" !== typeof node - ? (props = null) - : ((childNodes = + ? (key = null) + : ((type = (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || node["@@iterator"]), - (props = "function" === typeof childNodes ? childNodes : null)); - if (props && (childNodes = props.call(node))) { - if (childNodes === node) { + (key = "function" === typeof type ? type : null)); + if (key && (type = key.call(node))) { + if (type === node) { if ( -1 !== childIndex || null === task.componentStack || "function" !== typeof task.componentStack.type || "[object GeneratorFunction]" !== Object.prototype.toString.call(task.componentStack.type) || - "[object Generator]" !== - Object.prototype.toString.call(childNodes) + "[object Generator]" !== Object.prototype.toString.call(type) ) didWarnAboutGenerators || console.error( @@ -5904,18 +6030,18 @@ ), (didWarnAboutGenerators = !0); } else - node.entries !== props || + node.entries !== key || didWarnAboutMaps || (console.error( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ), (didWarnAboutMaps = !0)); - node = childNodes.next(); + node = type.next(); if (!node.done) { - props = []; - do props.push(node.value), (node = childNodes.next()); + key = []; + do key.push(node.value), (node = type.next()); while (!node.done); - renderChildrenArray(request, task, props, childIndex); + renderChildrenArray(request, task, key, childIndex); } return; } @@ -5936,39 +6062,39 @@ node._currentValue, childIndex ); - childIndex = Object.prototype.toString.call(node); + request = Object.prototype.toString.call(node); throw Error( "Objects are not valid as a React child (found: " + - ("[object Object]" === childIndex + ("[object Object]" === request ? "object with keys {" + Object.keys(node).join(", ") + "}" - : childIndex) + + : request) + "). If you meant to render a collection of children, use an array instead." ); } "string" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : "number" === typeof node || "bigint" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, "" + node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : ("function" === typeof node && - ((childIndex = node.displayName || node.name || "Component"), + ((request = node.displayName || node.name || "Component"), console.error( "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.", - childIndex, - childIndex + request, + request )), "symbol" === typeof node && console.error( @@ -5977,9 +6103,10 @@ )); } } - function renderChildrenArray(request$jscomp$0, task, children, childIndex) { + function renderChildrenArray(request, task, children, childIndex) { var prevKeyPath = task.keyPath, previousComponentStack = task.componentStack; + var previousDebugTask = task.debugTask; pushServerComponentStack(task, task.node._debugInfo); if ( -1 !== childIndex && @@ -5997,7 +6124,7 @@ node = node[3]; task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 }; try { - renderChildrenArray(request$jscomp$0, task, children, -1); + renderChildrenArray(request, task, children, -1); if ( 1 === task.replay.pendingTasks && 0 < task.replay.nodes.length @@ -6014,14 +6141,25 @@ ) throw x; task.replay.pendingTasks--; - children = getThrownInfo(task.componentStack); - erroredReplay( - request$jscomp$0, - task.blockedBoundary, - x, + var thrownInfo = getThrownInfo(task.componentStack); + children = task.blockedBoundary; + var error = x, + resumeSlots = node; + node = logRecoverableError( + request, + error, + thrownInfo, + task.debugTask + ); + abortRemainingReplayNodes( + request, children, childIndex, - node + resumeSlots, + error, + node, + thrownInfo, + !1 ); } task.replay = replay; @@ -6031,6 +6169,7 @@ } task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } replay = task.treeContext; @@ -6039,98 +6178,98 @@ null !== task.replay && ((j = task.replay.slots), null !== j && "object" === typeof j) ) { - for (childIndex = 0; childIndex < replayNodes; childIndex++) { - node = children[childIndex]; - task.treeContext = pushTreeContext(replay, replayNodes, childIndex); - var resumeSegmentID = j[childIndex]; - "number" === typeof resumeSegmentID - ? (resumeNode( - request$jscomp$0, - task, - resumeSegmentID, - node, - childIndex - ), - delete j[childIndex]) - : renderNode(request$jscomp$0, task, node, childIndex); - } + for (childIndex = 0; childIndex < replayNodes; childIndex++) + (node = children[childIndex]), + (task.treeContext = pushTreeContext( + replay, + replayNodes, + childIndex + )), + (error = j[childIndex]), + "number" === typeof error + ? (resumeNode(request, task, error, node, childIndex), + delete j[childIndex]) + : renderNode(request, task, node, childIndex); task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; return; } for (j = 0; j < replayNodes; j++) { childIndex = children[j]; - var request = request$jscomp$0; + resumeSlots = request; node = task; - resumeSegmentID = childIndex; + error = childIndex; if ( - null !== resumeSegmentID && - "object" === typeof resumeSegmentID && - (resumeSegmentID.$$typeof === REACT_ELEMENT_TYPE || - resumeSegmentID.$$typeof === REACT_PORTAL_TYPE) && - resumeSegmentID._store && - ((!resumeSegmentID._store.validated && null == resumeSegmentID.key) || - 2 === resumeSegmentID._store.validated) + null !== error && + "object" === typeof error && + (error.$$typeof === REACT_ELEMENT_TYPE || + error.$$typeof === REACT_PORTAL_TYPE) && + error._store && + ((!error._store.validated && null == error.key) || + 2 === error._store.validated) ) { - if ("object" !== typeof resumeSegmentID._store) + if ("object" !== typeof error._store) throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ); - resumeSegmentID._store.validated = 1; - var didWarnForKey = request.didWarnForKey; - null == didWarnForKey && - (didWarnForKey = request.didWarnForKey = new WeakSet()); - request = node.componentStack; - if (null !== request && !didWarnForKey.has(request)) { - didWarnForKey.add(request); - var componentName = getComponentNameFromType(resumeSegmentID.type); - didWarnForKey = resumeSegmentID._owner; - var parentOwner = request.owner; - request = ""; + error._store.validated = 1; + thrownInfo = resumeSlots.didWarnForKey; + null == thrownInfo && + (thrownInfo = resumeSlots.didWarnForKey = new WeakSet()); + resumeSlots = node.componentStack; + if (null !== resumeSlots && !thrownInfo.has(resumeSlots)) { + thrownInfo.add(resumeSlots); + var componentName = getComponentNameFromType(error.type); + thrownInfo = error._owner; + var parentOwner = resumeSlots.owner; + resumeSlots = ""; if (parentOwner && "undefined" !== typeof parentOwner.type) { var name = getComponentNameFromType(parentOwner.type); name && - (request = "\n\nCheck the render method of `" + name + "`."); + (resumeSlots = + "\n\nCheck the render method of `" + name + "`."); } - request || + resumeSlots || (componentName && - (request = + (resumeSlots = "\n\nCheck the top-level render call using <" + componentName + ">.")); componentName = ""; - null != didWarnForKey && - parentOwner !== didWarnForKey && + null != thrownInfo && + parentOwner !== thrownInfo && ((parentOwner = null), - "undefined" !== typeof didWarnForKey.type - ? (parentOwner = getComponentNameFromType(didWarnForKey.type)) - : "string" === typeof didWarnForKey.name && - (parentOwner = didWarnForKey.name), + "undefined" !== typeof thrownInfo.type + ? (parentOwner = getComponentNameFromType(thrownInfo.type)) + : "string" === typeof thrownInfo.name && + (parentOwner = thrownInfo.name), parentOwner && (componentName = " It was passed a child from " + parentOwner + ".")); - didWarnForKey = node.componentStack; + thrownInfo = node.componentStack; node.componentStack = { parent: node.componentStack, - type: resumeSegmentID.type, - owner: resumeSegmentID._owner, - stack: null + type: error.type, + owner: error._owner, + stack: error._debugStack }; console.error( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - request, + resumeSlots, componentName ); - node.componentStack = didWarnForKey; + node.componentStack = thrownInfo; } } task.treeContext = pushTreeContext(replay, replayNodes, j); - renderNode(request$jscomp$0, task, childIndex, j); + renderNode(request, task, childIndex, j); } task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; } function untrackBoundary(request, boundary) { request = request.trackedPostpones; @@ -6156,7 +6295,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function spawnNewSuspendedRenderTask(request, task, thenableState) { @@ -6186,7 +6327,9 @@ task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + task.debugTask ); } function renderNode(request, task, node, childIndex) { @@ -6195,6 +6338,7 @@ previousKeyPath = task.keyPath, previousTreeContext = task.treeContext, previousComponentStack = task.componentStack, + previousDebugTask = task.debugTask, segment = task.blockedSegment; if (null === segment) try { @@ -6221,6 +6365,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6233,6 +6378,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6267,6 +6413,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6279,6 +6426,7 @@ task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + task.debugTask = previousDebugTask; switchContext(previousContext); return; } @@ -6292,26 +6440,6 @@ switchContext(previousContext); throw node; } - function erroredReplay( - request, - boundary, - error, - errorInfo, - replayNodes, - resumeSlots - ) { - var errorDigest = logRecoverableError(request, error, errorInfo); - abortRemainingReplayNodes( - request, - boundary, - replayNodes, - resumeSlots, - error, - errorDigest, - errorInfo, - !1 - ); - } function abortTaskSoft(task) { var boundary = task.blockedBoundary; task = task.blockedSegment; @@ -6400,14 +6528,14 @@ if (13 !== request.status && request.status !== CLOSED) { boundary = task.replay; if (null === boundary) { - logRecoverableError(request, error, segment); - fatalError(request, error); + logRecoverableError(request, error, segment, null); + fatalError(request, error, segment, null); return; } boundary.pendingTasks--; 0 === boundary.pendingTasks && 0 < boundary.nodes.length && - ((task = logRecoverableError(request, error, segment)), + ((task = logRecoverableError(request, error, segment, null)), abortRemainingReplayNodes( request, null, @@ -6425,7 +6553,7 @@ boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = logRecoverableError(request, error, segment)), + (task = logRecoverableError(request, error, segment, null)), (boundary.status = CLIENT_RENDERED), encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), @@ -6500,7 +6628,7 @@ } } } catch (error) { - logRecoverableError(request, error, {}); + logRecoverableError(request, error, {}, null); } } function completeShell(request) { @@ -6578,10 +6706,10 @@ request.allPendingTasks--; 0 === request.allPendingTasks && completeAll(request); } - function performWork(request$jscomp$1) { + function performWork(request$jscomp$2) { if ( - request$jscomp$1.status !== CLOSED && - 13 !== request$jscomp$1.status + request$jscomp$2.status !== CLOSED && + 13 !== request$jscomp$2.status ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; @@ -6589,16 +6717,16 @@ var prevAsyncDispatcher = ReactSharedInternals.A; ReactSharedInternals.A = DefaultAsyncDispatcher; var prevRequest = currentRequest; - currentRequest = request$jscomp$1; + currentRequest = request$jscomp$2; var prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; var prevResumableState = currentResumableState; - currentResumableState = request$jscomp$1.resumableState; + currentResumableState = request$jscomp$2.resumableState; try { - var pingedTasks = request$jscomp$1.pingedTasks, + var pingedTasks = request$jscomp$2.pingedTasks, i; for (i = 0; i < pingedTasks.length; i++) { - var request = request$jscomp$1, + var request = request$jscomp$2, task = pingedTasks[i], segment = task.blockedSegment; if (null === segment) { @@ -6646,16 +6774,32 @@ } else { request.replay.pendingTasks--; request.abortSet.delete(request); - var errorInfo = getThrownInfo(request.componentStack); - erroredReplay( - request$jscomp$0, - request.blockedBoundary, - 12 === request$jscomp$0.status - ? request$jscomp$0.fatalError - : x, - errorInfo, - request.replay.nodes, - request.replay.slots + var errorInfo = getThrownInfo(request.componentStack), + errorDigest = void 0, + request$jscomp$1 = request$jscomp$0, + boundary = request.blockedBoundary, + error$jscomp$0 = + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, + errorInfo$jscomp$0 = errorInfo, + replayNodes = request.replay.nodes, + resumeSlots = request.replay.slots; + errorDigest = logRecoverableError( + request$jscomp$1, + error$jscomp$0, + errorInfo$jscomp$0, + request.debugTask + ); + abortRemainingReplayNodes( + request$jscomp$1, + boundary, + replayNodes, + resumeSlots, + error$jscomp$0, + errorDigest, + errorInfo$jscomp$0, + !1 ); request$jscomp$0.pendingRootTasks--; 0 === request$jscomp$0.pendingRootTasks && @@ -6668,98 +6812,107 @@ currentTaskInDEV = prevTaskInDEV; } } - } else { - request$jscomp$0 = prevTaskInDEV = void 0; - var task$jscomp$0 = task, - segment$jscomp$0 = segment; - if (segment$jscomp$0.status === PENDING) { - segment$jscomp$0.status = 6; - switchContext(task$jscomp$0.context); - request$jscomp$0 = currentTaskInDEV; - currentTaskInDEV = task$jscomp$0; - var childrenLength = segment$jscomp$0.children.length, - chunkLength = segment$jscomp$0.chunks.length; - try { - retryNode(request, task$jscomp$0), - segment$jscomp$0.lastPushedText && - segment$jscomp$0.textEmbedded && - segment$jscomp$0.chunks.push(textSeparator), - task$jscomp$0.abortSet.delete(task$jscomp$0), - (segment$jscomp$0.status = COMPLETED), - finishedTask( - request, - task$jscomp$0.blockedBoundary, - segment$jscomp$0 - ); - } catch (thrownValue) { - resetHooksState(); - segment$jscomp$0.children.length = childrenLength; - segment$jscomp$0.chunks.length = chunkLength; - var x$jscomp$0 = - thrownValue === SuspenseException - ? getSuspendedThenable() - : 12 === request.status - ? request.fatalError - : thrownValue; - if ( - "object" === typeof x$jscomp$0 && - null !== x$jscomp$0 && - "function" === typeof x$jscomp$0.then - ) { - segment$jscomp$0.status = PENDING; - task$jscomp$0.thenableState = - getThenableStateAfterSuspending(); - var ping$jscomp$0 = task$jscomp$0.ping; - x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); - } else { - var errorInfo$jscomp$0 = getThrownInfo( - task$jscomp$0.componentStack - ); - task$jscomp$0.abortSet.delete(task$jscomp$0); - segment$jscomp$0.status = 4; - var boundary = task$jscomp$0.blockedBoundary; - prevTaskInDEV = logRecoverableError( - request, - x$jscomp$0, - errorInfo$jscomp$0 - ); - null === boundary - ? fatalError(request, x$jscomp$0) - : (boundary.pendingTasks--, - boundary.status !== CLIENT_RENDERED && - ((boundary.status = CLIENT_RENDERED), - encodeErrorForBoundary( - boundary, - prevTaskInDEV, - x$jscomp$0, - errorInfo$jscomp$0, - !1 + } else if ( + ((request$jscomp$0 = prevTaskInDEV = void 0), + (errorDigest = task), + (request$jscomp$1 = segment), + request$jscomp$1.status === PENDING) + ) { + request$jscomp$1.status = 6; + switchContext(errorDigest.context); + request$jscomp$0 = currentTaskInDEV; + currentTaskInDEV = errorDigest; + var childrenLength = request$jscomp$1.children.length, + chunkLength = request$jscomp$1.chunks.length; + try { + retryNode(request, errorDigest), + request$jscomp$1.lastPushedText && + request$jscomp$1.textEmbedded && + request$jscomp$1.chunks.push(textSeparator), + errorDigest.abortSet.delete(errorDigest), + (request$jscomp$1.status = COMPLETED), + finishedTask( + request, + errorDigest.blockedBoundary, + request$jscomp$1 + ); + } catch (thrownValue) { + resetHooksState(); + request$jscomp$1.children.length = childrenLength; + request$jscomp$1.chunks.length = chunkLength; + var x$jscomp$0 = + thrownValue === SuspenseException + ? getSuspendedThenable() + : 12 === request.status + ? request.fatalError + : thrownValue; + if ( + "object" === typeof x$jscomp$0 && + null !== x$jscomp$0 && + "function" === typeof x$jscomp$0.then + ) { + request$jscomp$1.status = PENDING; + errorDigest.thenableState = getThenableStateAfterSuspending(); + var ping$jscomp$0 = errorDigest.ping; + x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); + } else { + var errorInfo$jscomp$1 = getThrownInfo( + errorDigest.componentStack + ); + errorDigest.abortSet.delete(errorDigest); + request$jscomp$1.status = 4; + var boundary$jscomp$0 = errorDigest.blockedBoundary, + debugTask = errorDigest.debugTask; + prevTaskInDEV = logRecoverableError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ); + null === boundary$jscomp$0 + ? fatalError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ) + : (boundary$jscomp$0.pendingTasks--, + boundary$jscomp$0.status !== CLIENT_RENDERED && + ((boundary$jscomp$0.status = CLIENT_RENDERED), + encodeErrorForBoundary( + boundary$jscomp$0, + prevTaskInDEV, + x$jscomp$0, + errorInfo$jscomp$1, + !1 + ), + untrackBoundary(request, boundary$jscomp$0), + boundary$jscomp$0.parentFlushed && + request.clientRenderedBoundaries.push( + boundary$jscomp$0 ), - untrackBoundary(request, boundary), - boundary.parentFlushed && - request.clientRenderedBoundaries.push(boundary), - 0 === request.pendingRootTasks && - null === request.trackedPostpones && - null !== boundary.contentPreamble && - preparePreamble(request))); - request.allPendingTasks--; - 0 === request.allPendingTasks && completeAll(request); - } - } finally { - currentTaskInDEV = request$jscomp$0; + 0 === request.pendingRootTasks && + null === request.trackedPostpones && + null !== boundary$jscomp$0.contentPreamble && + preparePreamble(request))); + request.allPendingTasks--; + 0 === request.allPendingTasks && completeAll(request); } + } finally { + currentTaskInDEV = request$jscomp$0; } } } pingedTasks.splice(0, i); - null !== request$jscomp$1.destination && + null !== request$jscomp$2.destination && flushCompletedQueues( - request$jscomp$1, - request$jscomp$1.destination + request$jscomp$2, + request$jscomp$2.destination ); } catch (error) { - logRecoverableError(request$jscomp$1, error, {}), - fatalError(request$jscomp$1, error); + (pingedTasks = {}), + logRecoverableError(request$jscomp$2, error, pingedTasks, null), + fatalError(request$jscomp$2, error, pingedTasks, null); } finally { (currentResumableState = prevResumableState), (ReactSharedInternals.H = prevDispatcher), @@ -7449,7 +7602,9 @@ try { flushCompletedQueues(request, destination); } catch (error) { - logRecoverableError(request, error, {}), fatalError(request, error); + (destination = {}), + logRecoverableError(request, error, destination, null), + fatalError(request, error, destination, null); } } } @@ -7475,16 +7630,18 @@ null !== request.destination && flushCompletedQueues(request, request.destination); } catch (error$4) { - logRecoverableError(request, error$4, {}), fatalError(request, error$4); + (reason = {}), + logRecoverableError(request, error$4, reason, null), + fatalError(request, error$4, reason, null); } } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-canary-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-canary-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } function createDrainHandler(destination, request) { @@ -9133,5 +9290,5 @@ } }; }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js index f2b7d871182e72..98f0eff1039d02 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js @@ -6212,11 +6212,11 @@ function abort(request, reason) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-32b0cad8-20250213" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-canary-cbbe8666-20250213\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-canary-32b0cad8-20250213\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6365,4 +6365,4 @@ exports.renderToPipeableStream = function (children, options) { } }; }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js index 12e51c977fdfdb..6597babda4a0fe 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js @@ -416,7 +416,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js index 42588415b8e263..f059d78939453f 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js @@ -207,4 +207,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js index c928527a48ed3a..ade3ee30372336 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js @@ -336,5 +336,5 @@ })) : Internals.d.m(href)); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js index 60f4db1f1f2b21..9702d43efbfc2c 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js @@ -149,4 +149,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-dom/package.json b/packages/next/src/compiled/react-dom/package.json index bd44ddc4869358..efbfe27bb77049 100644 --- a/packages/next/src/compiled/react-dom/package.json +++ b/packages/next/src/compiled/react-dom/package.json @@ -67,10 +67,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.26.0-canary-cbbe8666-20250213" + "scheduler": "0.26.0-canary-32b0cad8-20250213" }, "peerDependencies": { - "react": "19.1.0-canary-cbbe8666-20250213" + "react": "19.1.0-canary-32b0cad8-20250213" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-experimental/cjs/react.development.js b/packages/next/src/compiled/react-experimental/cjs/react.development.js index c836c6dd39a168..6b41fcf34c5585 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.development.js @@ -1274,7 +1274,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-experimental/cjs/react.production.js b/packages/next/src/compiled/react-experimental/cjs/react.production.js index 6839f91b3746d4..97f9f53317d238 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.production.js @@ -370,17 +370,11 @@ exports.__COMPILER_RUNTIME = { return ReactSharedInternals.H.useMemoCache(size); } }; -exports.act = function () { - throw Error("act(...) is not supported in production builds of React."); -}; exports.cache = function (fn) { return function () { return fn.apply(null, arguments); }; }; -exports.captureOwnerStack = function () { - return null; -}; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error( @@ -579,4 +573,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js index bd3d71e08ba252..58885810b1c910 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js @@ -981,5 +981,5 @@ exports.useMemo = function (create, deps) { return resolveDispatcher().useMemo(create, deps); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js index 6cc046457e5f00..4ac7538e954845 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js @@ -404,9 +404,6 @@ exports.cache = function (fn) { } }; }; -exports.captureOwnerStack = function () { - return null; -}; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error(formatProdErrorMessage(267, element)); @@ -564,4 +561,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react-is/package.json b/packages/next/src/compiled/react-is/package.json index 6ef0c148eefa22..542a9856a19e7d 100644 --- a/packages/next/src/compiled/react-is/package.json +++ b/packages/next/src/compiled/react-is/package.json @@ -1,6 +1,6 @@ { "name": "react-is", - "version": "19.1.0-canary-cbbe8666-20250213", + "version": "19.1.0-canary-32b0cad8-20250213", "description": "Brand checking of React Elements.", "main": "index.js", "sideEffects": false, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js index ad152b81541032..f85655ae28d4c7 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js @@ -2896,10 +2896,10 @@ return hook.checkDCE ? !0 : !1; })({ bundleType: 1, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-32b0cad8-20250213", rendererPackageName: "react-server-dom-turbopack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213", + reconcilerVersion: "19.1.0-experimental-32b0cad8-20250213", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json index e4d69bed76c620..ff2d0593d84e74 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json @@ -48,7 +48,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "0.0.0-experimental-cbbe8666-20250213", - "react-dom": "0.0.0-experimental-cbbe8666-20250213" + "react": "0.0.0-experimental-32b0cad8-20250213", + "react-dom": "0.0.0-experimental-32b0cad8-20250213" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js index e6545b7d7e7afd..cc31a61bcb4520 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js @@ -1065,6 +1065,22 @@ function nullRefGetter() { return null; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ("function" === typeof type) return '"use client"'; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return type._init === readChunk ? '"use client"' : "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function createLazyChunkWrapper(chunk) { var lazyType = { $$typeof: REACT_LAZY_TYPE, @@ -1138,17 +1154,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), - (chunk._debugInfo || (chunk._debugInfo = [])).push(blockedValue)), - triggerErrorOnChunk(chunk, error)); + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); + (chunk._debugInfo || (chunk._debugInfo = [])).push( + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } if (initializingHandler) { @@ -1233,19 +1257,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); (chunk._debugInfo || (chunk._debugInfo = [])).push( - blockedValue - )), - triggerErrorOnChunk(chunk, error)); + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } ); @@ -1515,10 +1545,14 @@ : ReactSharedInteralsServer.A.getOwner(); this._debugRootStack = null !== bundlerConfig ? Error("react-stack-top-frame") : null; + environmentName = void 0 === environmentName ? "Server" : environmentName; + supportsCreateTask && + (this._debugRootTask = console.createTask( + '"use ' + environmentName.toLowerCase() + '"' + )); this._debugFindSourceMapURL = findSourceMapURL; this._replayConsole = replayConsole; - this._rootEnvironmentName = - void 0 === environmentName ? "Server" : environmentName; + this._rootEnvironmentName = environmentName; this._fromJSON = createFromJSONCallback(this); } function resolveModel(response, id, model) { @@ -1928,6 +1962,47 @@ : rootTask : null; } + function initializeFakeTask(response, debugInfo, childEnvironmentName) { + if (!supportsCreateTask || null == debugInfo.stack) return null; + var stack = debugInfo.stack, + env = + null == debugInfo.env ? response._rootEnvironmentName : debugInfo.env; + if (env !== childEnvironmentName) + return ( + (debugInfo = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env)), + buildFakeTask( + response, + debugInfo, + stack, + '"use ' + childEnvironmentName.toLowerCase() + '"', + env + ) + ); + childEnvironmentName = debugInfo.debugTask; + if (void 0 !== childEnvironmentName) return childEnvironmentName; + childEnvironmentName = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env); + return (debugInfo.debugTask = buildFakeTask( + response, + childEnvironmentName, + stack, + "<" + (debugInfo.name || "...") + ">", + env + )); + } + function buildFakeTask(response, ownerTask, stack, taskName, env) { + taskName = console.createTask.bind(console, taskName); + stack = buildFakeCallStack(response, stack, env, taskName); + return null === ownerTask + ? ((response = getRootTask(response, env)), + null != response ? response.run(stack) : stack()) + : ownerTask.run(stack); + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -1943,6 +2018,12 @@ initializeFakeStack(response, debugInfo.owner)); } function resolveDebugInfo(response, id, debugInfo) { + var env = + void 0 === debugInfo.env + ? response._rootEnvironmentName + : debugInfo.env; + void 0 !== debugInfo.stack && + initializeFakeTask(response, debugInfo, env); null === debugInfo.owner && null != response._debugRootOwner ? ((debugInfo.owner = response._debugRootOwner), (debugInfo.debugStack = response._debugRootStack)) @@ -1952,7 +2033,59 @@ (response._debugInfo || (response._debugInfo = [])).push(debugInfo); } function getCurrentStackInDEV() { - return ""; + var owner = currentOwnerInDEV; + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function resolveConsoleEntry(response, value) { if (response._replayConsole) { @@ -2123,58 +2256,100 @@ if ("string" === typeof value) return parseModelString(response, this, key, value); if ("object" === typeof value && null !== value) { - if (value[0] === REACT_ELEMENT_TYPE) - if ( - ((key = value[4]), - (value = { - $$typeof: REACT_ELEMENT_TYPE, - type: value[1], - key: value[2], - props: value[3], - _owner: null === key ? response._debugRootOwner : key - }), - Object.defineProperty(value, "ref", { - enumerable: !1, - get: nullRefGetter - }), - (value._store = {}), - Object.defineProperty(value._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 1 - }), - Object.defineProperty(value, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }), - null !== initializingHandler) - ) { - var handler = initializingHandler; - initializingHandler = handler.parent; - handler.errored - ? ((key = new ReactPromise( - "rejected", - null, - handler.value, - response - )), - (value = { - name: getComponentNameFromType(value.type) || "", - owner: value._owner - }), - (key._debugInfo = [value]), - (value = createLazyChunkWrapper(key))) - : 0 < handler.deps && - ((key = new ReactPromise("blocked", null, null, response)), - (handler.value = value), - (handler.chunk = key), - (value = Object.freeze.bind(Object, value.props)), - key.then(value, value), - (value = createLazyChunkWrapper(key))); - } else Object.freeze(value.props); + if (value[0] === REACT_ELEMENT_TYPE) { + var type = value[1]; + key = value[4]; + var stack = value[5], + validated = value[6]; + value = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: value[2], + props: value[3], + _owner: null === key ? response._debugRootOwner : key + }; + Object.defineProperty(value, "ref", { + enumerable: !1, + get: nullRefGetter + }); + value._store = {}; + Object.defineProperty(value._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: validated + }); + Object.defineProperty(value, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + validated = response._rootEnvironmentName; + null !== key && null != key.env && (validated = key.env); + var normalizedStackTrace = null; + null === key && null != response._debugRootStack + ? (normalizedStackTrace = response._debugRootStack) + : null !== stack && + (normalizedStackTrace = createFakeJSXCallStackInDEV( + response, + stack, + validated + )); + Object.defineProperty(value, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + normalizedStackTrace = null; + supportsCreateTask && + null !== stack && + ((type = console.createTask.bind(console, getTaskName(type))), + (stack = buildFakeCallStack(response, stack, validated, type)), + (type = + null === key + ? null + : initializeFakeTask(response, key, validated)), + null === type + ? ((type = response._debugRootTask), + (normalizedStackTrace = + null != type ? type.run(stack) : stack())) + : (normalizedStackTrace = type.run(stack))); + Object.defineProperty(value, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + null !== key && initializeFakeStack(response, key); + null !== initializingHandler + ? ((stack = initializingHandler), + (initializingHandler = stack.parent), + stack.errored + ? ((key = new ReactPromise( + "rejected", + null, + stack.value, + response + )), + (stack = { + name: getComponentNameFromType(value.type) || "", + owner: value._owner + }), + (stack.debugStack = value._debugStack), + supportsCreateTask && (stack.debugTask = value._debugTask), + (key._debugInfo = [stack]), + (value = createLazyChunkWrapper(key))) + : 0 < stack.deps && + ((key = new ReactPromise("blocked", null, null, response)), + (stack.value = value), + (stack.chunk = key), + (value = Object.freeze.bind(Object, value.props)), + key.then(value, value), + (value = createLazyChunkWrapper(key)))) + : Object.freeze(value.props); + } return value; } return value; @@ -2326,7 +2501,9 @@ v8FrameRegExp = /^ {3} at (?:(.+) \((.+):(\d+):(\d+)\)|(?:async )?(.+):(\d+):(\d+))$/, jscSpiderMonkeyFrameRegExp = /(?:(.*)@)?(.*):(\d+):(\d+)/, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + prefix, + suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var ReactSharedInteralsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, @@ -2360,6 +2537,7 @@ } }; var initializingHandler = null, + supportsCreateTask = !!console.createTask, fakeFunctionCache = new Map(), fakeFunctionIdx = 0, createFakeJSXCallStack = { @@ -2438,7 +2616,14 @@ env, JSCompiler_inline_result ); - null != owner && initializeFakeStack(response, owner); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } var rootTask = getRootTask(response, env); null != rootTask ? rootTask.run(callStack) : callStack(); } finally { @@ -2462,10 +2647,10 @@ return hook.checkDCE ? !0 : !1; })({ bundleType: 1, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-32b0cad8-20250213", rendererPackageName: "react-server-dom-turbopack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213", + reconcilerVersion: "19.1.0-canary-32b0cad8-20250213", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js index 76f7b8c740a6a8..9668dd47994d90 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js @@ -1117,6 +1117,12 @@ } return null; } + function prepareStackTrace(error, structuredStackTrace) { + error = (error.name || "Error") + ": " + (error.message || ""); + for (var i = 0; i < structuredStackTrace.length; i++) + error += "\n at " + structuredStackTrace[i].toString(); + return error; + } function ReactPromise(status, value, reason, response) { this.status = status; this.value = value; @@ -1273,6 +1279,22 @@ function nullRefGetter() { return null; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ("function" === typeof type) return '"use client"'; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return type._init === readChunk ? '"use client"' : "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function createLazyChunkWrapper(chunk) { var lazyType = { $$typeof: REACT_LAZY_TYPE, @@ -1346,17 +1368,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), - (chunk._debugInfo || (chunk._debugInfo = [])).push(blockedValue)), - triggerErrorOnChunk(chunk, error)); + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); + (chunk._debugInfo || (chunk._debugInfo = [])).push( + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } if (initializingHandler) { @@ -1441,19 +1471,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); (chunk._debugInfo || (chunk._debugInfo = [])).push( - blockedValue - )), - triggerErrorOnChunk(chunk, error)); + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } ); @@ -1723,10 +1759,14 @@ : ReactSharedInteralsServer.A.getOwner(); this._debugRootStack = null !== bundlerConfig ? Error("react-stack-top-frame") : null; + environmentName = void 0 === environmentName ? "Server" : environmentName; + supportsCreateTask && + (this._debugRootTask = console.createTask( + '"use ' + environmentName.toLowerCase() + '"' + )); this._debugFindSourceMapURL = findSourceMapURL; this._replayConsole = replayConsole; - this._rootEnvironmentName = - void 0 === environmentName ? "Server" : environmentName; + this._rootEnvironmentName = environmentName; this._fromJSON = createFromJSONCallback(this); } function resolveModel(response, id, model) { @@ -2141,6 +2181,47 @@ : rootTask : null; } + function initializeFakeTask(response, debugInfo, childEnvironmentName) { + if (!supportsCreateTask || null == debugInfo.stack) return null; + var stack = debugInfo.stack, + env = + null == debugInfo.env ? response._rootEnvironmentName : debugInfo.env; + if (env !== childEnvironmentName) + return ( + (debugInfo = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env)), + buildFakeTask( + response, + debugInfo, + stack, + '"use ' + childEnvironmentName.toLowerCase() + '"', + env + ) + ); + childEnvironmentName = debugInfo.debugTask; + if (void 0 !== childEnvironmentName) return childEnvironmentName; + childEnvironmentName = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env); + return (debugInfo.debugTask = buildFakeTask( + response, + childEnvironmentName, + stack, + "<" + (debugInfo.name || "...") + ">", + env + )); + } + function buildFakeTask(response, ownerTask, stack, taskName, env) { + taskName = console.createTask.bind(console, taskName); + stack = buildFakeCallStack(response, stack, env, taskName); + return null === ownerTask + ? ((response = getRootTask(response, env)), + null != response ? response.run(stack) : stack()) + : ownerTask.run(stack); + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -2156,6 +2237,12 @@ initializeFakeStack(response, debugInfo.owner)); } function resolveDebugInfo(response, id, debugInfo) { + var env = + void 0 === debugInfo.env + ? response._rootEnvironmentName + : debugInfo.env; + void 0 !== debugInfo.stack && + initializeFakeTask(response, debugInfo, env); null === debugInfo.owner && null != response._debugRootOwner ? ((debugInfo.owner = response._debugRootOwner), (debugInfo.debugStack = response._debugRootStack)) @@ -2165,7 +2252,59 @@ (response._debugInfo || (response._debugInfo = [])).push(debugInfo); } function getCurrentStackInDEV() { - return ""; + var owner = currentOwnerInDEV; + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function resolveConsoleEntry(response, value) { if (response._replayConsole) { @@ -2336,58 +2475,100 @@ if ("string" === typeof value) return parseModelString(response, this, key, value); if ("object" === typeof value && null !== value) { - if (value[0] === REACT_ELEMENT_TYPE) - if ( - ((key = value[4]), - (value = { - $$typeof: REACT_ELEMENT_TYPE, - type: value[1], - key: value[2], - props: value[3], - _owner: null === key ? response._debugRootOwner : key - }), - Object.defineProperty(value, "ref", { - enumerable: !1, - get: nullRefGetter - }), - (value._store = {}), - Object.defineProperty(value._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 1 - }), - Object.defineProperty(value, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }), - null !== initializingHandler) - ) { - var handler = initializingHandler; - initializingHandler = handler.parent; - handler.errored - ? ((key = new ReactPromise( - "rejected", - null, - handler.value, - response - )), - (value = { - name: getComponentNameFromType(value.type) || "", - owner: value._owner - }), - (key._debugInfo = [value]), - (value = createLazyChunkWrapper(key))) - : 0 < handler.deps && - ((key = new ReactPromise("blocked", null, null, response)), - (handler.value = value), - (handler.chunk = key), - (value = Object.freeze.bind(Object, value.props)), - key.then(value, value), - (value = createLazyChunkWrapper(key))); - } else Object.freeze(value.props); + if (value[0] === REACT_ELEMENT_TYPE) { + var type = value[1]; + key = value[4]; + var stack = value[5], + validated = value[6]; + value = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: value[2], + props: value[3], + _owner: null === key ? response._debugRootOwner : key + }; + Object.defineProperty(value, "ref", { + enumerable: !1, + get: nullRefGetter + }); + value._store = {}; + Object.defineProperty(value._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: validated + }); + Object.defineProperty(value, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + validated = response._rootEnvironmentName; + null !== key && null != key.env && (validated = key.env); + var normalizedStackTrace = null; + null === key && null != response._debugRootStack + ? (normalizedStackTrace = response._debugRootStack) + : null !== stack && + (normalizedStackTrace = createFakeJSXCallStackInDEV( + response, + stack, + validated + )); + Object.defineProperty(value, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + normalizedStackTrace = null; + supportsCreateTask && + null !== stack && + ((type = console.createTask.bind(console, getTaskName(type))), + (stack = buildFakeCallStack(response, stack, validated, type)), + (type = + null === key + ? null + : initializeFakeTask(response, key, validated)), + null === type + ? ((type = response._debugRootTask), + (normalizedStackTrace = + null != type ? type.run(stack) : stack())) + : (normalizedStackTrace = type.run(stack))); + Object.defineProperty(value, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + null !== key && initializeFakeStack(response, key); + null !== initializingHandler + ? ((stack = initializingHandler), + (initializingHandler = stack.parent), + stack.errored + ? ((key = new ReactPromise( + "rejected", + null, + stack.value, + response + )), + (stack = { + name: getComponentNameFromType(value.type) || "", + owner: value._owner + }), + (stack.debugStack = value._debugStack), + supportsCreateTask && (stack.debugTask = value._debugTask), + (key._debugInfo = [stack]), + (value = createLazyChunkWrapper(key))) + : 0 < stack.deps && + ((key = new ReactPromise("blocked", null, null, response)), + (stack.value = value), + (stack.chunk = key), + (value = Object.freeze.bind(Object, value.props)), + key.then(value, value), + (value = createLazyChunkWrapper(key)))) + : Object.freeze(value.props); + } return value; } return value; @@ -2547,7 +2728,9 @@ v8FrameRegExp = /^ {3} at (?:(.+) \((.+):(\d+):(\d+)\)|(?:async )?(.+):(\d+):(\d+))$/, jscSpiderMonkeyFrameRegExp = /(?:(.*)@)?(.*):(\d+):(\d+)/, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + prefix, + suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var ReactSharedInteralsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, @@ -2581,6 +2764,7 @@ } }; var initializingHandler = null, + supportsCreateTask = !!console.createTask, fakeFunctionCache = new Map(), fakeFunctionIdx = 0, createFakeJSXCallStack = { @@ -2600,6 +2784,7 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), + currentOwnerInDEV = null, replayConsoleWithCallStack = { "react-stack-bottom-frame": function ( response, @@ -2611,6 +2796,7 @@ ) { var prevStack = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = null === owner ? response._debugRootOwner : owner; try { a: { var offset = 0; @@ -2657,11 +2843,19 @@ env, JSCompiler_inline_result ); - null != owner && initializeFakeStack(response, owner); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } var rootTask = getRootTask(response, env); null != rootTask ? rootTask.run(callStack) : callStack(); } finally { - ReactSharedInternals.getCurrentStack = prevStack; + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); } } }, diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js index 23de4540b346d6..c4319fce5dcd32 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js @@ -1117,6 +1117,12 @@ } return null; } + function prepareStackTrace(error, structuredStackTrace) { + error = (error.name || "Error") + ": " + (error.message || ""); + for (var i = 0; i < structuredStackTrace.length; i++) + error += "\n at " + structuredStackTrace[i].toString(); + return error; + } function ReactPromise(status, value, reason, response) { this.status = status; this.value = value; @@ -1273,6 +1279,22 @@ function nullRefGetter() { return null; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ("function" === typeof type) return '"use client"'; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return type._init === readChunk ? '"use client"' : "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function createLazyChunkWrapper(chunk) { var lazyType = { $$typeof: REACT_LAZY_TYPE, @@ -1346,17 +1368,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), - (chunk._debugInfo || (chunk._debugInfo = [])).push(blockedValue)), - triggerErrorOnChunk(chunk, error)); + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); + (chunk._debugInfo || (chunk._debugInfo = [])).push( + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } if (initializingHandler) { @@ -1441,19 +1471,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); (chunk._debugInfo || (chunk._debugInfo = [])).push( - blockedValue - )), - triggerErrorOnChunk(chunk, error)); + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } ); @@ -1723,10 +1759,14 @@ : ReactSharedInteralsServer.A.getOwner(); this._debugRootStack = null !== bundlerConfig ? Error("react-stack-top-frame") : null; + environmentName = void 0 === environmentName ? "Server" : environmentName; + supportsCreateTask && + (this._debugRootTask = console.createTask( + '"use ' + environmentName.toLowerCase() + '"' + )); this._debugFindSourceMapURL = findSourceMapURL; this._replayConsole = replayConsole; - this._rootEnvironmentName = - void 0 === environmentName ? "Server" : environmentName; + this._rootEnvironmentName = environmentName; this._fromJSON = createFromJSONCallback(this); } function resolveModel(response, id, model) { @@ -2141,6 +2181,47 @@ : rootTask : null; } + function initializeFakeTask(response, debugInfo, childEnvironmentName) { + if (!supportsCreateTask || null == debugInfo.stack) return null; + var stack = debugInfo.stack, + env = + null == debugInfo.env ? response._rootEnvironmentName : debugInfo.env; + if (env !== childEnvironmentName) + return ( + (debugInfo = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env)), + buildFakeTask( + response, + debugInfo, + stack, + '"use ' + childEnvironmentName.toLowerCase() + '"', + env + ) + ); + childEnvironmentName = debugInfo.debugTask; + if (void 0 !== childEnvironmentName) return childEnvironmentName; + childEnvironmentName = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env); + return (debugInfo.debugTask = buildFakeTask( + response, + childEnvironmentName, + stack, + "<" + (debugInfo.name || "...") + ">", + env + )); + } + function buildFakeTask(response, ownerTask, stack, taskName, env) { + taskName = console.createTask.bind(console, taskName); + stack = buildFakeCallStack(response, stack, env, taskName); + return null === ownerTask + ? ((response = getRootTask(response, env)), + null != response ? response.run(stack) : stack()) + : ownerTask.run(stack); + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -2156,6 +2237,12 @@ initializeFakeStack(response, debugInfo.owner)); } function resolveDebugInfo(response, id, debugInfo) { + var env = + void 0 === debugInfo.env + ? response._rootEnvironmentName + : debugInfo.env; + void 0 !== debugInfo.stack && + initializeFakeTask(response, debugInfo, env); null === debugInfo.owner && null != response._debugRootOwner ? ((debugInfo.owner = response._debugRootOwner), (debugInfo.debugStack = response._debugRootStack)) @@ -2165,7 +2252,59 @@ (response._debugInfo || (response._debugInfo = [])).push(debugInfo); } function getCurrentStackInDEV() { - return ""; + var owner = currentOwnerInDEV; + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function resolveConsoleEntry(response, value) { if (response._replayConsole) { @@ -2336,58 +2475,100 @@ if ("string" === typeof value) return parseModelString(response, this, key, value); if ("object" === typeof value && null !== value) { - if (value[0] === REACT_ELEMENT_TYPE) - if ( - ((key = value[4]), - (value = { - $$typeof: REACT_ELEMENT_TYPE, - type: value[1], - key: value[2], - props: value[3], - _owner: null === key ? response._debugRootOwner : key - }), - Object.defineProperty(value, "ref", { - enumerable: !1, - get: nullRefGetter - }), - (value._store = {}), - Object.defineProperty(value._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 1 - }), - Object.defineProperty(value, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }), - null !== initializingHandler) - ) { - var handler = initializingHandler; - initializingHandler = handler.parent; - handler.errored - ? ((key = new ReactPromise( - "rejected", - null, - handler.value, - response - )), - (value = { - name: getComponentNameFromType(value.type) || "", - owner: value._owner - }), - (key._debugInfo = [value]), - (value = createLazyChunkWrapper(key))) - : 0 < handler.deps && - ((key = new ReactPromise("blocked", null, null, response)), - (handler.value = value), - (handler.chunk = key), - (value = Object.freeze.bind(Object, value.props)), - key.then(value, value), - (value = createLazyChunkWrapper(key))); - } else Object.freeze(value.props); + if (value[0] === REACT_ELEMENT_TYPE) { + var type = value[1]; + key = value[4]; + var stack = value[5], + validated = value[6]; + value = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: value[2], + props: value[3], + _owner: null === key ? response._debugRootOwner : key + }; + Object.defineProperty(value, "ref", { + enumerable: !1, + get: nullRefGetter + }); + value._store = {}; + Object.defineProperty(value._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: validated + }); + Object.defineProperty(value, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + validated = response._rootEnvironmentName; + null !== key && null != key.env && (validated = key.env); + var normalizedStackTrace = null; + null === key && null != response._debugRootStack + ? (normalizedStackTrace = response._debugRootStack) + : null !== stack && + (normalizedStackTrace = createFakeJSXCallStackInDEV( + response, + stack, + validated + )); + Object.defineProperty(value, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + normalizedStackTrace = null; + supportsCreateTask && + null !== stack && + ((type = console.createTask.bind(console, getTaskName(type))), + (stack = buildFakeCallStack(response, stack, validated, type)), + (type = + null === key + ? null + : initializeFakeTask(response, key, validated)), + null === type + ? ((type = response._debugRootTask), + (normalizedStackTrace = + null != type ? type.run(stack) : stack())) + : (normalizedStackTrace = type.run(stack))); + Object.defineProperty(value, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + null !== key && initializeFakeStack(response, key); + null !== initializingHandler + ? ((stack = initializingHandler), + (initializingHandler = stack.parent), + stack.errored + ? ((key = new ReactPromise( + "rejected", + null, + stack.value, + response + )), + (stack = { + name: getComponentNameFromType(value.type) || "", + owner: value._owner + }), + (stack.debugStack = value._debugStack), + supportsCreateTask && (stack.debugTask = value._debugTask), + (key._debugInfo = [stack]), + (value = createLazyChunkWrapper(key))) + : 0 < stack.deps && + ((key = new ReactPromise("blocked", null, null, response)), + (stack.value = value), + (stack.chunk = key), + (value = Object.freeze.bind(Object, value.props)), + key.then(value, value), + (value = createLazyChunkWrapper(key)))) + : Object.freeze(value.props); + } return value; } return value; @@ -2435,7 +2616,9 @@ v8FrameRegExp = /^ {3} at (?:(.+) \((.+):(\d+):(\d+)\)|(?:async )?(.+):(\d+):(\d+))$/, jscSpiderMonkeyFrameRegExp = /(?:(.*)@)?(.*):(\d+):(\d+)/, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + prefix, + suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var ReactSharedInteralsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, @@ -2469,6 +2652,7 @@ } }; var initializingHandler = null, + supportsCreateTask = !!console.createTask, fakeFunctionCache = new Map(), fakeFunctionIdx = 0, createFakeJSXCallStack = { @@ -2488,6 +2672,7 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), + currentOwnerInDEV = null, replayConsoleWithCallStack = { "react-stack-bottom-frame": function ( response, @@ -2499,6 +2684,7 @@ ) { var prevStack = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = null === owner ? response._debugRootOwner : owner; try { a: { var offset = 0; @@ -2545,11 +2731,19 @@ env, JSCompiler_inline_result ); - null != owner && initializeFakeStack(response, owner); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } var rootTask = getRootTask(response, env); null != rootTask ? rootTask.run(callStack) : callStack(); } finally { - ReactSharedInternals.getCurrentStack = prevStack; + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); } } }, diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js index 1e3b5ba97466d4..c5f29dbb7394ea 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js @@ -559,7 +559,59 @@ } } function getCurrentStackInDEV() { - return ""; + var owner = resolveOwner(); + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function defaultErrorHandler(error) { console.error(error); @@ -633,7 +685,7 @@ ? defaultFilterStackFrame : filterStackFrame; this.didWarnForKey = null; - type = createTask(this, model, null, !1, abortSet, null); + type = createTask(this, model, null, !1, abortSet, null, null, null); pingedTasks.push(type); } function noop() {} @@ -644,7 +696,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); (task = thenable._debugInfo) && forwardDebugInfo(request, newTask.id, task); @@ -742,7 +796,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -812,7 +868,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -865,14 +923,21 @@ return lazyType; } function callWithDebugContextInDEV(request, task, callback, arg) { - currentOwner = { + var componentDebugInfo = { name: "", env: task.environmentName, key: null, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); + componentDebugInfo.debugStack = task.debugStack; + request = componentDebugInfo.debugTask = task.debugTask; + currentOwner = componentDebugInfo; try { - return callback(arg); + return request ? request.run(callback.bind(null, arg)) : callback(arg); } finally { currentOwner = null; } @@ -942,7 +1007,14 @@ (multiShot._debugInfo = result._debugInfo), multiShot); } - function renderFunctionComponent(request, task, key, Component, props) { + function renderFunctionComponent( + request, + task, + key, + Component, + props, + validated + ) { var prevThenableState = task.thenableState; task.thenableState = null; if (null === debugID) return outlineTask(request, task); @@ -959,15 +1031,27 @@ key: key, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); componentDebugInfo.props = props; + componentDebugInfo.debugStack = task.debugStack; + componentDebugInfo.debugTask = task.debugTask; outlineComponentInfo(request, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo); task.environmentName = componentEnv; + 2 === validated && + warnForMissingKey(request, key, componentDebugInfo, task.debugTask); } thenableIndexCounter = 0; thenableState = prevThenableState; currentComponentDebugInfo = componentDebugInfo; - props = callComponentInDEV(Component, props, componentDebugInfo); + props = task.debugTask + ? task.debugTask.run( + callComponentInDEV.bind(null, Component, props, componentDebugInfo) + ) + : callComponentInDEV(Component, props, componentDebugInfo); if (request.status === ABORTING) throw ( ("object" !== typeof props || @@ -984,15 +1068,36 @@ props ); Component = task.keyPath; - prevThenableState = task.implicitSlot; + validated = task.implicitSlot; null !== key ? (task.keyPath = null === Component ? key : Component + "," + key) : null === Component && (task.implicitSlot = !0); request = renderModelDestructive(request, task, emptyRoot, "", props); task.keyPath = Component; - task.implicitSlot = prevThenableState; + task.implicitSlot = validated; return request; } + function warnForMissingKey(request, key, componentDebugInfo, debugTask) { + function logKeyError() { + console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + "", + "" + ); + } + key = request.didWarnForKey; + null == key && (key = request.didWarnForKey = new WeakSet()); + request = componentDebugInfo.owner; + if (null != request) { + if (key.has(request)) return; + key.add(request); + } + debugTask + ? debugTask.run( + callComponentInDEV.bind(null, logKeyError, null, componentDebugInfo) + ) + : callComponentInDEV(logKeyError, null, componentDebugInfo); + } function renderFragment(request, task, children) { for (var i = 0; i < children.length; i++) { var child = children[i]; @@ -1010,7 +1115,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1029,7 +1136,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1043,14 +1152,16 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); retryTask(request, task); return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } - function renderElement(request, task, type, key, ref, props) { + function renderElement(request, task, type, key, ref, props, validated) { if (null !== ref && void 0 !== ref) throw Error( "Refs cannot be used in Server Components, nor passed to Client Components." @@ -1066,7 +1177,22 @@ ) { if (type === REACT_FRAGMENT_TYPE && null === key) return ( - (type = task.implicitSlot), + 2 === validated && + ((validated = { + name: "Fragment", + env: (0, request.environmentName)(), + key: key, + owner: task.debugOwner, + stack: + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + props: props, + debugStack: task.debugStack, + debugTask: task.debugTask + }), + warnForMissingKey(request, key, validated, task.debugTask)), + (validated = task.implicitSlot), null === task.keyPath && (task.implicitSlot = !0), (request = renderModelDestructive( request, @@ -1075,7 +1201,7 @@ "", props.children )), - (task.implicitSlot = type), + (task.implicitSlot = validated), request ); if ( @@ -1087,26 +1213,61 @@ case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); if (request.status === ABORTING) throw null; - return renderElement(request, task, type, key, ref, props); + return renderElement( + request, + task, + type, + key, + ref, + props, + validated + ); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( request, task, key, type.render, - props + props, + validated ); case REACT_MEMO_TYPE: - return renderElement(request, task, type.type, key, ref, props); + return renderElement( + request, + task, + type.type, + key, + ref, + props, + validated + ); case REACT_ELEMENT_TYPE: type._store.validated = 1; } - } else return renderFunctionComponent(request, task, key, type, props); + } else + return renderFunctionComponent( + request, + task, + key, + type, + props, + validated + ); ref = task.keyPath; null === key ? (key = ref) : null !== ref && (key = ref + "," + key); null !== task.debugOwner && outlineComponentInfo(request, task.debugOwner); - request = [REACT_ELEMENT_TYPE, type, key, props, task.debugOwner]; + request = [ + REACT_ELEMENT_TYPE, + type, + key, + props, + task.debugOwner, + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + validated + ]; task = task.implicitSlot && null !== key ? [request] : request; return task; } @@ -1129,7 +1290,9 @@ keyPath, implicitSlot, abortSet, - debugOwner + debugOwner, + debugStack, + debugTask ) { request.pendingChunks++; var id = request.nextChunkId++; @@ -1177,6 +1340,8 @@ }; task.environmentName = request.environmentName(); task.debugOwner = debugOwner; + task.debugStack = debugStack; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -1269,6 +1434,8 @@ null, !1, request.abortableTasks, + null, + null, null ); retryTask(request, value); @@ -1362,6 +1529,8 @@ null, !1, request.abortableTasks, + null, + null, null ), reader = blob.stream().getReader(), @@ -1404,7 +1573,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask )), (value = request.ping), key.then(value, value), @@ -1461,13 +1632,16 @@ _existingReference = value.props; var refProp = _existingReference.ref; task.debugOwner = value._owner; + task.debugStack = value._debugStack; + task.debugTask = value._debugTask; request = renderElement( request, task, value.type, value.key, void 0 !== refProp ? refProp : null, - _existingReference + _existingReference, + value._store.validated ); "object" === typeof request && null !== request && @@ -1846,6 +2020,7 @@ key: componentInfo.key, owner: componentInfo.owner }; + componentDebugInfo.stack = componentInfo.stack; componentDebugInfo.props = componentInfo.props; objectLimit = outlineConsoleValue( request, @@ -1911,25 +2086,34 @@ counter.objectLimit--; switch (value.$$typeof) { case REACT_ELEMENT_TYPE: - return ( - null != value._owner && - outlineComponentInfo(request, value._owner), - "object" === typeof value.type && - null !== value.type && - doNotLimit.add(value.type), - "object" === typeof value.key && - null !== value.key && - doNotLimit.add(value.key), - doNotLimit.add(value.props), - null !== value._owner && doNotLimit.add(value._owner), - [ - REACT_ELEMENT_TYPE, - value.type, - value.key, - value.props, - value._owner - ] - ); + null != value._owner && outlineComponentInfo(request, value._owner); + "object" === typeof value.type && + null !== value.type && + doNotLimit.add(value.type); + "object" === typeof value.key && + null !== value.key && + doNotLimit.add(value.key); + doNotLimit.add(value.props); + null !== value._owner && doNotLimit.add(value._owner); + counter = null; + if (null != value._debugStack) + for ( + counter = filterStackTrace(request, value._debugStack, 1), + doNotLimit.add(counter), + request = 0; + request < counter.length; + request++ + ) + doNotLimit.add(counter[request]); + return [ + REACT_ELEMENT_TYPE, + value.type, + value.key, + value.props, + value._owner, + counter, + value._store.validated + ]; } if ("function" === typeof value.then) { switch (value.status) { @@ -3524,6 +3708,7 @@ throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); + var prefix, suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var callComponent = { "react-stack-bottom-frame": function ( diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js index 5d06b712b347ac..7e381748eb587d 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js @@ -566,7 +566,59 @@ } } function getCurrentStackInDEV() { - return ""; + var owner = resolveOwner(); + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function defaultErrorHandler(error) { console.error(error); @@ -640,7 +692,7 @@ ? defaultFilterStackFrame : filterStackFrame; this.didWarnForKey = null; - type = createTask(this, model, null, !1, abortSet, null); + type = createTask(this, model, null, !1, abortSet, null, null, null); pingedTasks.push(type); } function noop() {} @@ -659,7 +711,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); (task = thenable._debugInfo) && forwardDebugInfo(request, newTask.id, task); @@ -757,7 +811,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -827,7 +883,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -880,14 +938,21 @@ return lazyType; } function callWithDebugContextInDEV(request, task, callback, arg) { - currentOwner = { + var componentDebugInfo = { name: "", env: task.environmentName, key: null, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); + componentDebugInfo.debugStack = task.debugStack; + request = componentDebugInfo.debugTask = task.debugTask; + currentOwner = componentDebugInfo; try { - return callback(arg); + return request ? request.run(callback.bind(null, arg)) : callback(arg); } finally { currentOwner = null; } @@ -957,7 +1022,14 @@ (multiShot._debugInfo = result._debugInfo), multiShot); } - function renderFunctionComponent(request, task, key, Component, props) { + function renderFunctionComponent( + request, + task, + key, + Component, + props, + validated + ) { var prevThenableState = task.thenableState; task.thenableState = null; if (null === debugID) return outlineTask(request, task); @@ -974,23 +1046,51 @@ key: key, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); componentDebugInfo.props = props; + componentDebugInfo.debugStack = task.debugStack; + componentDebugInfo.debugTask = task.debugTask; outlineComponentInfo(request, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo); task.environmentName = componentEnv; + 2 === validated && + warnForMissingKey(request, key, componentDebugInfo, task.debugTask); } thenableIndexCounter = 0; thenableState = prevThenableState; currentComponentDebugInfo = componentDebugInfo; props = supportsComponentStorage - ? componentStorage.run( - componentDebugInfo, - callComponentInDEV, - Component, - props, - componentDebugInfo - ) - : callComponentInDEV(Component, props, componentDebugInfo); + ? task.debugTask + ? task.debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ) + : task.debugTask + ? task.debugTask.run( + callComponentInDEV.bind( + null, + Component, + props, + componentDebugInfo + ) + ) + : callComponentInDEV(Component, props, componentDebugInfo); if (request.status === ABORTING) throw ( ("object" !== typeof props || @@ -1007,15 +1107,60 @@ props ); Component = task.keyPath; - prevThenableState = task.implicitSlot; + validated = task.implicitSlot; null !== key ? (task.keyPath = null === Component ? key : Component + "," + key) : null === Component && (task.implicitSlot = !0); request = renderModelDestructive(request, task, emptyRoot, "", props); task.keyPath = Component; - task.implicitSlot = prevThenableState; + task.implicitSlot = validated; return request; } + function warnForMissingKey(request, key, componentDebugInfo, debugTask) { + function logKeyError() { + console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + "", + "" + ); + } + key = request.didWarnForKey; + null == key && (key = request.didWarnForKey = new WeakSet()); + request = componentDebugInfo.owner; + if (null != request) { + if (key.has(request)) return; + key.add(request); + } + supportsComponentStorage + ? debugTask + ? debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ) + : debugTask + ? debugTask.run( + callComponentInDEV.bind( + null, + logKeyError, + null, + componentDebugInfo + ) + ) + : callComponentInDEV(logKeyError, null, componentDebugInfo); + } function renderFragment(request, task, children) { for (var i = 0; i < children.length; i++) { var child = children[i]; @@ -1033,7 +1178,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1052,7 +1199,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1066,14 +1215,16 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); retryTask(request, task); return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } - function renderElement(request, task, type, key, ref, props) { + function renderElement(request, task, type, key, ref, props, validated) { if (null !== ref && void 0 !== ref) throw Error( "Refs cannot be used in Server Components, nor passed to Client Components." @@ -1089,7 +1240,22 @@ ) { if (type === REACT_FRAGMENT_TYPE && null === key) return ( - (type = task.implicitSlot), + 2 === validated && + ((validated = { + name: "Fragment", + env: (0, request.environmentName)(), + key: key, + owner: task.debugOwner, + stack: + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + props: props, + debugStack: task.debugStack, + debugTask: task.debugTask + }), + warnForMissingKey(request, key, validated, task.debugTask)), + (validated = task.implicitSlot), null === task.keyPath && (task.implicitSlot = !0), (request = renderModelDestructive( request, @@ -1098,7 +1264,7 @@ "", props.children )), - (task.implicitSlot = type), + (task.implicitSlot = validated), request ); if ( @@ -1110,26 +1276,61 @@ case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); if (request.status === ABORTING) throw null; - return renderElement(request, task, type, key, ref, props); + return renderElement( + request, + task, + type, + key, + ref, + props, + validated + ); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( request, task, key, type.render, - props + props, + validated ); case REACT_MEMO_TYPE: - return renderElement(request, task, type.type, key, ref, props); + return renderElement( + request, + task, + type.type, + key, + ref, + props, + validated + ); case REACT_ELEMENT_TYPE: type._store.validated = 1; } - } else return renderFunctionComponent(request, task, key, type, props); + } else + return renderFunctionComponent( + request, + task, + key, + type, + props, + validated + ); ref = task.keyPath; null === key ? (key = ref) : null !== ref && (key = ref + "," + key); null !== task.debugOwner && outlineComponentInfo(request, task.debugOwner); - request = [REACT_ELEMENT_TYPE, type, key, props, task.debugOwner]; + request = [ + REACT_ELEMENT_TYPE, + type, + key, + props, + task.debugOwner, + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + validated + ]; task = task.implicitSlot && null !== key ? [request] : request; return task; } @@ -1152,7 +1353,9 @@ keyPath, implicitSlot, abortSet, - debugOwner + debugOwner, + debugStack, + debugTask ) { request.pendingChunks++; var id = request.nextChunkId++; @@ -1200,6 +1403,8 @@ }; task.environmentName = request.environmentName(); task.debugOwner = debugOwner; + task.debugStack = debugStack; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -1292,6 +1497,8 @@ null, !1, request.abortableTasks, + null, + null, null ); retryTask(request, value); @@ -1385,6 +1592,8 @@ null, !1, request.abortableTasks, + null, + null, null ), reader = blob.stream().getReader(), @@ -1427,7 +1636,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask )), (value = request.ping), key.then(value, value), @@ -1484,13 +1695,16 @@ _existingReference = value.props; var refProp = _existingReference.ref; task.debugOwner = value._owner; + task.debugStack = value._debugStack; + task.debugTask = value._debugTask; request = renderElement( request, task, value.type, value.key, void 0 !== refProp ? refProp : null, - _existingReference + _existingReference, + value._store.validated ); "object" === typeof request && null !== request && @@ -1880,6 +2094,7 @@ key: componentInfo.key, owner: componentInfo.owner }; + componentDebugInfo.stack = componentInfo.stack; componentDebugInfo.props = componentInfo.props; objectLimit = outlineConsoleValue( request, @@ -1945,25 +2160,34 @@ counter.objectLimit--; switch (value.$$typeof) { case REACT_ELEMENT_TYPE: - return ( - null != value._owner && - outlineComponentInfo(request, value._owner), - "object" === typeof value.type && - null !== value.type && - doNotLimit.add(value.type), - "object" === typeof value.key && - null !== value.key && - doNotLimit.add(value.key), - doNotLimit.add(value.props), - null !== value._owner && doNotLimit.add(value._owner), - [ - REACT_ELEMENT_TYPE, - value.type, - value.key, - value.props, - value._owner - ] - ); + null != value._owner && outlineComponentInfo(request, value._owner); + "object" === typeof value.type && + null !== value.type && + doNotLimit.add(value.type); + "object" === typeof value.key && + null !== value.key && + doNotLimit.add(value.key); + doNotLimit.add(value.props); + null !== value._owner && doNotLimit.add(value._owner); + counter = null; + if (null != value._debugStack) + for ( + counter = filterStackTrace(request, value._debugStack, 1), + doNotLimit.add(counter), + request = 0; + request < counter.length; + request++ + ) + doNotLimit.add(counter[request]); + return [ + REACT_ELEMENT_TYPE, + value.type, + value.key, + value.props, + value._owner, + counter, + value._store.validated + ]; } if ("function" === typeof value.then) { switch (value.status) { @@ -3566,6 +3790,7 @@ throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); + var prefix, suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var callComponent = { "react-stack-bottom-frame": function ( diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js index 11f83524bd52d6..7cac39225f291b 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js @@ -590,7 +590,59 @@ } } function getCurrentStackInDEV() { - return ""; + var owner = resolveOwner(); + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function defaultErrorHandler(error) { console.error(error); @@ -664,7 +716,7 @@ ? defaultFilterStackFrame : filterStackFrame; this.didWarnForKey = null; - type = createTask(this, model, null, !1, abortSet, null); + type = createTask(this, model, null, !1, abortSet, null, null, null); pingedTasks.push(type); } function noop() {} @@ -680,7 +732,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); (task = thenable._debugInfo) && forwardDebugInfo(request, newTask.id, task); @@ -778,7 +832,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -848,7 +904,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -900,14 +958,21 @@ return lazyType; } function callWithDebugContextInDEV(request, task, callback, arg) { - currentOwner = { + var componentDebugInfo = { name: "", env: task.environmentName, key: null, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); + componentDebugInfo.debugStack = task.debugStack; + request = componentDebugInfo.debugTask = task.debugTask; + currentOwner = componentDebugInfo; try { - return callback(arg); + return request ? request.run(callback.bind(null, arg)) : callback(arg); } finally { currentOwner = null; } @@ -977,7 +1042,14 @@ (multiShot._debugInfo = result._debugInfo), multiShot); } - function renderFunctionComponent(request, task, key, Component, props) { + function renderFunctionComponent( + request, + task, + key, + Component, + props, + validated + ) { var prevThenableState = task.thenableState; task.thenableState = null; if (null === debugID) return outlineTask(request, task); @@ -994,21 +1066,40 @@ key: key, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); componentDebugInfo.props = props; + componentDebugInfo.debugStack = task.debugStack; + componentDebugInfo.debugTask = task.debugTask; outlineComponentInfo(request, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo); task.environmentName = componentEnv; + 2 === validated && + warnForMissingKey(request, key, componentDebugInfo, task.debugTask); } thenableIndexCounter = 0; thenableState = prevThenableState; currentComponentDebugInfo = componentDebugInfo; - props = componentStorage.run( - componentDebugInfo, - callComponentInDEV, - Component, - props, - componentDebugInfo - ); + props = task.debugTask + ? task.debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ); if (request.status === ABORTING) throw ( ("object" !== typeof props || @@ -1025,15 +1116,49 @@ props ); Component = task.keyPath; - prevThenableState = task.implicitSlot; + validated = task.implicitSlot; null !== key ? (task.keyPath = null === Component ? key : Component + "," + key) : null === Component && (task.implicitSlot = !0); request = renderModelDestructive(request, task, emptyRoot, "", props); task.keyPath = Component; - task.implicitSlot = prevThenableState; + task.implicitSlot = validated; return request; } + function warnForMissingKey(request, key, componentDebugInfo, debugTask) { + function logKeyError() { + console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + "", + "" + ); + } + key = request.didWarnForKey; + null == key && (key = request.didWarnForKey = new WeakSet()); + request = componentDebugInfo.owner; + if (null != request) { + if (key.has(request)) return; + key.add(request); + } + debugTask + ? debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ); + } function renderFragment(request, task, children) { for (var i = 0; i < children.length; i++) { var child = children[i]; @@ -1051,7 +1176,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1070,7 +1197,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1084,14 +1213,16 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); retryTask(request, task); return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } - function renderElement(request, task, type, key, ref, props) { + function renderElement(request, task, type, key, ref, props, validated) { if (null !== ref && void 0 !== ref) throw Error( "Refs cannot be used in Server Components, nor passed to Client Components." @@ -1107,7 +1238,22 @@ ) { if (type === REACT_FRAGMENT_TYPE && null === key) return ( - (type = task.implicitSlot), + 2 === validated && + ((validated = { + name: "Fragment", + env: (0, request.environmentName)(), + key: key, + owner: task.debugOwner, + stack: + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + props: props, + debugStack: task.debugStack, + debugTask: task.debugTask + }), + warnForMissingKey(request, key, validated, task.debugTask)), + (validated = task.implicitSlot), null === task.keyPath && (task.implicitSlot = !0), (request = renderModelDestructive( request, @@ -1116,7 +1262,7 @@ "", props.children )), - (task.implicitSlot = type), + (task.implicitSlot = validated), request ); if ( @@ -1128,26 +1274,61 @@ case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); if (request.status === ABORTING) throw null; - return renderElement(request, task, type, key, ref, props); + return renderElement( + request, + task, + type, + key, + ref, + props, + validated + ); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( request, task, key, type.render, - props + props, + validated ); case REACT_MEMO_TYPE: - return renderElement(request, task, type.type, key, ref, props); + return renderElement( + request, + task, + type.type, + key, + ref, + props, + validated + ); case REACT_ELEMENT_TYPE: type._store.validated = 1; } - } else return renderFunctionComponent(request, task, key, type, props); + } else + return renderFunctionComponent( + request, + task, + key, + type, + props, + validated + ); ref = task.keyPath; null === key ? (key = ref) : null !== ref && (key = ref + "," + key); null !== task.debugOwner && outlineComponentInfo(request, task.debugOwner); - request = [REACT_ELEMENT_TYPE, type, key, props, task.debugOwner]; + request = [ + REACT_ELEMENT_TYPE, + type, + key, + props, + task.debugOwner, + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + validated + ]; task = task.implicitSlot && null !== key ? [request] : request; return task; } @@ -1170,7 +1351,9 @@ keyPath, implicitSlot, abortSet, - debugOwner + debugOwner, + debugStack, + debugTask ) { request.pendingChunks++; var id = request.nextChunkId++; @@ -1218,6 +1401,8 @@ }; task.environmentName = request.environmentName(); task.debugOwner = debugOwner; + task.debugStack = debugStack; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -1308,6 +1493,8 @@ null, !1, request.abortableTasks, + null, + null, null ); retryTask(request, value); @@ -1401,6 +1588,8 @@ null, !1, request.abortableTasks, + null, + null, null ), reader = blob.stream().getReader(), @@ -1443,7 +1632,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask )), (value = request.ping), key.then(value, value), @@ -1500,13 +1691,16 @@ _existingReference = value.props; var refProp = _existingReference.ref; task.debugOwner = value._owner; + task.debugStack = value._debugStack; + task.debugTask = value._debugTask; request = renderElement( request, task, value.type, value.key, void 0 !== refProp ? refProp : null, - _existingReference + _existingReference, + value._store.validated ); "object" === typeof request && null !== request && @@ -1888,6 +2082,7 @@ key: componentInfo.key, owner: componentInfo.owner }; + componentDebugInfo.stack = componentInfo.stack; componentDebugInfo.props = componentInfo.props; objectLimit = outlineConsoleValue( request, @@ -1949,25 +2144,34 @@ counter.objectLimit--; switch (value.$$typeof) { case REACT_ELEMENT_TYPE: - return ( - null != value._owner && - outlineComponentInfo(request, value._owner), - "object" === typeof value.type && - null !== value.type && - doNotLimit.add(value.type), - "object" === typeof value.key && - null !== value.key && - doNotLimit.add(value.key), - doNotLimit.add(value.props), - null !== value._owner && doNotLimit.add(value._owner), - [ - REACT_ELEMENT_TYPE, - value.type, - value.key, - value.props, - value._owner - ] - ); + null != value._owner && outlineComponentInfo(request, value._owner); + "object" === typeof value.type && + null !== value.type && + doNotLimit.add(value.type); + "object" === typeof value.key && + null !== value.key && + doNotLimit.add(value.key); + doNotLimit.add(value.props); + null !== value._owner && doNotLimit.add(value._owner); + counter = null; + if (null != value._debugStack) + for ( + counter = filterStackTrace(request, value._debugStack, 1), + doNotLimit.add(counter), + request = 0; + request < counter.length; + request++ + ) + doNotLimit.add(counter[request]); + return [ + REACT_ELEMENT_TYPE, + value.type, + value.key, + value.props, + value._owner, + counter, + value._store.validated + ]; } if ("function" === typeof value.then) { switch (value.status) { @@ -3583,6 +3787,7 @@ throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); + var prefix, suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var callComponent = { "react-stack-bottom-frame": function ( @@ -3769,12 +3974,12 @@ "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." ); pendingFiles++; - var JSCompiler_object_inline_chunks_143 = []; + var JSCompiler_object_inline_chunks_150 = []; value.on("data", function (chunk) { - JSCompiler_object_inline_chunks_143.push(chunk); + JSCompiler_object_inline_chunks_150.push(chunk); }); value.on("end", function () { - var blob = new Blob(JSCompiler_object_inline_chunks_143, { + var blob = new Blob(JSCompiler_object_inline_chunks_150, { type: mimeType }); response._formData.append(name, blob, filename); diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js index 3e6e6874d21761..dca1f28d9844b0 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js @@ -2770,12 +2770,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, turbopackMap, options) { "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." ); pendingFiles++; - var JSCompiler_object_inline_chunks_214 = []; + var JSCompiler_object_inline_chunks_227 = []; value.on("data", function (chunk) { - JSCompiler_object_inline_chunks_214.push(chunk); + JSCompiler_object_inline_chunks_227.push(chunk); }); value.on("end", function () { - var blob = new Blob(JSCompiler_object_inline_chunks_214, { + var blob = new Blob(JSCompiler_object_inline_chunks_227, { type: mimeType }); response._formData.append(name, blob, filename); diff --git a/packages/next/src/compiled/react-server-dom-turbopack/package.json b/packages/next/src/compiled/react-server-dom-turbopack/package.json index 45080828744724..97f5e18503a504 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack/package.json @@ -48,7 +48,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "19.1.0-canary-cbbe8666-20250213", - "react-dom": "19.1.0-canary-cbbe8666-20250213" + "react": "19.1.0-canary-32b0cad8-20250213", + "react-dom": "19.1.0-canary-32b0cad8-20250213" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js index 2a941746bf15ec..1ee98fbbccbd6e 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js @@ -2911,10 +2911,10 @@ return hook.checkDCE ? !0 : !1; })({ bundleType: 1, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-32b0cad8-20250213", rendererPackageName: "react-server-dom-webpack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213", + reconcilerVersion: "19.1.0-experimental-32b0cad8-20250213", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json index cc97605868c4ad..079e6ab596b265 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json @@ -64,8 +64,8 @@ "webpack-sources": "^3.2.0" }, "peerDependencies": { - "react": "0.0.0-experimental-cbbe8666-20250213", - "react-dom": "0.0.0-experimental-cbbe8666-20250213", + "react": "0.0.0-experimental-32b0cad8-20250213", + "react-dom": "0.0.0-experimental-32b0cad8-20250213", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js index c605295a622e0f..c00e1337e2690e 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js @@ -1072,6 +1072,22 @@ function nullRefGetter() { return null; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ("function" === typeof type) return '"use client"'; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return type._init === readChunk ? '"use client"' : "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function createLazyChunkWrapper(chunk) { var lazyType = { $$typeof: REACT_LAZY_TYPE, @@ -1145,17 +1161,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), - (chunk._debugInfo || (chunk._debugInfo = [])).push(blockedValue)), - triggerErrorOnChunk(chunk, error)); + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); + (chunk._debugInfo || (chunk._debugInfo = [])).push( + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } if (initializingHandler) { @@ -1240,19 +1264,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); (chunk._debugInfo || (chunk._debugInfo = [])).push( - blockedValue - )), - triggerErrorOnChunk(chunk, error)); + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } ); @@ -1522,10 +1552,14 @@ : ReactSharedInteralsServer.A.getOwner(); this._debugRootStack = null !== bundlerConfig ? Error("react-stack-top-frame") : null; + environmentName = void 0 === environmentName ? "Server" : environmentName; + supportsCreateTask && + (this._debugRootTask = console.createTask( + '"use ' + environmentName.toLowerCase() + '"' + )); this._debugFindSourceMapURL = findSourceMapURL; this._replayConsole = replayConsole; - this._rootEnvironmentName = - void 0 === environmentName ? "Server" : environmentName; + this._rootEnvironmentName = environmentName; this._fromJSON = createFromJSONCallback(this); } function resolveModel(response, id, model) { @@ -1935,6 +1969,47 @@ : rootTask : null; } + function initializeFakeTask(response, debugInfo, childEnvironmentName) { + if (!supportsCreateTask || null == debugInfo.stack) return null; + var stack = debugInfo.stack, + env = + null == debugInfo.env ? response._rootEnvironmentName : debugInfo.env; + if (env !== childEnvironmentName) + return ( + (debugInfo = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env)), + buildFakeTask( + response, + debugInfo, + stack, + '"use ' + childEnvironmentName.toLowerCase() + '"', + env + ) + ); + childEnvironmentName = debugInfo.debugTask; + if (void 0 !== childEnvironmentName) return childEnvironmentName; + childEnvironmentName = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env); + return (debugInfo.debugTask = buildFakeTask( + response, + childEnvironmentName, + stack, + "<" + (debugInfo.name || "...") + ">", + env + )); + } + function buildFakeTask(response, ownerTask, stack, taskName, env) { + taskName = console.createTask.bind(console, taskName); + stack = buildFakeCallStack(response, stack, env, taskName); + return null === ownerTask + ? ((response = getRootTask(response, env)), + null != response ? response.run(stack) : stack()) + : ownerTask.run(stack); + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -1950,6 +2025,12 @@ initializeFakeStack(response, debugInfo.owner)); } function resolveDebugInfo(response, id, debugInfo) { + var env = + void 0 === debugInfo.env + ? response._rootEnvironmentName + : debugInfo.env; + void 0 !== debugInfo.stack && + initializeFakeTask(response, debugInfo, env); null === debugInfo.owner && null != response._debugRootOwner ? ((debugInfo.owner = response._debugRootOwner), (debugInfo.debugStack = response._debugRootStack)) @@ -1959,7 +2040,59 @@ (response._debugInfo || (response._debugInfo = [])).push(debugInfo); } function getCurrentStackInDEV() { - return ""; + var owner = currentOwnerInDEV; + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function resolveConsoleEntry(response, value) { if (response._replayConsole) { @@ -2130,58 +2263,100 @@ if ("string" === typeof value) return parseModelString(response, this, key, value); if ("object" === typeof value && null !== value) { - if (value[0] === REACT_ELEMENT_TYPE) - if ( - ((key = value[4]), - (value = { - $$typeof: REACT_ELEMENT_TYPE, - type: value[1], - key: value[2], - props: value[3], - _owner: null === key ? response._debugRootOwner : key - }), - Object.defineProperty(value, "ref", { - enumerable: !1, - get: nullRefGetter - }), - (value._store = {}), - Object.defineProperty(value._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 1 - }), - Object.defineProperty(value, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }), - null !== initializingHandler) - ) { - var handler = initializingHandler; - initializingHandler = handler.parent; - handler.errored - ? ((key = new ReactPromise( - "rejected", - null, - handler.value, - response - )), - (value = { - name: getComponentNameFromType(value.type) || "", - owner: value._owner - }), - (key._debugInfo = [value]), - (value = createLazyChunkWrapper(key))) - : 0 < handler.deps && - ((key = new ReactPromise("blocked", null, null, response)), - (handler.value = value), - (handler.chunk = key), - (value = Object.freeze.bind(Object, value.props)), - key.then(value, value), - (value = createLazyChunkWrapper(key))); - } else Object.freeze(value.props); + if (value[0] === REACT_ELEMENT_TYPE) { + var type = value[1]; + key = value[4]; + var stack = value[5], + validated = value[6]; + value = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: value[2], + props: value[3], + _owner: null === key ? response._debugRootOwner : key + }; + Object.defineProperty(value, "ref", { + enumerable: !1, + get: nullRefGetter + }); + value._store = {}; + Object.defineProperty(value._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: validated + }); + Object.defineProperty(value, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + validated = response._rootEnvironmentName; + null !== key && null != key.env && (validated = key.env); + var normalizedStackTrace = null; + null === key && null != response._debugRootStack + ? (normalizedStackTrace = response._debugRootStack) + : null !== stack && + (normalizedStackTrace = createFakeJSXCallStackInDEV( + response, + stack, + validated + )); + Object.defineProperty(value, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + normalizedStackTrace = null; + supportsCreateTask && + null !== stack && + ((type = console.createTask.bind(console, getTaskName(type))), + (stack = buildFakeCallStack(response, stack, validated, type)), + (type = + null === key + ? null + : initializeFakeTask(response, key, validated)), + null === type + ? ((type = response._debugRootTask), + (normalizedStackTrace = + null != type ? type.run(stack) : stack())) + : (normalizedStackTrace = type.run(stack))); + Object.defineProperty(value, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + null !== key && initializeFakeStack(response, key); + null !== initializingHandler + ? ((stack = initializingHandler), + (initializingHandler = stack.parent), + stack.errored + ? ((key = new ReactPromise( + "rejected", + null, + stack.value, + response + )), + (stack = { + name: getComponentNameFromType(value.type) || "", + owner: value._owner + }), + (stack.debugStack = value._debugStack), + supportsCreateTask && (stack.debugTask = value._debugTask), + (key._debugInfo = [stack]), + (value = createLazyChunkWrapper(key))) + : 0 < stack.deps && + ((key = new ReactPromise("blocked", null, null, response)), + (stack.value = value), + (stack.chunk = key), + (value = Object.freeze.bind(Object, value.props)), + key.then(value, value), + (value = createLazyChunkWrapper(key)))) + : Object.freeze(value.props); + } return value; } return value; @@ -2341,7 +2516,9 @@ v8FrameRegExp = /^ {3} at (?:(.+) \((.+):(\d+):(\d+)\)|(?:async )?(.+):(\d+):(\d+))$/, jscSpiderMonkeyFrameRegExp = /(?:(.*)@)?(.*):(\d+):(\d+)/, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + prefix, + suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var ReactSharedInteralsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, @@ -2375,6 +2552,7 @@ } }; var initializingHandler = null, + supportsCreateTask = !!console.createTask, fakeFunctionCache = new Map(), fakeFunctionIdx = 0, createFakeJSXCallStack = { @@ -2453,7 +2631,14 @@ env, JSCompiler_inline_result ); - null != owner && initializeFakeStack(response, owner); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } var rootTask = getRootTask(response, env); null != rootTask ? rootTask.run(callStack) : callStack(); } finally { @@ -2477,10 +2662,10 @@ return hook.checkDCE ? !0 : !1; })({ bundleType: 1, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-32b0cad8-20250213", rendererPackageName: "react-server-dom-webpack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213", + reconcilerVersion: "19.1.0-canary-32b0cad8-20250213", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js index 392c9302d68d4c..67f8550a17bbd8 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js @@ -1120,6 +1120,12 @@ } return null; } + function prepareStackTrace(error, structuredStackTrace) { + error = (error.name || "Error") + ": " + (error.message || ""); + for (var i = 0; i < structuredStackTrace.length; i++) + error += "\n at " + structuredStackTrace[i].toString(); + return error; + } function ReactPromise(status, value, reason, response) { this.status = status; this.value = value; @@ -1276,6 +1282,22 @@ function nullRefGetter() { return null; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ("function" === typeof type) return '"use client"'; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return type._init === readChunk ? '"use client"' : "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function createLazyChunkWrapper(chunk) { var lazyType = { $$typeof: REACT_LAZY_TYPE, @@ -1349,17 +1371,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), - (chunk._debugInfo || (chunk._debugInfo = [])).push(blockedValue)), - triggerErrorOnChunk(chunk, error)); + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); + (chunk._debugInfo || (chunk._debugInfo = [])).push( + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } if (initializingHandler) { @@ -1444,19 +1474,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); (chunk._debugInfo || (chunk._debugInfo = [])).push( - blockedValue - )), - triggerErrorOnChunk(chunk, error)); + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } ); @@ -1726,10 +1762,14 @@ : ReactSharedInteralsServer.A.getOwner(); this._debugRootStack = null !== bundlerConfig ? Error("react-stack-top-frame") : null; + environmentName = void 0 === environmentName ? "Server" : environmentName; + supportsCreateTask && + (this._debugRootTask = console.createTask( + '"use ' + environmentName.toLowerCase() + '"' + )); this._debugFindSourceMapURL = findSourceMapURL; this._replayConsole = replayConsole; - this._rootEnvironmentName = - void 0 === environmentName ? "Server" : environmentName; + this._rootEnvironmentName = environmentName; this._fromJSON = createFromJSONCallback(this); } function resolveModel(response, id, model) { @@ -2144,6 +2184,47 @@ : rootTask : null; } + function initializeFakeTask(response, debugInfo, childEnvironmentName) { + if (!supportsCreateTask || null == debugInfo.stack) return null; + var stack = debugInfo.stack, + env = + null == debugInfo.env ? response._rootEnvironmentName : debugInfo.env; + if (env !== childEnvironmentName) + return ( + (debugInfo = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env)), + buildFakeTask( + response, + debugInfo, + stack, + '"use ' + childEnvironmentName.toLowerCase() + '"', + env + ) + ); + childEnvironmentName = debugInfo.debugTask; + if (void 0 !== childEnvironmentName) return childEnvironmentName; + childEnvironmentName = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env); + return (debugInfo.debugTask = buildFakeTask( + response, + childEnvironmentName, + stack, + "<" + (debugInfo.name || "...") + ">", + env + )); + } + function buildFakeTask(response, ownerTask, stack, taskName, env) { + taskName = console.createTask.bind(console, taskName); + stack = buildFakeCallStack(response, stack, env, taskName); + return null === ownerTask + ? ((response = getRootTask(response, env)), + null != response ? response.run(stack) : stack()) + : ownerTask.run(stack); + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -2159,6 +2240,12 @@ initializeFakeStack(response, debugInfo.owner)); } function resolveDebugInfo(response, id, debugInfo) { + var env = + void 0 === debugInfo.env + ? response._rootEnvironmentName + : debugInfo.env; + void 0 !== debugInfo.stack && + initializeFakeTask(response, debugInfo, env); null === debugInfo.owner && null != response._debugRootOwner ? ((debugInfo.owner = response._debugRootOwner), (debugInfo.debugStack = response._debugRootStack)) @@ -2168,7 +2255,59 @@ (response._debugInfo || (response._debugInfo = [])).push(debugInfo); } function getCurrentStackInDEV() { - return ""; + var owner = currentOwnerInDEV; + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function resolveConsoleEntry(response, value) { if (response._replayConsole) { @@ -2339,58 +2478,100 @@ if ("string" === typeof value) return parseModelString(response, this, key, value); if ("object" === typeof value && null !== value) { - if (value[0] === REACT_ELEMENT_TYPE) - if ( - ((key = value[4]), - (value = { - $$typeof: REACT_ELEMENT_TYPE, - type: value[1], - key: value[2], - props: value[3], - _owner: null === key ? response._debugRootOwner : key - }), - Object.defineProperty(value, "ref", { - enumerable: !1, - get: nullRefGetter - }), - (value._store = {}), - Object.defineProperty(value._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 1 - }), - Object.defineProperty(value, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }), - null !== initializingHandler) - ) { - var handler = initializingHandler; - initializingHandler = handler.parent; - handler.errored - ? ((key = new ReactPromise( - "rejected", - null, - handler.value, - response - )), - (value = { - name: getComponentNameFromType(value.type) || "", - owner: value._owner - }), - (key._debugInfo = [value]), - (value = createLazyChunkWrapper(key))) - : 0 < handler.deps && - ((key = new ReactPromise("blocked", null, null, response)), - (handler.value = value), - (handler.chunk = key), - (value = Object.freeze.bind(Object, value.props)), - key.then(value, value), - (value = createLazyChunkWrapper(key))); - } else Object.freeze(value.props); + if (value[0] === REACT_ELEMENT_TYPE) { + var type = value[1]; + key = value[4]; + var stack = value[5], + validated = value[6]; + value = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: value[2], + props: value[3], + _owner: null === key ? response._debugRootOwner : key + }; + Object.defineProperty(value, "ref", { + enumerable: !1, + get: nullRefGetter + }); + value._store = {}; + Object.defineProperty(value._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: validated + }); + Object.defineProperty(value, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + validated = response._rootEnvironmentName; + null !== key && null != key.env && (validated = key.env); + var normalizedStackTrace = null; + null === key && null != response._debugRootStack + ? (normalizedStackTrace = response._debugRootStack) + : null !== stack && + (normalizedStackTrace = createFakeJSXCallStackInDEV( + response, + stack, + validated + )); + Object.defineProperty(value, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + normalizedStackTrace = null; + supportsCreateTask && + null !== stack && + ((type = console.createTask.bind(console, getTaskName(type))), + (stack = buildFakeCallStack(response, stack, validated, type)), + (type = + null === key + ? null + : initializeFakeTask(response, key, validated)), + null === type + ? ((type = response._debugRootTask), + (normalizedStackTrace = + null != type ? type.run(stack) : stack())) + : (normalizedStackTrace = type.run(stack))); + Object.defineProperty(value, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + null !== key && initializeFakeStack(response, key); + null !== initializingHandler + ? ((stack = initializingHandler), + (initializingHandler = stack.parent), + stack.errored + ? ((key = new ReactPromise( + "rejected", + null, + stack.value, + response + )), + (stack = { + name: getComponentNameFromType(value.type) || "", + owner: value._owner + }), + (stack.debugStack = value._debugStack), + supportsCreateTask && (stack.debugTask = value._debugTask), + (key._debugInfo = [stack]), + (value = createLazyChunkWrapper(key))) + : 0 < stack.deps && + ((key = new ReactPromise("blocked", null, null, response)), + (stack.value = value), + (stack.chunk = key), + (value = Object.freeze.bind(Object, value.props)), + key.then(value, value), + (value = createLazyChunkWrapper(key)))) + : Object.freeze(value.props); + } return value; } return value; @@ -2550,7 +2731,9 @@ v8FrameRegExp = /^ {3} at (?:(.+) \((.+):(\d+):(\d+)\)|(?:async )?(.+):(\d+):(\d+))$/, jscSpiderMonkeyFrameRegExp = /(?:(.*)@)?(.*):(\d+):(\d+)/, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + prefix, + suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var ReactSharedInteralsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, @@ -2584,6 +2767,7 @@ } }; var initializingHandler = null, + supportsCreateTask = !!console.createTask, fakeFunctionCache = new Map(), fakeFunctionIdx = 0, createFakeJSXCallStack = { @@ -2603,6 +2787,7 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), + currentOwnerInDEV = null, replayConsoleWithCallStack = { "react-stack-bottom-frame": function ( response, @@ -2614,6 +2799,7 @@ ) { var prevStack = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = null === owner ? response._debugRootOwner : owner; try { a: { var offset = 0; @@ -2660,11 +2846,19 @@ env, JSCompiler_inline_result ); - null != owner && initializeFakeStack(response, owner); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } var rootTask = getRootTask(response, env); null != rootTask ? rootTask.run(callStack) : callStack(); } finally { - ReactSharedInternals.getCurrentStack = prevStack; + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); } } }, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js index c24897fa972c0e..ff1fda9de6b846 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js @@ -1120,6 +1120,12 @@ } return null; } + function prepareStackTrace(error, structuredStackTrace) { + error = (error.name || "Error") + ": " + (error.message || ""); + for (var i = 0; i < structuredStackTrace.length; i++) + error += "\n at " + structuredStackTrace[i].toString(); + return error; + } function ReactPromise(status, value, reason, response) { this.status = status; this.value = value; @@ -1276,6 +1282,22 @@ function nullRefGetter() { return null; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ("function" === typeof type) return '"use client"'; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return type._init === readChunk ? '"use client"' : "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function createLazyChunkWrapper(chunk) { var lazyType = { $$typeof: REACT_LAZY_TYPE, @@ -1349,17 +1371,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), - (chunk._debugInfo || (chunk._debugInfo = [])).push(blockedValue)), - triggerErrorOnChunk(chunk, error)); + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); + (chunk._debugInfo || (chunk._debugInfo = [])).push( + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } if (initializingHandler) { @@ -1444,19 +1474,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); (chunk._debugInfo || (chunk._debugInfo = [])).push( - blockedValue - )), - triggerErrorOnChunk(chunk, error)); + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } ); @@ -1726,10 +1762,14 @@ : ReactSharedInteralsServer.A.getOwner(); this._debugRootStack = null !== bundlerConfig ? Error("react-stack-top-frame") : null; + environmentName = void 0 === environmentName ? "Server" : environmentName; + supportsCreateTask && + (this._debugRootTask = console.createTask( + '"use ' + environmentName.toLowerCase() + '"' + )); this._debugFindSourceMapURL = findSourceMapURL; this._replayConsole = replayConsole; - this._rootEnvironmentName = - void 0 === environmentName ? "Server" : environmentName; + this._rootEnvironmentName = environmentName; this._fromJSON = createFromJSONCallback(this); } function resolveModel(response, id, model) { @@ -2144,6 +2184,47 @@ : rootTask : null; } + function initializeFakeTask(response, debugInfo, childEnvironmentName) { + if (!supportsCreateTask || null == debugInfo.stack) return null; + var stack = debugInfo.stack, + env = + null == debugInfo.env ? response._rootEnvironmentName : debugInfo.env; + if (env !== childEnvironmentName) + return ( + (debugInfo = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env)), + buildFakeTask( + response, + debugInfo, + stack, + '"use ' + childEnvironmentName.toLowerCase() + '"', + env + ) + ); + childEnvironmentName = debugInfo.debugTask; + if (void 0 !== childEnvironmentName) return childEnvironmentName; + childEnvironmentName = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env); + return (debugInfo.debugTask = buildFakeTask( + response, + childEnvironmentName, + stack, + "<" + (debugInfo.name || "...") + ">", + env + )); + } + function buildFakeTask(response, ownerTask, stack, taskName, env) { + taskName = console.createTask.bind(console, taskName); + stack = buildFakeCallStack(response, stack, env, taskName); + return null === ownerTask + ? ((response = getRootTask(response, env)), + null != response ? response.run(stack) : stack()) + : ownerTask.run(stack); + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -2159,6 +2240,12 @@ initializeFakeStack(response, debugInfo.owner)); } function resolveDebugInfo(response, id, debugInfo) { + var env = + void 0 === debugInfo.env + ? response._rootEnvironmentName + : debugInfo.env; + void 0 !== debugInfo.stack && + initializeFakeTask(response, debugInfo, env); null === debugInfo.owner && null != response._debugRootOwner ? ((debugInfo.owner = response._debugRootOwner), (debugInfo.debugStack = response._debugRootStack)) @@ -2168,7 +2255,59 @@ (response._debugInfo || (response._debugInfo = [])).push(debugInfo); } function getCurrentStackInDEV() { - return ""; + var owner = currentOwnerInDEV; + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function resolveConsoleEntry(response, value) { if (response._replayConsole) { @@ -2339,58 +2478,100 @@ if ("string" === typeof value) return parseModelString(response, this, key, value); if ("object" === typeof value && null !== value) { - if (value[0] === REACT_ELEMENT_TYPE) - if ( - ((key = value[4]), - (value = { - $$typeof: REACT_ELEMENT_TYPE, - type: value[1], - key: value[2], - props: value[3], - _owner: null === key ? response._debugRootOwner : key - }), - Object.defineProperty(value, "ref", { - enumerable: !1, - get: nullRefGetter - }), - (value._store = {}), - Object.defineProperty(value._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 1 - }), - Object.defineProperty(value, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }), - null !== initializingHandler) - ) { - var handler = initializingHandler; - initializingHandler = handler.parent; - handler.errored - ? ((key = new ReactPromise( - "rejected", - null, - handler.value, - response - )), - (value = { - name: getComponentNameFromType(value.type) || "", - owner: value._owner - }), - (key._debugInfo = [value]), - (value = createLazyChunkWrapper(key))) - : 0 < handler.deps && - ((key = new ReactPromise("blocked", null, null, response)), - (handler.value = value), - (handler.chunk = key), - (value = Object.freeze.bind(Object, value.props)), - key.then(value, value), - (value = createLazyChunkWrapper(key))); - } else Object.freeze(value.props); + if (value[0] === REACT_ELEMENT_TYPE) { + var type = value[1]; + key = value[4]; + var stack = value[5], + validated = value[6]; + value = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: value[2], + props: value[3], + _owner: null === key ? response._debugRootOwner : key + }; + Object.defineProperty(value, "ref", { + enumerable: !1, + get: nullRefGetter + }); + value._store = {}; + Object.defineProperty(value._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: validated + }); + Object.defineProperty(value, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + validated = response._rootEnvironmentName; + null !== key && null != key.env && (validated = key.env); + var normalizedStackTrace = null; + null === key && null != response._debugRootStack + ? (normalizedStackTrace = response._debugRootStack) + : null !== stack && + (normalizedStackTrace = createFakeJSXCallStackInDEV( + response, + stack, + validated + )); + Object.defineProperty(value, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + normalizedStackTrace = null; + supportsCreateTask && + null !== stack && + ((type = console.createTask.bind(console, getTaskName(type))), + (stack = buildFakeCallStack(response, stack, validated, type)), + (type = + null === key + ? null + : initializeFakeTask(response, key, validated)), + null === type + ? ((type = response._debugRootTask), + (normalizedStackTrace = + null != type ? type.run(stack) : stack())) + : (normalizedStackTrace = type.run(stack))); + Object.defineProperty(value, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + null !== key && initializeFakeStack(response, key); + null !== initializingHandler + ? ((stack = initializingHandler), + (initializingHandler = stack.parent), + stack.errored + ? ((key = new ReactPromise( + "rejected", + null, + stack.value, + response + )), + (stack = { + name: getComponentNameFromType(value.type) || "", + owner: value._owner + }), + (stack.debugStack = value._debugStack), + supportsCreateTask && (stack.debugTask = value._debugTask), + (key._debugInfo = [stack]), + (value = createLazyChunkWrapper(key))) + : 0 < stack.deps && + ((key = new ReactPromise("blocked", null, null, response)), + (stack.value = value), + (stack.chunk = key), + (value = Object.freeze.bind(Object, value.props)), + key.then(value, value), + (value = createLazyChunkWrapper(key)))) + : Object.freeze(value.props); + } return value; } return value; @@ -2438,7 +2619,9 @@ v8FrameRegExp = /^ {3} at (?:(.+) \((.+):(\d+):(\d+)\)|(?:async )?(.+):(\d+):(\d+))$/, jscSpiderMonkeyFrameRegExp = /(?:(.*)@)?(.*):(\d+):(\d+)/, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + prefix, + suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var ReactSharedInteralsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, @@ -2472,6 +2655,7 @@ } }; var initializingHandler = null, + supportsCreateTask = !!console.createTask, fakeFunctionCache = new Map(), fakeFunctionIdx = 0, createFakeJSXCallStack = { @@ -2491,6 +2675,7 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), + currentOwnerInDEV = null, replayConsoleWithCallStack = { "react-stack-bottom-frame": function ( response, @@ -2502,6 +2687,7 @@ ) { var prevStack = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = null === owner ? response._debugRootOwner : owner; try { a: { var offset = 0; @@ -2548,11 +2734,19 @@ env, JSCompiler_inline_result ); - null != owner && initializeFakeStack(response, owner); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } var rootTask = getRootTask(response, env); null != rootTask ? rootTask.run(callStack) : callStack(); } finally { - ReactSharedInternals.getCurrentStack = prevStack; + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); } } }, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js index 95c7832e6b6187..38d3baa24ab4d3 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js @@ -1082,6 +1082,12 @@ } return null; } + function prepareStackTrace(error, structuredStackTrace) { + error = (error.name || "Error") + ": " + (error.message || ""); + for (var i = 0; i < structuredStackTrace.length; i++) + error += "\n at " + structuredStackTrace[i].toString(); + return error; + } function ReactPromise(status, value, reason, response) { this.status = status; this.value = value; @@ -1238,6 +1244,22 @@ function nullRefGetter() { return null; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ("function" === typeof type) return '"use client"'; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return type._init === readChunk ? '"use client"' : "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function createLazyChunkWrapper(chunk) { var lazyType = { $$typeof: REACT_LAZY_TYPE, @@ -1311,17 +1333,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), - (chunk._debugInfo || (chunk._debugInfo = [])).push(blockedValue)), - triggerErrorOnChunk(chunk, error)); + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); + (chunk._debugInfo || (chunk._debugInfo = [])).push( + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } if (initializingHandler) { @@ -1406,19 +1436,25 @@ handler.errored = !0; handler.value = error; var chunk = handler.chunk; - null !== chunk && - "blocked" === chunk.status && - ("object" === typeof blockedValue && + if (null !== chunk && "blocked" === chunk.status) { + if ( + "object" === typeof blockedValue && null !== blockedValue && - blockedValue.$$typeof === REACT_ELEMENT_TYPE && - ((blockedValue = { + blockedValue.$$typeof === REACT_ELEMENT_TYPE + ) { + var erroredComponent = { name: getComponentNameFromType(blockedValue.type) || "", owner: blockedValue._owner - }), + }; + erroredComponent.debugStack = blockedValue._debugStack; + supportsCreateTask && + (erroredComponent.debugTask = blockedValue._debugTask); (chunk._debugInfo || (chunk._debugInfo = [])).push( - blockedValue - )), - triggerErrorOnChunk(chunk, error)); + erroredComponent + ); + } + triggerErrorOnChunk(chunk, error); + } } } ); @@ -1688,10 +1724,14 @@ : ReactSharedInteralsServer.A.getOwner(); this._debugRootStack = null !== bundlerConfig ? Error("react-stack-top-frame") : null; + environmentName = void 0 === environmentName ? "Server" : environmentName; + supportsCreateTask && + (this._debugRootTask = console.createTask( + '"use ' + environmentName.toLowerCase() + '"' + )); this._debugFindSourceMapURL = findSourceMapURL; this._replayConsole = replayConsole; - this._rootEnvironmentName = - void 0 === environmentName ? "Server" : environmentName; + this._rootEnvironmentName = environmentName; this._fromJSON = createFromJSONCallback(this); } function resolveModel(response, id, model) { @@ -2106,6 +2146,47 @@ : rootTask : null; } + function initializeFakeTask(response, debugInfo, childEnvironmentName) { + if (!supportsCreateTask || null == debugInfo.stack) return null; + var stack = debugInfo.stack, + env = + null == debugInfo.env ? response._rootEnvironmentName : debugInfo.env; + if (env !== childEnvironmentName) + return ( + (debugInfo = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env)), + buildFakeTask( + response, + debugInfo, + stack, + '"use ' + childEnvironmentName.toLowerCase() + '"', + env + ) + ); + childEnvironmentName = debugInfo.debugTask; + if (void 0 !== childEnvironmentName) return childEnvironmentName; + childEnvironmentName = + null == debugInfo.owner + ? null + : initializeFakeTask(response, debugInfo.owner, env); + return (debugInfo.debugTask = buildFakeTask( + response, + childEnvironmentName, + stack, + "<" + (debugInfo.name || "...") + ">", + env + )); + } + function buildFakeTask(response, ownerTask, stack, taskName, env) { + taskName = console.createTask.bind(console, taskName); + stack = buildFakeCallStack(response, stack, env, taskName); + return null === ownerTask + ? ((response = getRootTask(response, env)), + null != response ? response.run(stack) : stack()) + : ownerTask.run(stack); + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -2121,6 +2202,12 @@ initializeFakeStack(response, debugInfo.owner)); } function resolveDebugInfo(response, id, debugInfo) { + var env = + void 0 === debugInfo.env + ? response._rootEnvironmentName + : debugInfo.env; + void 0 !== debugInfo.stack && + initializeFakeTask(response, debugInfo, env); null === debugInfo.owner && null != response._debugRootOwner ? ((debugInfo.owner = response._debugRootOwner), (debugInfo.debugStack = response._debugRootStack)) @@ -2130,7 +2217,59 @@ (response._debugInfo || (response._debugInfo = [])).push(debugInfo); } function getCurrentStackInDEV() { - return ""; + var owner = currentOwnerInDEV; + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function resolveConsoleEntry(response, value) { if (response._replayConsole) { @@ -2301,58 +2440,100 @@ if ("string" === typeof value) return parseModelString(response, this, key, value); if ("object" === typeof value && null !== value) { - if (value[0] === REACT_ELEMENT_TYPE) - if ( - ((key = value[4]), - (value = { - $$typeof: REACT_ELEMENT_TYPE, - type: value[1], - key: value[2], - props: value[3], - _owner: null === key ? response._debugRootOwner : key - }), - Object.defineProperty(value, "ref", { - enumerable: !1, - get: nullRefGetter - }), - (value._store = {}), - Object.defineProperty(value._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 1 - }), - Object.defineProperty(value, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }), - null !== initializingHandler) - ) { - var handler = initializingHandler; - initializingHandler = handler.parent; - handler.errored - ? ((key = new ReactPromise( - "rejected", - null, - handler.value, - response - )), - (value = { - name: getComponentNameFromType(value.type) || "", - owner: value._owner - }), - (key._debugInfo = [value]), - (value = createLazyChunkWrapper(key))) - : 0 < handler.deps && - ((key = new ReactPromise("blocked", null, null, response)), - (handler.value = value), - (handler.chunk = key), - (value = Object.freeze.bind(Object, value.props)), - key.then(value, value), - (value = createLazyChunkWrapper(key))); - } else Object.freeze(value.props); + if (value[0] === REACT_ELEMENT_TYPE) { + var type = value[1]; + key = value[4]; + var stack = value[5], + validated = value[6]; + value = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: value[2], + props: value[3], + _owner: null === key ? response._debugRootOwner : key + }; + Object.defineProperty(value, "ref", { + enumerable: !1, + get: nullRefGetter + }); + value._store = {}; + Object.defineProperty(value._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: validated + }); + Object.defineProperty(value, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + validated = response._rootEnvironmentName; + null !== key && null != key.env && (validated = key.env); + var normalizedStackTrace = null; + null === key && null != response._debugRootStack + ? (normalizedStackTrace = response._debugRootStack) + : null !== stack && + (normalizedStackTrace = createFakeJSXCallStackInDEV( + response, + stack, + validated + )); + Object.defineProperty(value, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + normalizedStackTrace = null; + supportsCreateTask && + null !== stack && + ((type = console.createTask.bind(console, getTaskName(type))), + (stack = buildFakeCallStack(response, stack, validated, type)), + (type = + null === key + ? null + : initializeFakeTask(response, key, validated)), + null === type + ? ((type = response._debugRootTask), + (normalizedStackTrace = + null != type ? type.run(stack) : stack())) + : (normalizedStackTrace = type.run(stack))); + Object.defineProperty(value, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: normalizedStackTrace + }); + null !== key && initializeFakeStack(response, key); + null !== initializingHandler + ? ((stack = initializingHandler), + (initializingHandler = stack.parent), + stack.errored + ? ((key = new ReactPromise( + "rejected", + null, + stack.value, + response + )), + (stack = { + name: getComponentNameFromType(value.type) || "", + owner: value._owner + }), + (stack.debugStack = value._debugStack), + supportsCreateTask && (stack.debugTask = value._debugTask), + (key._debugInfo = [stack]), + (value = createLazyChunkWrapper(key))) + : 0 < stack.deps && + ((key = new ReactPromise("blocked", null, null, response)), + (stack.value = value), + (stack.chunk = key), + (value = Object.freeze.bind(Object, value.props)), + key.then(value, value), + (value = createLazyChunkWrapper(key)))) + : Object.freeze(value.props); + } return value; } return value; @@ -2400,7 +2581,9 @@ v8FrameRegExp = /^ {3} at (?:(.+) \((.+):(\d+):(\d+)\)|(?:async )?(.+):(\d+):(\d+))$/, jscSpiderMonkeyFrameRegExp = /(?:(.*)@)?(.*):(\d+):(\d+)/, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + prefix, + suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var ReactSharedInteralsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, @@ -2434,6 +2617,7 @@ } }; var initializingHandler = null, + supportsCreateTask = !!console.createTask, fakeFunctionCache = new Map(), fakeFunctionIdx = 0, createFakeJSXCallStack = { @@ -2453,6 +2637,7 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), + currentOwnerInDEV = null, replayConsoleWithCallStack = { "react-stack-bottom-frame": function ( response, @@ -2464,6 +2649,7 @@ ) { var prevStack = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = null === owner ? response._debugRootOwner : owner; try { a: { var offset = 0; @@ -2510,11 +2696,19 @@ env, JSCompiler_inline_result ); - null != owner && initializeFakeStack(response, owner); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } var rootTask = getRootTask(response, env); null != rootTask ? rootTask.run(callStack) : callStack(); } finally { - ReactSharedInternals.getCurrentStack = prevStack; + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); } } }, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js index 0bc5c2f8becb93..17c5c2e65b8b43 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js @@ -559,7 +559,59 @@ } } function getCurrentStackInDEV() { - return ""; + var owner = resolveOwner(); + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function defaultErrorHandler(error) { console.error(error); @@ -633,7 +685,7 @@ ? defaultFilterStackFrame : filterStackFrame; this.didWarnForKey = null; - type = createTask(this, model, null, !1, abortSet, null); + type = createTask(this, model, null, !1, abortSet, null, null, null); pingedTasks.push(type); } function noop() {} @@ -644,7 +696,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); (task = thenable._debugInfo) && forwardDebugInfo(request, newTask.id, task); @@ -742,7 +796,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -812,7 +868,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -865,14 +923,21 @@ return lazyType; } function callWithDebugContextInDEV(request, task, callback, arg) { - currentOwner = { + var componentDebugInfo = { name: "", env: task.environmentName, key: null, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); + componentDebugInfo.debugStack = task.debugStack; + request = componentDebugInfo.debugTask = task.debugTask; + currentOwner = componentDebugInfo; try { - return callback(arg); + return request ? request.run(callback.bind(null, arg)) : callback(arg); } finally { currentOwner = null; } @@ -942,7 +1007,14 @@ (multiShot._debugInfo = result._debugInfo), multiShot); } - function renderFunctionComponent(request, task, key, Component, props) { + function renderFunctionComponent( + request, + task, + key, + Component, + props, + validated + ) { var prevThenableState = task.thenableState; task.thenableState = null; if (null === debugID) return outlineTask(request, task); @@ -959,15 +1031,27 @@ key: key, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); componentDebugInfo.props = props; + componentDebugInfo.debugStack = task.debugStack; + componentDebugInfo.debugTask = task.debugTask; outlineComponentInfo(request, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo); task.environmentName = componentEnv; + 2 === validated && + warnForMissingKey(request, key, componentDebugInfo, task.debugTask); } thenableIndexCounter = 0; thenableState = prevThenableState; currentComponentDebugInfo = componentDebugInfo; - props = callComponentInDEV(Component, props, componentDebugInfo); + props = task.debugTask + ? task.debugTask.run( + callComponentInDEV.bind(null, Component, props, componentDebugInfo) + ) + : callComponentInDEV(Component, props, componentDebugInfo); if (request.status === ABORTING) throw ( ("object" !== typeof props || @@ -984,15 +1068,36 @@ props ); Component = task.keyPath; - prevThenableState = task.implicitSlot; + validated = task.implicitSlot; null !== key ? (task.keyPath = null === Component ? key : Component + "," + key) : null === Component && (task.implicitSlot = !0); request = renderModelDestructive(request, task, emptyRoot, "", props); task.keyPath = Component; - task.implicitSlot = prevThenableState; + task.implicitSlot = validated; return request; } + function warnForMissingKey(request, key, componentDebugInfo, debugTask) { + function logKeyError() { + console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + "", + "" + ); + } + key = request.didWarnForKey; + null == key && (key = request.didWarnForKey = new WeakSet()); + request = componentDebugInfo.owner; + if (null != request) { + if (key.has(request)) return; + key.add(request); + } + debugTask + ? debugTask.run( + callComponentInDEV.bind(null, logKeyError, null, componentDebugInfo) + ) + : callComponentInDEV(logKeyError, null, componentDebugInfo); + } function renderFragment(request, task, children) { for (var i = 0; i < children.length; i++) { var child = children[i]; @@ -1010,7 +1115,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1029,7 +1136,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1043,14 +1152,16 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); retryTask(request, task); return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } - function renderElement(request, task, type, key, ref, props) { + function renderElement(request, task, type, key, ref, props, validated) { if (null !== ref && void 0 !== ref) throw Error( "Refs cannot be used in Server Components, nor passed to Client Components." @@ -1066,7 +1177,22 @@ ) { if (type === REACT_FRAGMENT_TYPE && null === key) return ( - (type = task.implicitSlot), + 2 === validated && + ((validated = { + name: "Fragment", + env: (0, request.environmentName)(), + key: key, + owner: task.debugOwner, + stack: + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + props: props, + debugStack: task.debugStack, + debugTask: task.debugTask + }), + warnForMissingKey(request, key, validated, task.debugTask)), + (validated = task.implicitSlot), null === task.keyPath && (task.implicitSlot = !0), (request = renderModelDestructive( request, @@ -1075,7 +1201,7 @@ "", props.children )), - (task.implicitSlot = type), + (task.implicitSlot = validated), request ); if ( @@ -1087,26 +1213,61 @@ case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); if (request.status === ABORTING) throw null; - return renderElement(request, task, type, key, ref, props); + return renderElement( + request, + task, + type, + key, + ref, + props, + validated + ); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( request, task, key, type.render, - props + props, + validated ); case REACT_MEMO_TYPE: - return renderElement(request, task, type.type, key, ref, props); + return renderElement( + request, + task, + type.type, + key, + ref, + props, + validated + ); case REACT_ELEMENT_TYPE: type._store.validated = 1; } - } else return renderFunctionComponent(request, task, key, type, props); + } else + return renderFunctionComponent( + request, + task, + key, + type, + props, + validated + ); ref = task.keyPath; null === key ? (key = ref) : null !== ref && (key = ref + "," + key); null !== task.debugOwner && outlineComponentInfo(request, task.debugOwner); - request = [REACT_ELEMENT_TYPE, type, key, props, task.debugOwner]; + request = [ + REACT_ELEMENT_TYPE, + type, + key, + props, + task.debugOwner, + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + validated + ]; task = task.implicitSlot && null !== key ? [request] : request; return task; } @@ -1129,7 +1290,9 @@ keyPath, implicitSlot, abortSet, - debugOwner + debugOwner, + debugStack, + debugTask ) { request.pendingChunks++; var id = request.nextChunkId++; @@ -1177,6 +1340,8 @@ }; task.environmentName = request.environmentName(); task.debugOwner = debugOwner; + task.debugStack = debugStack; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -1269,6 +1434,8 @@ null, !1, request.abortableTasks, + null, + null, null ); retryTask(request, value); @@ -1362,6 +1529,8 @@ null, !1, request.abortableTasks, + null, + null, null ), reader = blob.stream().getReader(), @@ -1404,7 +1573,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask )), (value = request.ping), key.then(value, value), @@ -1461,13 +1632,16 @@ _existingReference = value.props; var refProp = _existingReference.ref; task.debugOwner = value._owner; + task.debugStack = value._debugStack; + task.debugTask = value._debugTask; request = renderElement( request, task, value.type, value.key, void 0 !== refProp ? refProp : null, - _existingReference + _existingReference, + value._store.validated ); "object" === typeof request && null !== request && @@ -1846,6 +2020,7 @@ key: componentInfo.key, owner: componentInfo.owner }; + componentDebugInfo.stack = componentInfo.stack; componentDebugInfo.props = componentInfo.props; objectLimit = outlineConsoleValue( request, @@ -1911,25 +2086,34 @@ counter.objectLimit--; switch (value.$$typeof) { case REACT_ELEMENT_TYPE: - return ( - null != value._owner && - outlineComponentInfo(request, value._owner), - "object" === typeof value.type && - null !== value.type && - doNotLimit.add(value.type), - "object" === typeof value.key && - null !== value.key && - doNotLimit.add(value.key), - doNotLimit.add(value.props), - null !== value._owner && doNotLimit.add(value._owner), - [ - REACT_ELEMENT_TYPE, - value.type, - value.key, - value.props, - value._owner - ] - ); + null != value._owner && outlineComponentInfo(request, value._owner); + "object" === typeof value.type && + null !== value.type && + doNotLimit.add(value.type); + "object" === typeof value.key && + null !== value.key && + doNotLimit.add(value.key); + doNotLimit.add(value.props); + null !== value._owner && doNotLimit.add(value._owner); + counter = null; + if (null != value._debugStack) + for ( + counter = filterStackTrace(request, value._debugStack, 1), + doNotLimit.add(counter), + request = 0; + request < counter.length; + request++ + ) + doNotLimit.add(counter[request]); + return [ + REACT_ELEMENT_TYPE, + value.type, + value.key, + value.props, + value._owner, + counter, + value._store.validated + ]; } if ("function" === typeof value.then) { switch (value.status) { @@ -3531,6 +3715,7 @@ throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); + var prefix, suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var callComponent = { "react-stack-bottom-frame": function ( diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js index af07d05872f6de..29a5857daa969f 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js @@ -566,7 +566,59 @@ } } function getCurrentStackInDEV() { - return ""; + var owner = resolveOwner(); + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function defaultErrorHandler(error) { console.error(error); @@ -640,7 +692,7 @@ ? defaultFilterStackFrame : filterStackFrame; this.didWarnForKey = null; - type = createTask(this, model, null, !1, abortSet, null); + type = createTask(this, model, null, !1, abortSet, null, null, null); pingedTasks.push(type); } function noop() {} @@ -659,7 +711,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); (task = thenable._debugInfo) && forwardDebugInfo(request, newTask.id, task); @@ -757,7 +811,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -827,7 +883,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -880,14 +938,21 @@ return lazyType; } function callWithDebugContextInDEV(request, task, callback, arg) { - currentOwner = { + var componentDebugInfo = { name: "", env: task.environmentName, key: null, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); + componentDebugInfo.debugStack = task.debugStack; + request = componentDebugInfo.debugTask = task.debugTask; + currentOwner = componentDebugInfo; try { - return callback(arg); + return request ? request.run(callback.bind(null, arg)) : callback(arg); } finally { currentOwner = null; } @@ -957,7 +1022,14 @@ (multiShot._debugInfo = result._debugInfo), multiShot); } - function renderFunctionComponent(request, task, key, Component, props) { + function renderFunctionComponent( + request, + task, + key, + Component, + props, + validated + ) { var prevThenableState = task.thenableState; task.thenableState = null; if (null === debugID) return outlineTask(request, task); @@ -974,23 +1046,51 @@ key: key, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); componentDebugInfo.props = props; + componentDebugInfo.debugStack = task.debugStack; + componentDebugInfo.debugTask = task.debugTask; outlineComponentInfo(request, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo); task.environmentName = componentEnv; + 2 === validated && + warnForMissingKey(request, key, componentDebugInfo, task.debugTask); } thenableIndexCounter = 0; thenableState = prevThenableState; currentComponentDebugInfo = componentDebugInfo; props = supportsComponentStorage - ? componentStorage.run( - componentDebugInfo, - callComponentInDEV, - Component, - props, - componentDebugInfo - ) - : callComponentInDEV(Component, props, componentDebugInfo); + ? task.debugTask + ? task.debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ) + : task.debugTask + ? task.debugTask.run( + callComponentInDEV.bind( + null, + Component, + props, + componentDebugInfo + ) + ) + : callComponentInDEV(Component, props, componentDebugInfo); if (request.status === ABORTING) throw ( ("object" !== typeof props || @@ -1007,15 +1107,60 @@ props ); Component = task.keyPath; - prevThenableState = task.implicitSlot; + validated = task.implicitSlot; null !== key ? (task.keyPath = null === Component ? key : Component + "," + key) : null === Component && (task.implicitSlot = !0); request = renderModelDestructive(request, task, emptyRoot, "", props); task.keyPath = Component; - task.implicitSlot = prevThenableState; + task.implicitSlot = validated; return request; } + function warnForMissingKey(request, key, componentDebugInfo, debugTask) { + function logKeyError() { + console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + "", + "" + ); + } + key = request.didWarnForKey; + null == key && (key = request.didWarnForKey = new WeakSet()); + request = componentDebugInfo.owner; + if (null != request) { + if (key.has(request)) return; + key.add(request); + } + supportsComponentStorage + ? debugTask + ? debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ) + : debugTask + ? debugTask.run( + callComponentInDEV.bind( + null, + logKeyError, + null, + componentDebugInfo + ) + ) + : callComponentInDEV(logKeyError, null, componentDebugInfo); + } function renderFragment(request, task, children) { for (var i = 0; i < children.length; i++) { var child = children[i]; @@ -1033,7 +1178,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1052,7 +1199,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1066,14 +1215,16 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); retryTask(request, task); return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } - function renderElement(request, task, type, key, ref, props) { + function renderElement(request, task, type, key, ref, props, validated) { if (null !== ref && void 0 !== ref) throw Error( "Refs cannot be used in Server Components, nor passed to Client Components." @@ -1089,7 +1240,22 @@ ) { if (type === REACT_FRAGMENT_TYPE && null === key) return ( - (type = task.implicitSlot), + 2 === validated && + ((validated = { + name: "Fragment", + env: (0, request.environmentName)(), + key: key, + owner: task.debugOwner, + stack: + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + props: props, + debugStack: task.debugStack, + debugTask: task.debugTask + }), + warnForMissingKey(request, key, validated, task.debugTask)), + (validated = task.implicitSlot), null === task.keyPath && (task.implicitSlot = !0), (request = renderModelDestructive( request, @@ -1098,7 +1264,7 @@ "", props.children )), - (task.implicitSlot = type), + (task.implicitSlot = validated), request ); if ( @@ -1110,26 +1276,61 @@ case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); if (request.status === ABORTING) throw null; - return renderElement(request, task, type, key, ref, props); + return renderElement( + request, + task, + type, + key, + ref, + props, + validated + ); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( request, task, key, type.render, - props + props, + validated ); case REACT_MEMO_TYPE: - return renderElement(request, task, type.type, key, ref, props); + return renderElement( + request, + task, + type.type, + key, + ref, + props, + validated + ); case REACT_ELEMENT_TYPE: type._store.validated = 1; } - } else return renderFunctionComponent(request, task, key, type, props); + } else + return renderFunctionComponent( + request, + task, + key, + type, + props, + validated + ); ref = task.keyPath; null === key ? (key = ref) : null !== ref && (key = ref + "," + key); null !== task.debugOwner && outlineComponentInfo(request, task.debugOwner); - request = [REACT_ELEMENT_TYPE, type, key, props, task.debugOwner]; + request = [ + REACT_ELEMENT_TYPE, + type, + key, + props, + task.debugOwner, + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + validated + ]; task = task.implicitSlot && null !== key ? [request] : request; return task; } @@ -1152,7 +1353,9 @@ keyPath, implicitSlot, abortSet, - debugOwner + debugOwner, + debugStack, + debugTask ) { request.pendingChunks++; var id = request.nextChunkId++; @@ -1200,6 +1403,8 @@ }; task.environmentName = request.environmentName(); task.debugOwner = debugOwner; + task.debugStack = debugStack; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -1292,6 +1497,8 @@ null, !1, request.abortableTasks, + null, + null, null ); retryTask(request, value); @@ -1385,6 +1592,8 @@ null, !1, request.abortableTasks, + null, + null, null ), reader = blob.stream().getReader(), @@ -1427,7 +1636,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask )), (value = request.ping), key.then(value, value), @@ -1484,13 +1695,16 @@ _existingReference = value.props; var refProp = _existingReference.ref; task.debugOwner = value._owner; + task.debugStack = value._debugStack; + task.debugTask = value._debugTask; request = renderElement( request, task, value.type, value.key, void 0 !== refProp ? refProp : null, - _existingReference + _existingReference, + value._store.validated ); "object" === typeof request && null !== request && @@ -1880,6 +2094,7 @@ key: componentInfo.key, owner: componentInfo.owner }; + componentDebugInfo.stack = componentInfo.stack; componentDebugInfo.props = componentInfo.props; objectLimit = outlineConsoleValue( request, @@ -1945,25 +2160,34 @@ counter.objectLimit--; switch (value.$$typeof) { case REACT_ELEMENT_TYPE: - return ( - null != value._owner && - outlineComponentInfo(request, value._owner), - "object" === typeof value.type && - null !== value.type && - doNotLimit.add(value.type), - "object" === typeof value.key && - null !== value.key && - doNotLimit.add(value.key), - doNotLimit.add(value.props), - null !== value._owner && doNotLimit.add(value._owner), - [ - REACT_ELEMENT_TYPE, - value.type, - value.key, - value.props, - value._owner - ] - ); + null != value._owner && outlineComponentInfo(request, value._owner); + "object" === typeof value.type && + null !== value.type && + doNotLimit.add(value.type); + "object" === typeof value.key && + null !== value.key && + doNotLimit.add(value.key); + doNotLimit.add(value.props); + null !== value._owner && doNotLimit.add(value._owner); + counter = null; + if (null != value._debugStack) + for ( + counter = filterStackTrace(request, value._debugStack, 1), + doNotLimit.add(counter), + request = 0; + request < counter.length; + request++ + ) + doNotLimit.add(counter[request]); + return [ + REACT_ELEMENT_TYPE, + value.type, + value.key, + value.props, + value._owner, + counter, + value._store.validated + ]; } if ("function" === typeof value.then) { switch (value.status) { @@ -3569,6 +3793,7 @@ throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); + var prefix, suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var callComponent = { "react-stack-bottom-frame": function ( diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js index c36ffb94c97cb2..f36e1363537b5f 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js @@ -590,7 +590,59 @@ } } function getCurrentStackInDEV() { - return ""; + var owner = resolveOwner(); + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function defaultErrorHandler(error) { console.error(error); @@ -664,7 +716,7 @@ ? defaultFilterStackFrame : filterStackFrame; this.didWarnForKey = null; - type = createTask(this, model, null, !1, abortSet, null); + type = createTask(this, model, null, !1, abortSet, null, null, null); pingedTasks.push(type); } function noop() {} @@ -680,7 +732,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); (task = thenable._debugInfo) && forwardDebugInfo(request, newTask.id, task); @@ -778,7 +832,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -848,7 +904,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -900,14 +958,21 @@ return lazyType; } function callWithDebugContextInDEV(request, task, callback, arg) { - currentOwner = { + var componentDebugInfo = { name: "", env: task.environmentName, key: null, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); + componentDebugInfo.debugStack = task.debugStack; + request = componentDebugInfo.debugTask = task.debugTask; + currentOwner = componentDebugInfo; try { - return callback(arg); + return request ? request.run(callback.bind(null, arg)) : callback(arg); } finally { currentOwner = null; } @@ -977,7 +1042,14 @@ (multiShot._debugInfo = result._debugInfo), multiShot); } - function renderFunctionComponent(request, task, key, Component, props) { + function renderFunctionComponent( + request, + task, + key, + Component, + props, + validated + ) { var prevThenableState = task.thenableState; task.thenableState = null; if (null === debugID) return outlineTask(request, task); @@ -994,21 +1066,40 @@ key: key, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); componentDebugInfo.props = props; + componentDebugInfo.debugStack = task.debugStack; + componentDebugInfo.debugTask = task.debugTask; outlineComponentInfo(request, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo); task.environmentName = componentEnv; + 2 === validated && + warnForMissingKey(request, key, componentDebugInfo, task.debugTask); } thenableIndexCounter = 0; thenableState = prevThenableState; currentComponentDebugInfo = componentDebugInfo; - props = componentStorage.run( - componentDebugInfo, - callComponentInDEV, - Component, - props, - componentDebugInfo - ); + props = task.debugTask + ? task.debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ); if (request.status === ABORTING) throw ( ("object" !== typeof props || @@ -1025,15 +1116,49 @@ props ); Component = task.keyPath; - prevThenableState = task.implicitSlot; + validated = task.implicitSlot; null !== key ? (task.keyPath = null === Component ? key : Component + "," + key) : null === Component && (task.implicitSlot = !0); request = renderModelDestructive(request, task, emptyRoot, "", props); task.keyPath = Component; - task.implicitSlot = prevThenableState; + task.implicitSlot = validated; return request; } + function warnForMissingKey(request, key, componentDebugInfo, debugTask) { + function logKeyError() { + console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + "", + "" + ); + } + key = request.didWarnForKey; + null == key && (key = request.didWarnForKey = new WeakSet()); + request = componentDebugInfo.owner; + if (null != request) { + if (key.has(request)) return; + key.add(request); + } + debugTask + ? debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ); + } function renderFragment(request, task, children) { for (var i = 0; i < children.length; i++) { var child = children[i]; @@ -1051,7 +1176,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1070,7 +1197,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1084,14 +1213,16 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); retryTask(request, task); return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } - function renderElement(request, task, type, key, ref, props) { + function renderElement(request, task, type, key, ref, props, validated) { if (null !== ref && void 0 !== ref) throw Error( "Refs cannot be used in Server Components, nor passed to Client Components." @@ -1107,7 +1238,22 @@ ) { if (type === REACT_FRAGMENT_TYPE && null === key) return ( - (type = task.implicitSlot), + 2 === validated && + ((validated = { + name: "Fragment", + env: (0, request.environmentName)(), + key: key, + owner: task.debugOwner, + stack: + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + props: props, + debugStack: task.debugStack, + debugTask: task.debugTask + }), + warnForMissingKey(request, key, validated, task.debugTask)), + (validated = task.implicitSlot), null === task.keyPath && (task.implicitSlot = !0), (request = renderModelDestructive( request, @@ -1116,7 +1262,7 @@ "", props.children )), - (task.implicitSlot = type), + (task.implicitSlot = validated), request ); if ( @@ -1128,26 +1274,61 @@ case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); if (request.status === ABORTING) throw null; - return renderElement(request, task, type, key, ref, props); + return renderElement( + request, + task, + type, + key, + ref, + props, + validated + ); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( request, task, key, type.render, - props + props, + validated ); case REACT_MEMO_TYPE: - return renderElement(request, task, type.type, key, ref, props); + return renderElement( + request, + task, + type.type, + key, + ref, + props, + validated + ); case REACT_ELEMENT_TYPE: type._store.validated = 1; } - } else return renderFunctionComponent(request, task, key, type, props); + } else + return renderFunctionComponent( + request, + task, + key, + type, + props, + validated + ); ref = task.keyPath; null === key ? (key = ref) : null !== ref && (key = ref + "," + key); null !== task.debugOwner && outlineComponentInfo(request, task.debugOwner); - request = [REACT_ELEMENT_TYPE, type, key, props, task.debugOwner]; + request = [ + REACT_ELEMENT_TYPE, + type, + key, + props, + task.debugOwner, + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + validated + ]; task = task.implicitSlot && null !== key ? [request] : request; return task; } @@ -1170,7 +1351,9 @@ keyPath, implicitSlot, abortSet, - debugOwner + debugOwner, + debugStack, + debugTask ) { request.pendingChunks++; var id = request.nextChunkId++; @@ -1218,6 +1401,8 @@ }; task.environmentName = request.environmentName(); task.debugOwner = debugOwner; + task.debugStack = debugStack; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -1308,6 +1493,8 @@ null, !1, request.abortableTasks, + null, + null, null ); retryTask(request, value); @@ -1401,6 +1588,8 @@ null, !1, request.abortableTasks, + null, + null, null ), reader = blob.stream().getReader(), @@ -1443,7 +1632,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask )), (value = request.ping), key.then(value, value), @@ -1500,13 +1691,16 @@ _existingReference = value.props; var refProp = _existingReference.ref; task.debugOwner = value._owner; + task.debugStack = value._debugStack; + task.debugTask = value._debugTask; request = renderElement( request, task, value.type, value.key, void 0 !== refProp ? refProp : null, - _existingReference + _existingReference, + value._store.validated ); "object" === typeof request && null !== request && @@ -1888,6 +2082,7 @@ key: componentInfo.key, owner: componentInfo.owner }; + componentDebugInfo.stack = componentInfo.stack; componentDebugInfo.props = componentInfo.props; objectLimit = outlineConsoleValue( request, @@ -1949,25 +2144,34 @@ counter.objectLimit--; switch (value.$$typeof) { case REACT_ELEMENT_TYPE: - return ( - null != value._owner && - outlineComponentInfo(request, value._owner), - "object" === typeof value.type && - null !== value.type && - doNotLimit.add(value.type), - "object" === typeof value.key && - null !== value.key && - doNotLimit.add(value.key), - doNotLimit.add(value.props), - null !== value._owner && doNotLimit.add(value._owner), - [ - REACT_ELEMENT_TYPE, - value.type, - value.key, - value.props, - value._owner - ] - ); + null != value._owner && outlineComponentInfo(request, value._owner); + "object" === typeof value.type && + null !== value.type && + doNotLimit.add(value.type); + "object" === typeof value.key && + null !== value.key && + doNotLimit.add(value.key); + doNotLimit.add(value.props); + null !== value._owner && doNotLimit.add(value._owner); + counter = null; + if (null != value._debugStack) + for ( + counter = filterStackTrace(request, value._debugStack, 1), + doNotLimit.add(counter), + request = 0; + request < counter.length; + request++ + ) + doNotLimit.add(counter[request]); + return [ + REACT_ELEMENT_TYPE, + value.type, + value.key, + value.props, + value._owner, + counter, + value._store.validated + ]; } if ("function" === typeof value.then) { switch (value.status) { @@ -3586,6 +3790,7 @@ throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); + var prefix, suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var callComponent = { "react-stack-bottom-frame": function ( @@ -3772,12 +3977,12 @@ "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." ); pendingFiles++; - var JSCompiler_object_inline_chunks_143 = []; + var JSCompiler_object_inline_chunks_150 = []; value.on("data", function (chunk) { - JSCompiler_object_inline_chunks_143.push(chunk); + JSCompiler_object_inline_chunks_150.push(chunk); }); value.on("end", function () { - var blob = new Blob(JSCompiler_object_inline_chunks_143, { + var blob = new Blob(JSCompiler_object_inline_chunks_150, { type: mimeType }); response._formData.append(name, blob, filename); diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js index 55aecba15b25a3..9206ec86049fdb 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js @@ -2773,12 +2773,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) { "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." ); pendingFiles++; - var JSCompiler_object_inline_chunks_214 = []; + var JSCompiler_object_inline_chunks_227 = []; value.on("data", function (chunk) { - JSCompiler_object_inline_chunks_214.push(chunk); + JSCompiler_object_inline_chunks_227.push(chunk); }); value.on("end", function () { - var blob = new Blob(JSCompiler_object_inline_chunks_214, { + var blob = new Blob(JSCompiler_object_inline_chunks_227, { type: mimeType }); response._formData.append(name, blob, filename); diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js index d05cceacd06bdd..45f02526d22a1d 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js @@ -590,7 +590,59 @@ } } function getCurrentStackInDEV() { - return ""; + var owner = resolveOwner(); + if (null === owner) return ""; + try { + var info = ""; + if (owner.owner || "string" !== typeof owner.name) { + for (; owner; ) { + var ownerStack = owner.debugStack; + if (null != ownerStack) { + if ((owner = owner.owner)) { + var JSCompiler_temp_const = info; + var error = ownerStack, + prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = prepareStackTrace; + var stack = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + stack.startsWith("Error: react-stack-top-frame\n") && + (stack = stack.slice(29)); + var idx = stack.indexOf("\n"); + -1 !== idx && (stack = stack.slice(idx + 1)); + idx = stack.indexOf("react-stack-bottom-frame"); + -1 !== idx && (idx = stack.lastIndexOf("\n", idx)); + var JSCompiler_inline_result = + -1 !== idx ? (stack = stack.slice(0, idx)) : ""; + info = + JSCompiler_temp_const + ("\n" + JSCompiler_inline_result); + } + } else break; + } + var JSCompiler_inline_result$jscomp$0 = info; + } else { + JSCompiler_temp_const = owner.name; + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + (prefix = + ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) || + ""), + (suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""); + } + JSCompiler_inline_result$jscomp$0 = + "\n" + prefix + JSCompiler_temp_const + suffix; + } + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result$jscomp$0; } function defaultErrorHandler(error) { console.error(error); @@ -664,7 +716,7 @@ ? defaultFilterStackFrame : filterStackFrame; this.didWarnForKey = null; - type = createTask(this, model, null, !1, abortSet, null); + type = createTask(this, model, null, !1, abortSet, null, null, null); pingedTasks.push(type); } function noop() {} @@ -680,7 +732,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); (task = thenable._debugInfo) && forwardDebugInfo(request, newTask.id, task); @@ -778,7 +832,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -848,7 +904,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); request.abortableTasks.delete(streamTask); request.pendingChunks++; @@ -900,14 +958,21 @@ return lazyType; } function callWithDebugContextInDEV(request, task, callback, arg) { - currentOwner = { + var componentDebugInfo = { name: "", env: task.environmentName, key: null, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); + componentDebugInfo.debugStack = task.debugStack; + request = componentDebugInfo.debugTask = task.debugTask; + currentOwner = componentDebugInfo; try { - return callback(arg); + return request ? request.run(callback.bind(null, arg)) : callback(arg); } finally { currentOwner = null; } @@ -977,7 +1042,14 @@ (multiShot._debugInfo = result._debugInfo), multiShot); } - function renderFunctionComponent(request, task, key, Component, props) { + function renderFunctionComponent( + request, + task, + key, + Component, + props, + validated + ) { var prevThenableState = task.thenableState; task.thenableState = null; if (null === debugID) return outlineTask(request, task); @@ -994,21 +1066,40 @@ key: key, owner: task.debugOwner }; + componentDebugInfo.stack = + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1); componentDebugInfo.props = props; + componentDebugInfo.debugStack = task.debugStack; + componentDebugInfo.debugTask = task.debugTask; outlineComponentInfo(request, componentDebugInfo); emitDebugChunk(request, componentDebugID, componentDebugInfo); task.environmentName = componentEnv; + 2 === validated && + warnForMissingKey(request, key, componentDebugInfo, task.debugTask); } thenableIndexCounter = 0; thenableState = prevThenableState; currentComponentDebugInfo = componentDebugInfo; - props = componentStorage.run( - componentDebugInfo, - callComponentInDEV, - Component, - props, - componentDebugInfo - ); + props = task.debugTask + ? task.debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + Component, + props, + componentDebugInfo + ); if (request.status === ABORTING) throw ( ("object" !== typeof props || @@ -1025,15 +1116,49 @@ props ); Component = task.keyPath; - prevThenableState = task.implicitSlot; + validated = task.implicitSlot; null !== key ? (task.keyPath = null === Component ? key : Component + "," + key) : null === Component && (task.implicitSlot = !0); request = renderModelDestructive(request, task, emptyRoot, "", props); task.keyPath = Component; - task.implicitSlot = prevThenableState; + task.implicitSlot = validated; return request; } + function warnForMissingKey(request, key, componentDebugInfo, debugTask) { + function logKeyError() { + console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + "", + "" + ); + } + key = request.didWarnForKey; + null == key && (key = request.didWarnForKey = new WeakSet()); + request = componentDebugInfo.owner; + if (null != request) { + if (key.has(request)) return; + key.add(request); + } + debugTask + ? debugTask.run( + componentStorage.run.bind( + componentStorage, + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ) + ) + : componentStorage.run( + componentDebugInfo, + callComponentInDEV, + logKeyError, + null, + componentDebugInfo + ); + } function renderFragment(request, task, children) { for (var i = 0; i < children.length; i++) { var child = children[i]; @@ -1051,7 +1176,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1070,7 +1197,9 @@ REACT_FRAGMENT_TYPE, task.keyPath, { children: children }, - null + null, + null, + 0 ]), task.implicitSlot ? [request] : request ); @@ -1084,14 +1213,16 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask ); retryTask(request, task); return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } - function renderElement(request, task, type, key, ref, props) { + function renderElement(request, task, type, key, ref, props, validated) { if (null !== ref && void 0 !== ref) throw Error( "Refs cannot be used in Server Components, nor passed to Client Components." @@ -1107,7 +1238,22 @@ ) { if (type === REACT_FRAGMENT_TYPE && null === key) return ( - (type = task.implicitSlot), + 2 === validated && + ((validated = { + name: "Fragment", + env: (0, request.environmentName)(), + key: key, + owner: task.debugOwner, + stack: + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + props: props, + debugStack: task.debugStack, + debugTask: task.debugTask + }), + warnForMissingKey(request, key, validated, task.debugTask)), + (validated = task.implicitSlot), null === task.keyPath && (task.implicitSlot = !0), (request = renderModelDestructive( request, @@ -1116,7 +1262,7 @@ "", props.children )), - (task.implicitSlot = type), + (task.implicitSlot = validated), request ); if ( @@ -1128,26 +1274,61 @@ case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); if (request.status === ABORTING) throw null; - return renderElement(request, task, type, key, ref, props); + return renderElement( + request, + task, + type, + key, + ref, + props, + validated + ); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( request, task, key, type.render, - props + props, + validated ); case REACT_MEMO_TYPE: - return renderElement(request, task, type.type, key, ref, props); + return renderElement( + request, + task, + type.type, + key, + ref, + props, + validated + ); case REACT_ELEMENT_TYPE: type._store.validated = 1; } - } else return renderFunctionComponent(request, task, key, type, props); + } else + return renderFunctionComponent( + request, + task, + key, + type, + props, + validated + ); ref = task.keyPath; null === key ? (key = ref) : null !== ref && (key = ref + "," + key); null !== task.debugOwner && outlineComponentInfo(request, task.debugOwner); - request = [REACT_ELEMENT_TYPE, type, key, props, task.debugOwner]; + request = [ + REACT_ELEMENT_TYPE, + type, + key, + props, + task.debugOwner, + null === task.debugStack + ? null + : filterStackTrace(request, task.debugStack, 1), + validated + ]; task = task.implicitSlot && null !== key ? [request] : request; return task; } @@ -1170,7 +1351,9 @@ keyPath, implicitSlot, abortSet, - debugOwner + debugOwner, + debugStack, + debugTask ) { request.pendingChunks++; var id = request.nextChunkId++; @@ -1218,6 +1401,8 @@ }; task.environmentName = request.environmentName(); task.debugOwner = debugOwner; + task.debugStack = debugStack; + task.debugTask = debugTask; abortSet.add(task); return task; } @@ -1308,6 +1493,8 @@ null, !1, request.abortableTasks, + null, + null, null ); retryTask(request, value); @@ -1401,6 +1588,8 @@ null, !1, request.abortableTasks, + null, + null, null ), reader = blob.stream().getReader(), @@ -1443,7 +1632,9 @@ task.keyPath, task.implicitSlot, request.abortableTasks, - task.debugOwner + task.debugOwner, + task.debugStack, + task.debugTask )), (value = request.ping), key.then(value, value), @@ -1500,13 +1691,16 @@ _existingReference = value.props; var refProp = _existingReference.ref; task.debugOwner = value._owner; + task.debugStack = value._debugStack; + task.debugTask = value._debugTask; request = renderElement( request, task, value.type, value.key, void 0 !== refProp ? refProp : null, - _existingReference + _existingReference, + value._store.validated ); "object" === typeof request && null !== request && @@ -1888,6 +2082,7 @@ key: componentInfo.key, owner: componentInfo.owner }; + componentDebugInfo.stack = componentInfo.stack; componentDebugInfo.props = componentInfo.props; objectLimit = outlineConsoleValue( request, @@ -1949,25 +2144,34 @@ counter.objectLimit--; switch (value.$$typeof) { case REACT_ELEMENT_TYPE: - return ( - null != value._owner && - outlineComponentInfo(request, value._owner), - "object" === typeof value.type && - null !== value.type && - doNotLimit.add(value.type), - "object" === typeof value.key && - null !== value.key && - doNotLimit.add(value.key), - doNotLimit.add(value.props), - null !== value._owner && doNotLimit.add(value._owner), - [ - REACT_ELEMENT_TYPE, - value.type, - value.key, - value.props, - value._owner - ] - ); + null != value._owner && outlineComponentInfo(request, value._owner); + "object" === typeof value.type && + null !== value.type && + doNotLimit.add(value.type); + "object" === typeof value.key && + null !== value.key && + doNotLimit.add(value.key); + doNotLimit.add(value.props); + null !== value._owner && doNotLimit.add(value._owner); + counter = null; + if (null != value._debugStack) + for ( + counter = filterStackTrace(request, value._debugStack, 1), + doNotLimit.add(counter), + request = 0; + request < counter.length; + request++ + ) + doNotLimit.add(counter[request]); + return [ + REACT_ELEMENT_TYPE, + value.type, + value.key, + value.props, + value._owner, + counter, + value._store.validated + ]; } if ("function" === typeof value.then) { switch (value.status) { @@ -3549,6 +3753,7 @@ throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); + var prefix, suffix; new ("function" === typeof WeakMap ? WeakMap : Map)(); var callComponent = { "react-stack-bottom-frame": function ( @@ -3735,12 +3940,12 @@ "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." ); pendingFiles++; - var JSCompiler_object_inline_chunks_143 = []; + var JSCompiler_object_inline_chunks_150 = []; value.on("data", function (chunk) { - JSCompiler_object_inline_chunks_143.push(chunk); + JSCompiler_object_inline_chunks_150.push(chunk); }); value.on("end", function () { - var blob = new Blob(JSCompiler_object_inline_chunks_143, { + var blob = new Blob(JSCompiler_object_inline_chunks_150, { type: mimeType }); response._formData.append(name, blob, filename); diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js index 9dd98c525f7e28..0fb8a0e34ec37b 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js @@ -2739,12 +2739,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) { "React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it." ); pendingFiles++; - var JSCompiler_object_inline_chunks_214 = []; + var JSCompiler_object_inline_chunks_227 = []; value.on("data", function (chunk) { - JSCompiler_object_inline_chunks_214.push(chunk); + JSCompiler_object_inline_chunks_227.push(chunk); }); value.on("end", function () { - var blob = new Blob(JSCompiler_object_inline_chunks_214, { + var blob = new Blob(JSCompiler_object_inline_chunks_227, { type: mimeType }); response._formData.append(name, blob, filename); diff --git a/packages/next/src/compiled/react-server-dom-webpack/package.json b/packages/next/src/compiled/react-server-dom-webpack/package.json index f49aa339085c27..d52663b1da9347 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack/package.json @@ -64,8 +64,8 @@ "webpack-sources": "^3.2.0" }, "peerDependencies": { - "react": "19.1.0-canary-cbbe8666-20250213", - "react-dom": "19.1.0-canary-cbbe8666-20250213", + "react": "19.1.0-canary-32b0cad8-20250213", + "react-dom": "19.1.0-canary-32b0cad8-20250213", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react/cjs/react-jsx-dev-runtime.development.js b/packages/next/src/compiled/react/cjs/react-jsx-dev-runtime.development.js index cf66094f0cadde..051b6b07570098 100644 --- a/packages/next/src/compiled/react/cjs/react-jsx-dev-runtime.development.js +++ b/packages/next/src/compiled/react/cjs/react-jsx-dev-runtime.development.js @@ -14,7 +14,7 @@ function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE$2 + return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; @@ -94,255 +94,20 @@ return testStringCoercion(value); } } - function disabledLog() {} - function disableLogs() { - if (0 === disabledDepth) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: !0, - enumerable: !0, - value: disabledLog, - writable: !0 - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - function reenableLogs() { - disabledDepth--; - if (0 === disabledDepth) { - var props = { configurable: !0, enumerable: !0, writable: !0 }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); - } - 0 > disabledDepth && - console.error( - "disabledDepth fell below zero. This is a bug in React. Please file an issue." - ); - } - function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; - } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (void 0 !== frame) return frame; - reentry = !0; - frame = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = null; - previousDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = null; - disableLogs(); + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; try { - 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$0) { - control = x$0; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (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" } - ); - 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 ( - _RunInRootFrame$Deter = namePropDescriptor = 0; - namePropDescriptor < sampleLines.length && - !sampleLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - for ( - ; - _RunInRootFrame$Deter < controlLines.length && - !controlLines[_RunInRootFrame$Deter].includes( - "DetermineComponentFrameRoot" - ); - - ) - _RunInRootFrame$Deter++; - if ( - namePropDescriptor === sampleLines.length || - _RunInRootFrame$Deter === controlLines.length - ) - for ( - namePropDescriptor = sampleLines.length - 1, - _RunInRootFrame$Deter = controlLines.length - 1; - 1 <= namePropDescriptor && - 0 <= _RunInRootFrame$Deter && - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]; - - ) - _RunInRootFrame$Deter--; - for ( - ; - 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; - namePropDescriptor--, _RunInRootFrame$Deter-- - ) - if ( - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter] - ) { - if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { - do - if ( - (namePropDescriptor--, - _RunInRootFrame$Deter--, - 0 > _RunInRootFrame$Deter || - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]) - ) { - var _frame = - "\n" + - sampleLines[namePropDescriptor].replace( - " at new ", - " at " - ); - fn.displayName && - _frame.includes("") && - (_frame = _frame.replace("", fn.displayName)); - "function" === typeof fn && - componentFrameCache.set(fn, _frame); - return _frame; - } - while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); - } - break; - } - } - } finally { - (reentry = !1), - (ReactSharedInternals.H = previousDispatcher), - reenableLogs(), - (Error.prepareStackTrace = frame); + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; } - sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(sampleLines) - : ""; - "function" === typeof fn && componentFrameCache.set(fn, sampleLines); - return sampleLines; - } - function describeUnknownElementTypeFrameInDEV(type) { - if (null == type) return ""; - if ("function" === typeof type) { - var prototype = type.prototype; - return describeNativeComponentFrame( - type, - !(!prototype || !prototype.isReactComponent) - ); - } - if ("string" === typeof type) return describeBuiltInComponentFrame(type); - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame("SuspenseList"); - } - if ("object" === typeof type) - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeNativeComponentFrame(type.render, !1); - case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type); - case REACT_LAZY_TYPE: - prototype = type._payload; - type = type._init; - try { - return describeUnknownElementTypeFrameInDEV(type(prototype)); - } catch (x) {} - } - return ""; } function getOwner() { var dispatcher = ReactSharedInternals.A; @@ -380,7 +145,16 @@ componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -408,6 +182,18 @@ writable: !0, value: null }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -417,71 +203,26 @@ maybeKey, isStaticChildren, source, - self + self, + debugStack, + debugTask ) { - if ( - "string" === typeof type || - "function" === typeof type || - type === REACT_FRAGMENT_TYPE || - type === REACT_PROFILER_TYPE || - type === REACT_STRICT_MODE_TYPE || - type === REACT_SUSPENSE_TYPE || - type === REACT_SUSPENSE_LIST_TYPE || - type === REACT_OFFSCREEN_TYPE || - ("object" === typeof type && - null !== type && - (type.$$typeof === REACT_LAZY_TYPE || - type.$$typeof === REACT_MEMO_TYPE || - type.$$typeof === REACT_CONTEXT_TYPE || - type.$$typeof === REACT_CONSUMER_TYPE || - type.$$typeof === REACT_FORWARD_REF_TYPE || - type.$$typeof === REACT_CLIENT_REFERENCE$1 || - void 0 !== type.getModuleId)) - ) { - var children = config.children; - if (void 0 !== children) - if (isStaticChildren) - if (isArrayImpl(children)) { - for ( - isStaticChildren = 0; - isStaticChildren < children.length; - isStaticChildren++ - ) - validateChildKeys(children[isStaticChildren], type); - Object.freeze && Object.freeze(children); - } else - console.error( - "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." - ); - else validateChildKeys(children, type); - } else { - children = ""; - if ( - void 0 === type || - ("object" === typeof type && - null !== type && - 0 === Object.keys(type).length) - ) - children += - " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - null === type - ? (isStaticChildren = "null") - : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); - console.error( - "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", - isStaticChildren, - children - ); - } + var children = config.children; + if (void 0 !== children) + if (isStaticChildren) + if (isArrayImpl(children)) { + for ( + isStaticChildren = 0; + isStaticChildren < children.length; + isStaticChildren++ + ) + validateChildKeys(children[isStaticChildren]); + Object.freeze && Object.freeze(children); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else validateChildKeys(children); if (hasOwnProperty.call(config, "key")) { children = getComponentNameFromType(type); var keys = Object.keys(config).filter(function (k) { @@ -520,88 +261,23 @@ ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, children, self, source, getOwner(), maybeKey); - } - function validateChildKeys(node, parentType) { - if ( - "object" === typeof node && - node && - node.$$typeof !== REACT_CLIENT_REFERENCE - ) - if (isArrayImpl(node)) - for (var i = 0; i < node.length; i++) { - var child = node[i]; - isValidElement(child) && validateExplicitKey(child, parentType); - } - else if (isValidElement(node)) - node._store && (node._store.validated = 1); - else if ( - (null === node || "object" !== typeof node - ? (i = null) - : ((i = - (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || - node["@@iterator"]), - (i = "function" === typeof i ? i : null)), - "function" === typeof i && - i !== node.entries && - ((i = i.call(node)), i !== node)) - ) - for (; !(node = i.next()).done; ) - isValidElement(node.value) && - validateExplicitKey(node.value, parentType); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE + return ReactElement( + type, + children, + self, + source, + getOwner(), + maybeKey, + debugStack, + debugTask ); } - function validateExplicitKey(element, parentType) { - if ( - element._store && - !element._store.validated && - null == element.key && - ((element._store.validated = 1), - (parentType = getCurrentComponentErrorInfo(parentType)), - !ownerHasKeyUseWarning[parentType]) - ) { - ownerHasKeyUseWarning[parentType] = !0; - var childOwner = ""; - element && - null != element._owner && - element._owner !== getOwner() && - ((childOwner = null), - "number" === typeof element._owner.tag - ? (childOwner = getComponentNameFromType(element._owner.type)) - : "string" === typeof element._owner.name && - (childOwner = element._owner.name), - (childOwner = " It was passed a child from " + childOwner + ".")); - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = function () { - var stack = describeUnknownElementTypeFrameInDEV(element.type); - prevGetCurrentStack && (stack += prevGetCurrentStack() || ""); - return stack; - }; - console.error( - 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - parentType, - childOwner - ); - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; - } - } - function getCurrentComponentErrorInfo(parentType) { - var info = "", - owner = getOwner(); - owner && - (owner = getComponentNameFromType(owner.type)) && - (info = "\n\nCheck the render method of `" + owner + "`."); - info || - ((parentType = getComponentNameFromType(parentType)) && - (info = - "\n\nCheck the top-level render call using <" + parentType + ">.")); - return info; + function validateChildKeys(node) { + "object" === typeof node && + null !== node && + node.$$typeof === REACT_ELEMENT_TYPE && + node._store && + (node._store.validated = 1); } var React = require("next/dist/compiled/react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), @@ -617,35 +293,20 @@ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, - assign = Object.assign, - REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), - isArrayImpl = Array.isArray, - disabledDepth = 0, - prevLog, - prevInfo, - prevWarn, - prevError, - prevGroup, - prevGroupCollapsed, - prevGroupEnd; - disabledLog.__reactDisabledLog = !0; - var prefix, - suffix, - reentry = !1; - var componentFrameCache = new ( - "function" === typeof WeakMap ? WeakMap : Map - )(); - var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + isArrayImpl = Array.isArray; + new ("function" === typeof WeakMap ? WeakMap : Map)(); + var createTask = console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown; var didWarnAboutElementRef = {}; - var didWarnAboutKeySpread = {}, - ownerHasKeyUseWarning = {}; + var didWarnAboutKeySpread = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsxDEV = function ( type, @@ -655,6 +316,15 @@ source, self ) { - return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; })(); diff --git a/packages/next/src/compiled/react/cjs/react-jsx-dev-runtime.react-server.development.js b/packages/next/src/compiled/react/cjs/react-jsx-dev-runtime.react-server.development.js index 1ee98d74d1741c..c865e638ed3c47 100644 --- a/packages/next/src/compiled/react/cjs/react-jsx-dev-runtime.react-server.development.js +++ b/packages/next/src/compiled/react/cjs/react-jsx-dev-runtime.react-server.development.js @@ -14,7 +14,7 @@ function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE$2 + return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; @@ -94,255 +94,20 @@ return testStringCoercion(value); } } - function disabledLog() {} - function disableLogs() { - if (0 === disabledDepth) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: !0, - enumerable: !0, - value: disabledLog, - writable: !0 - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - function reenableLogs() { - disabledDepth--; - if (0 === disabledDepth) { - var props = { configurable: !0, enumerable: !0, writable: !0 }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); - } - 0 > disabledDepth && - console.error( - "disabledDepth fell below zero. This is a bug in React. Please file an issue." - ); - } - function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; - } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (void 0 !== frame) return frame; - reentry = !0; - frame = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = null; - previousDispatcher = ReactSharedInternalsServer.H; - ReactSharedInternalsServer.H = null; - disableLogs(); + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; try { - 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$0) { - control = x$0; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (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" } - ); - 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 ( - _RunInRootFrame$Deter = namePropDescriptor = 0; - namePropDescriptor < sampleLines.length && - !sampleLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - for ( - ; - _RunInRootFrame$Deter < controlLines.length && - !controlLines[_RunInRootFrame$Deter].includes( - "DetermineComponentFrameRoot" - ); - - ) - _RunInRootFrame$Deter++; - if ( - namePropDescriptor === sampleLines.length || - _RunInRootFrame$Deter === controlLines.length - ) - for ( - namePropDescriptor = sampleLines.length - 1, - _RunInRootFrame$Deter = controlLines.length - 1; - 1 <= namePropDescriptor && - 0 <= _RunInRootFrame$Deter && - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]; - - ) - _RunInRootFrame$Deter--; - for ( - ; - 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; - namePropDescriptor--, _RunInRootFrame$Deter-- - ) - if ( - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter] - ) { - if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { - do - if ( - (namePropDescriptor--, - _RunInRootFrame$Deter--, - 0 > _RunInRootFrame$Deter || - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]) - ) { - var _frame = - "\n" + - sampleLines[namePropDescriptor].replace( - " at new ", - " at " - ); - fn.displayName && - _frame.includes("") && - (_frame = _frame.replace("", fn.displayName)); - "function" === typeof fn && - componentFrameCache.set(fn, _frame); - return _frame; - } - while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); - } - break; - } - } - } finally { - (reentry = !1), - (ReactSharedInternalsServer.H = previousDispatcher), - reenableLogs(), - (Error.prepareStackTrace = frame); + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; } - sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(sampleLines) - : ""; - "function" === typeof fn && componentFrameCache.set(fn, sampleLines); - return sampleLines; - } - function describeUnknownElementTypeFrameInDEV(type) { - if (null == type) return ""; - if ("function" === typeof type) { - var prototype = type.prototype; - return describeNativeComponentFrame( - type, - !(!prototype || !prototype.isReactComponent) - ); - } - if ("string" === typeof type) return describeBuiltInComponentFrame(type); - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame("SuspenseList"); - } - if ("object" === typeof type) - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeNativeComponentFrame(type.render, !1); - case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type); - case REACT_LAZY_TYPE: - prototype = type._payload; - type = type._init; - try { - return describeUnknownElementTypeFrameInDEV(type(prototype)); - } catch (x) {} - } - return ""; } function getOwner() { var dispatcher = ReactSharedInternalsServer.A; @@ -380,7 +145,16 @@ componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -408,6 +182,18 @@ writable: !0, value: null }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -417,71 +203,26 @@ maybeKey, isStaticChildren, source, - self + self, + debugStack, + debugTask ) { - if ( - "string" === typeof type || - "function" === typeof type || - type === REACT_FRAGMENT_TYPE || - type === REACT_PROFILER_TYPE || - type === REACT_STRICT_MODE_TYPE || - type === REACT_SUSPENSE_TYPE || - type === REACT_SUSPENSE_LIST_TYPE || - type === REACT_OFFSCREEN_TYPE || - ("object" === typeof type && - null !== type && - (type.$$typeof === REACT_LAZY_TYPE || - type.$$typeof === REACT_MEMO_TYPE || - type.$$typeof === REACT_CONTEXT_TYPE || - type.$$typeof === REACT_CONSUMER_TYPE || - type.$$typeof === REACT_FORWARD_REF_TYPE || - type.$$typeof === REACT_CLIENT_REFERENCE$1 || - void 0 !== type.getModuleId)) - ) { - var children = config.children; - if (void 0 !== children) - if (isStaticChildren) - if (isArrayImpl(children)) { - for ( - isStaticChildren = 0; - isStaticChildren < children.length; - isStaticChildren++ - ) - validateChildKeys(children[isStaticChildren], type); - Object.freeze && Object.freeze(children); - } else - console.error( - "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." - ); - else validateChildKeys(children, type); - } else { - children = ""; - if ( - void 0 === type || - ("object" === typeof type && - null !== type && - 0 === Object.keys(type).length) - ) - children += - " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - null === type - ? (isStaticChildren = "null") - : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); - console.error( - "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", - isStaticChildren, - children - ); - } + var children = config.children; + if (void 0 !== children) + if (isStaticChildren) + if (isArrayImpl(children)) { + for ( + isStaticChildren = 0; + isStaticChildren < children.length; + isStaticChildren++ + ) + validateChildKeys(children[isStaticChildren]); + Object.freeze && Object.freeze(children); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else validateChildKeys(children); if (hasOwnProperty.call(config, "key")) { children = getComponentNameFromType(type); var keys = Object.keys(config).filter(function (k) { @@ -520,88 +261,23 @@ ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, children, self, source, getOwner(), maybeKey); - } - function validateChildKeys(node, parentType) { - if ( - "object" === typeof node && - node && - node.$$typeof !== REACT_CLIENT_REFERENCE - ) - if (isArrayImpl(node)) - for (var i = 0; i < node.length; i++) { - var child = node[i]; - isValidElement(child) && validateExplicitKey(child, parentType); - } - else if (isValidElement(node)) - node._store && (node._store.validated = 1); - else if ( - (null === node || "object" !== typeof node - ? (i = null) - : ((i = - (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || - node["@@iterator"]), - (i = "function" === typeof i ? i : null)), - "function" === typeof i && - i !== node.entries && - ((i = i.call(node)), i !== node)) - ) - for (; !(node = i.next()).done; ) - isValidElement(node.value) && - validateExplicitKey(node.value, parentType); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE + return ReactElement( + type, + children, + self, + source, + getOwner(), + maybeKey, + debugStack, + debugTask ); } - function validateExplicitKey(element, parentType) { - if ( - element._store && - !element._store.validated && - null == element.key && - ((element._store.validated = 1), - (parentType = getCurrentComponentErrorInfo(parentType)), - !ownerHasKeyUseWarning[parentType]) - ) { - ownerHasKeyUseWarning[parentType] = !0; - var childOwner = ""; - element && - null != element._owner && - element._owner !== getOwner() && - ((childOwner = null), - "number" === typeof element._owner.tag - ? (childOwner = getComponentNameFromType(element._owner.type)) - : "string" === typeof element._owner.name && - (childOwner = element._owner.name), - (childOwner = " It was passed a child from " + childOwner + ".")); - var prevGetCurrentStack = ReactSharedInternalsServer.getCurrentStack; - ReactSharedInternalsServer.getCurrentStack = function () { - var stack = describeUnknownElementTypeFrameInDEV(element.type); - prevGetCurrentStack && (stack += prevGetCurrentStack() || ""); - return stack; - }; - console.error( - 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - parentType, - childOwner - ); - ReactSharedInternalsServer.getCurrentStack = prevGetCurrentStack; - } - } - function getCurrentComponentErrorInfo(parentType) { - var info = "", - owner = getOwner(); - owner && - (owner = getComponentNameFromType(owner.type)) && - (info = "\n\nCheck the render method of `" + owner + "`."); - info || - ((parentType = getComponentNameFromType(parentType)) && - (info = - "\n\nCheck the top-level render call using <" + parentType + ">.")); - return info; + function validateChildKeys(node) { + "object" === typeof node && + null !== node && + node.$$typeof === REACT_ELEMENT_TYPE && + node._store && + (node._store.validated = 1); } var React = require("next/dist/compiled/react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), @@ -617,9 +293,7 @@ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternalsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) @@ -627,32 +301,28 @@ 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); var hasOwnProperty = Object.prototype.hasOwnProperty, - assign = Object.assign, - REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), - isArrayImpl = Array.isArray, - disabledDepth = 0, - prevLog, - prevInfo, - prevWarn, - prevError, - prevGroup, - prevGroupCollapsed, - prevGroupEnd; - disabledLog.__reactDisabledLog = !0; - var prefix, - suffix, - reentry = !1; - var componentFrameCache = new ( - "function" === typeof WeakMap ? WeakMap : Map - )(); - var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + isArrayImpl = Array.isArray; + new ("function" === typeof WeakMap ? WeakMap : Map)(); + var createTask = console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown; var didWarnAboutElementRef = {}; - var didWarnAboutKeySpread = {}, - ownerHasKeyUseWarning = {}; + var didWarnAboutKeySpread = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsx = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !1, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !1, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; exports.jsxDEV = function ( type, @@ -662,9 +332,27 @@ source, self ) { - return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; exports.jsxs = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !0, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !0, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; })(); diff --git a/packages/next/src/compiled/react/cjs/react-jsx-runtime.development.js b/packages/next/src/compiled/react/cjs/react-jsx-runtime.development.js index 06522b5c8b9687..780a9f47b7c058 100644 --- a/packages/next/src/compiled/react/cjs/react-jsx-runtime.development.js +++ b/packages/next/src/compiled/react/cjs/react-jsx-runtime.development.js @@ -14,7 +14,7 @@ function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE$2 + return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; @@ -94,255 +94,20 @@ return testStringCoercion(value); } } - function disabledLog() {} - function disableLogs() { - if (0 === disabledDepth) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: !0, - enumerable: !0, - value: disabledLog, - writable: !0 - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - function reenableLogs() { - disabledDepth--; - if (0 === disabledDepth) { - var props = { configurable: !0, enumerable: !0, writable: !0 }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); - } - 0 > disabledDepth && - console.error( - "disabledDepth fell below zero. This is a bug in React. Please file an issue." - ); - } - function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; - } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (void 0 !== frame) return frame; - reentry = !0; - frame = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = null; - previousDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = null; - disableLogs(); + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; try { - 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$0) { - control = x$0; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (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" } - ); - 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 ( - _RunInRootFrame$Deter = namePropDescriptor = 0; - namePropDescriptor < sampleLines.length && - !sampleLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - for ( - ; - _RunInRootFrame$Deter < controlLines.length && - !controlLines[_RunInRootFrame$Deter].includes( - "DetermineComponentFrameRoot" - ); - - ) - _RunInRootFrame$Deter++; - if ( - namePropDescriptor === sampleLines.length || - _RunInRootFrame$Deter === controlLines.length - ) - for ( - namePropDescriptor = sampleLines.length - 1, - _RunInRootFrame$Deter = controlLines.length - 1; - 1 <= namePropDescriptor && - 0 <= _RunInRootFrame$Deter && - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]; - - ) - _RunInRootFrame$Deter--; - for ( - ; - 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; - namePropDescriptor--, _RunInRootFrame$Deter-- - ) - if ( - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter] - ) { - if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { - do - if ( - (namePropDescriptor--, - _RunInRootFrame$Deter--, - 0 > _RunInRootFrame$Deter || - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]) - ) { - var _frame = - "\n" + - sampleLines[namePropDescriptor].replace( - " at new ", - " at " - ); - fn.displayName && - _frame.includes("") && - (_frame = _frame.replace("", fn.displayName)); - "function" === typeof fn && - componentFrameCache.set(fn, _frame); - return _frame; - } - while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); - } - break; - } - } - } finally { - (reentry = !1), - (ReactSharedInternals.H = previousDispatcher), - reenableLogs(), - (Error.prepareStackTrace = frame); + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; } - sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(sampleLines) - : ""; - "function" === typeof fn && componentFrameCache.set(fn, sampleLines); - return sampleLines; - } - function describeUnknownElementTypeFrameInDEV(type) { - if (null == type) return ""; - if ("function" === typeof type) { - var prototype = type.prototype; - return describeNativeComponentFrame( - type, - !(!prototype || !prototype.isReactComponent) - ); - } - if ("string" === typeof type) return describeBuiltInComponentFrame(type); - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame("SuspenseList"); - } - if ("object" === typeof type) - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeNativeComponentFrame(type.render, !1); - case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type); - case REACT_LAZY_TYPE: - prototype = type._payload; - type = type._init; - try { - return describeUnknownElementTypeFrameInDEV(type(prototype)); - } catch (x) {} - } - return ""; } function getOwner() { var dispatcher = ReactSharedInternals.A; @@ -380,7 +145,16 @@ componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -408,6 +182,18 @@ writable: !0, value: null }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -417,71 +203,26 @@ maybeKey, isStaticChildren, source, - self + self, + debugStack, + debugTask ) { - if ( - "string" === typeof type || - "function" === typeof type || - type === REACT_FRAGMENT_TYPE || - type === REACT_PROFILER_TYPE || - type === REACT_STRICT_MODE_TYPE || - type === REACT_SUSPENSE_TYPE || - type === REACT_SUSPENSE_LIST_TYPE || - type === REACT_OFFSCREEN_TYPE || - ("object" === typeof type && - null !== type && - (type.$$typeof === REACT_LAZY_TYPE || - type.$$typeof === REACT_MEMO_TYPE || - type.$$typeof === REACT_CONTEXT_TYPE || - type.$$typeof === REACT_CONSUMER_TYPE || - type.$$typeof === REACT_FORWARD_REF_TYPE || - type.$$typeof === REACT_CLIENT_REFERENCE$1 || - void 0 !== type.getModuleId)) - ) { - var children = config.children; - if (void 0 !== children) - if (isStaticChildren) - if (isArrayImpl(children)) { - for ( - isStaticChildren = 0; - isStaticChildren < children.length; - isStaticChildren++ - ) - validateChildKeys(children[isStaticChildren], type); - Object.freeze && Object.freeze(children); - } else - console.error( - "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." - ); - else validateChildKeys(children, type); - } else { - children = ""; - if ( - void 0 === type || - ("object" === typeof type && - null !== type && - 0 === Object.keys(type).length) - ) - children += - " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - null === type - ? (isStaticChildren = "null") - : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); - console.error( - "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", - isStaticChildren, - children - ); - } + var children = config.children; + if (void 0 !== children) + if (isStaticChildren) + if (isArrayImpl(children)) { + for ( + isStaticChildren = 0; + isStaticChildren < children.length; + isStaticChildren++ + ) + validateChildKeys(children[isStaticChildren]); + Object.freeze && Object.freeze(children); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else validateChildKeys(children); if (hasOwnProperty.call(config, "key")) { children = getComponentNameFromType(type); var keys = Object.keys(config).filter(function (k) { @@ -520,88 +261,23 @@ ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, children, self, source, getOwner(), maybeKey); - } - function validateChildKeys(node, parentType) { - if ( - "object" === typeof node && - node && - node.$$typeof !== REACT_CLIENT_REFERENCE - ) - if (isArrayImpl(node)) - for (var i = 0; i < node.length; i++) { - var child = node[i]; - isValidElement(child) && validateExplicitKey(child, parentType); - } - else if (isValidElement(node)) - node._store && (node._store.validated = 1); - else if ( - (null === node || "object" !== typeof node - ? (i = null) - : ((i = - (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || - node["@@iterator"]), - (i = "function" === typeof i ? i : null)), - "function" === typeof i && - i !== node.entries && - ((i = i.call(node)), i !== node)) - ) - for (; !(node = i.next()).done; ) - isValidElement(node.value) && - validateExplicitKey(node.value, parentType); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE + return ReactElement( + type, + children, + self, + source, + getOwner(), + maybeKey, + debugStack, + debugTask ); } - function validateExplicitKey(element, parentType) { - if ( - element._store && - !element._store.validated && - null == element.key && - ((element._store.validated = 1), - (parentType = getCurrentComponentErrorInfo(parentType)), - !ownerHasKeyUseWarning[parentType]) - ) { - ownerHasKeyUseWarning[parentType] = !0; - var childOwner = ""; - element && - null != element._owner && - element._owner !== getOwner() && - ((childOwner = null), - "number" === typeof element._owner.tag - ? (childOwner = getComponentNameFromType(element._owner.type)) - : "string" === typeof element._owner.name && - (childOwner = element._owner.name), - (childOwner = " It was passed a child from " + childOwner + ".")); - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = function () { - var stack = describeUnknownElementTypeFrameInDEV(element.type); - prevGetCurrentStack && (stack += prevGetCurrentStack() || ""); - return stack; - }; - console.error( - 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - parentType, - childOwner - ); - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; - } - } - function getCurrentComponentErrorInfo(parentType) { - var info = "", - owner = getOwner(); - owner && - (owner = getComponentNameFromType(owner.type)) && - (info = "\n\nCheck the render method of `" + owner + "`."); - info || - ((parentType = getComponentNameFromType(parentType)) && - (info = - "\n\nCheck the top-level render call using <" + parentType + ">.")); - return info; + function validateChildKeys(node) { + "object" === typeof node && + null !== node && + node.$$typeof === REACT_ELEMENT_TYPE && + node._store && + (node._store.validated = 1); } var React = require("next/dist/compiled/react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), @@ -617,40 +293,43 @@ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, - assign = Object.assign, - REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), - isArrayImpl = Array.isArray, - disabledDepth = 0, - prevLog, - prevInfo, - prevWarn, - prevError, - prevGroup, - prevGroupCollapsed, - prevGroupEnd; - disabledLog.__reactDisabledLog = !0; - var prefix, - suffix, - reentry = !1; - var componentFrameCache = new ( - "function" === typeof WeakMap ? WeakMap : Map - )(); - var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + isArrayImpl = Array.isArray; + new ("function" === typeof WeakMap ? WeakMap : Map)(); + var createTask = console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown; var didWarnAboutElementRef = {}; - var didWarnAboutKeySpread = {}, - ownerHasKeyUseWarning = {}; + var didWarnAboutKeySpread = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsx = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !1, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !1, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; exports.jsxs = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !0, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !0, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; })(); diff --git a/packages/next/src/compiled/react/cjs/react-jsx-runtime.react-server.development.js b/packages/next/src/compiled/react/cjs/react-jsx-runtime.react-server.development.js index bff2f080f0e7be..2da866928d9955 100644 --- a/packages/next/src/compiled/react/cjs/react-jsx-runtime.react-server.development.js +++ b/packages/next/src/compiled/react/cjs/react-jsx-runtime.react-server.development.js @@ -14,7 +14,7 @@ function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE$2 + return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; @@ -94,255 +94,20 @@ return testStringCoercion(value); } } - function disabledLog() {} - function disableLogs() { - if (0 === disabledDepth) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: !0, - enumerable: !0, - value: disabledLog, - writable: !0 - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - function reenableLogs() { - disabledDepth--; - if (0 === disabledDepth) { - var props = { configurable: !0, enumerable: !0, writable: !0 }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); - } - 0 > disabledDepth && - console.error( - "disabledDepth fell below zero. This is a bug in React. Please file an issue." - ); - } - function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; - } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (void 0 !== frame) return frame; - reentry = !0; - frame = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = null; - previousDispatcher = ReactSharedInternalsServer.H; - ReactSharedInternalsServer.H = null; - disableLogs(); + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; try { - 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$0) { - control = x$0; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (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" } - ); - 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 ( - _RunInRootFrame$Deter = namePropDescriptor = 0; - namePropDescriptor < sampleLines.length && - !sampleLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - for ( - ; - _RunInRootFrame$Deter < controlLines.length && - !controlLines[_RunInRootFrame$Deter].includes( - "DetermineComponentFrameRoot" - ); - - ) - _RunInRootFrame$Deter++; - if ( - namePropDescriptor === sampleLines.length || - _RunInRootFrame$Deter === controlLines.length - ) - for ( - namePropDescriptor = sampleLines.length - 1, - _RunInRootFrame$Deter = controlLines.length - 1; - 1 <= namePropDescriptor && - 0 <= _RunInRootFrame$Deter && - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]; - - ) - _RunInRootFrame$Deter--; - for ( - ; - 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; - namePropDescriptor--, _RunInRootFrame$Deter-- - ) - if ( - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter] - ) { - if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { - do - if ( - (namePropDescriptor--, - _RunInRootFrame$Deter--, - 0 > _RunInRootFrame$Deter || - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]) - ) { - var _frame = - "\n" + - sampleLines[namePropDescriptor].replace( - " at new ", - " at " - ); - fn.displayName && - _frame.includes("") && - (_frame = _frame.replace("", fn.displayName)); - "function" === typeof fn && - componentFrameCache.set(fn, _frame); - return _frame; - } - while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); - } - break; - } - } - } finally { - (reentry = !1), - (ReactSharedInternalsServer.H = previousDispatcher), - reenableLogs(), - (Error.prepareStackTrace = frame); + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; } - sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(sampleLines) - : ""; - "function" === typeof fn && componentFrameCache.set(fn, sampleLines); - return sampleLines; - } - function describeUnknownElementTypeFrameInDEV(type) { - if (null == type) return ""; - if ("function" === typeof type) { - var prototype = type.prototype; - return describeNativeComponentFrame( - type, - !(!prototype || !prototype.isReactComponent) - ); - } - if ("string" === typeof type) return describeBuiltInComponentFrame(type); - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame("SuspenseList"); - } - if ("object" === typeof type) - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeNativeComponentFrame(type.render, !1); - case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type); - case REACT_LAZY_TYPE: - prototype = type._payload; - type = type._init; - try { - return describeUnknownElementTypeFrameInDEV(type(prototype)); - } catch (x) {} - } - return ""; } function getOwner() { var dispatcher = ReactSharedInternalsServer.A; @@ -380,7 +145,16 @@ componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -408,6 +182,18 @@ writable: !0, value: null }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -417,71 +203,26 @@ maybeKey, isStaticChildren, source, - self + self, + debugStack, + debugTask ) { - if ( - "string" === typeof type || - "function" === typeof type || - type === REACT_FRAGMENT_TYPE || - type === REACT_PROFILER_TYPE || - type === REACT_STRICT_MODE_TYPE || - type === REACT_SUSPENSE_TYPE || - type === REACT_SUSPENSE_LIST_TYPE || - type === REACT_OFFSCREEN_TYPE || - ("object" === typeof type && - null !== type && - (type.$$typeof === REACT_LAZY_TYPE || - type.$$typeof === REACT_MEMO_TYPE || - type.$$typeof === REACT_CONTEXT_TYPE || - type.$$typeof === REACT_CONSUMER_TYPE || - type.$$typeof === REACT_FORWARD_REF_TYPE || - type.$$typeof === REACT_CLIENT_REFERENCE$1 || - void 0 !== type.getModuleId)) - ) { - var children = config.children; - if (void 0 !== children) - if (isStaticChildren) - if (isArrayImpl(children)) { - for ( - isStaticChildren = 0; - isStaticChildren < children.length; - isStaticChildren++ - ) - validateChildKeys(children[isStaticChildren], type); - Object.freeze && Object.freeze(children); - } else - console.error( - "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." - ); - else validateChildKeys(children, type); - } else { - children = ""; - if ( - void 0 === type || - ("object" === typeof type && - null !== type && - 0 === Object.keys(type).length) - ) - children += - " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - null === type - ? (isStaticChildren = "null") - : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); - console.error( - "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", - isStaticChildren, - children - ); - } + var children = config.children; + if (void 0 !== children) + if (isStaticChildren) + if (isArrayImpl(children)) { + for ( + isStaticChildren = 0; + isStaticChildren < children.length; + isStaticChildren++ + ) + validateChildKeys(children[isStaticChildren]); + Object.freeze && Object.freeze(children); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else validateChildKeys(children); if (hasOwnProperty.call(config, "key")) { children = getComponentNameFromType(type); var keys = Object.keys(config).filter(function (k) { @@ -520,88 +261,23 @@ ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, children, self, source, getOwner(), maybeKey); - } - function validateChildKeys(node, parentType) { - if ( - "object" === typeof node && - node && - node.$$typeof !== REACT_CLIENT_REFERENCE - ) - if (isArrayImpl(node)) - for (var i = 0; i < node.length; i++) { - var child = node[i]; - isValidElement(child) && validateExplicitKey(child, parentType); - } - else if (isValidElement(node)) - node._store && (node._store.validated = 1); - else if ( - (null === node || "object" !== typeof node - ? (i = null) - : ((i = - (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || - node["@@iterator"]), - (i = "function" === typeof i ? i : null)), - "function" === typeof i && - i !== node.entries && - ((i = i.call(node)), i !== node)) - ) - for (; !(node = i.next()).done; ) - isValidElement(node.value) && - validateExplicitKey(node.value, parentType); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE + return ReactElement( + type, + children, + self, + source, + getOwner(), + maybeKey, + debugStack, + debugTask ); } - function validateExplicitKey(element, parentType) { - if ( - element._store && - !element._store.validated && - null == element.key && - ((element._store.validated = 1), - (parentType = getCurrentComponentErrorInfo(parentType)), - !ownerHasKeyUseWarning[parentType]) - ) { - ownerHasKeyUseWarning[parentType] = !0; - var childOwner = ""; - element && - null != element._owner && - element._owner !== getOwner() && - ((childOwner = null), - "number" === typeof element._owner.tag - ? (childOwner = getComponentNameFromType(element._owner.type)) - : "string" === typeof element._owner.name && - (childOwner = element._owner.name), - (childOwner = " It was passed a child from " + childOwner + ".")); - var prevGetCurrentStack = ReactSharedInternalsServer.getCurrentStack; - ReactSharedInternalsServer.getCurrentStack = function () { - var stack = describeUnknownElementTypeFrameInDEV(element.type); - prevGetCurrentStack && (stack += prevGetCurrentStack() || ""); - return stack; - }; - console.error( - 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - parentType, - childOwner - ); - ReactSharedInternalsServer.getCurrentStack = prevGetCurrentStack; - } - } - function getCurrentComponentErrorInfo(parentType) { - var info = "", - owner = getOwner(); - owner && - (owner = getComponentNameFromType(owner.type)) && - (info = "\n\nCheck the render method of `" + owner + "`."); - info || - ((parentType = getComponentNameFromType(parentType)) && - (info = - "\n\nCheck the top-level render call using <" + parentType + ">.")); - return info; + function validateChildKeys(node) { + "object" === typeof node && + null !== node && + node.$$typeof === REACT_ELEMENT_TYPE && + node._store && + (node._store.validated = 1); } var React = require("next/dist/compiled/react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), @@ -617,9 +293,7 @@ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternalsServer = React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) @@ -627,32 +301,28 @@ 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' ); var hasOwnProperty = Object.prototype.hasOwnProperty, - assign = Object.assign, - REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), - isArrayImpl = Array.isArray, - disabledDepth = 0, - prevLog, - prevInfo, - prevWarn, - prevError, - prevGroup, - prevGroupCollapsed, - prevGroupEnd; - disabledLog.__reactDisabledLog = !0; - var prefix, - suffix, - reentry = !1; - var componentFrameCache = new ( - "function" === typeof WeakMap ? WeakMap : Map - )(); - var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + isArrayImpl = Array.isArray; + new ("function" === typeof WeakMap ? WeakMap : Map)(); + var createTask = console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown; var didWarnAboutElementRef = {}; - var didWarnAboutKeySpread = {}, - ownerHasKeyUseWarning = {}; + var didWarnAboutKeySpread = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsx = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !1, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !1, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; exports.jsxDEV = function ( type, @@ -662,9 +332,27 @@ source, self ) { - return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; exports.jsxs = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !0, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !0, + source, + self, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; })(); diff --git a/packages/next/src/compiled/react/cjs/react.development.js b/packages/next/src/compiled/react/cjs/react.development.js index 0f86bb2bfc55b8..b422a625f3c971 100644 --- a/packages/next/src/compiled/react/cjs/react.development.js +++ b/packages/next/src/compiled/react/cjs/react.development.js @@ -87,7 +87,7 @@ function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE$2 + return type.$$typeof === REACT_CLIENT_REFERENCE$1 ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; @@ -140,276 +140,20 @@ } return null; } - function isValidElementType(type) { - return "string" === typeof type || - "function" === typeof type || - type === REACT_FRAGMENT_TYPE || - type === REACT_PROFILER_TYPE || - type === REACT_STRICT_MODE_TYPE || - type === REACT_SUSPENSE_TYPE || - type === REACT_SUSPENSE_LIST_TYPE || - type === REACT_OFFSCREEN_TYPE || - ("object" === typeof type && - null !== type && - (type.$$typeof === REACT_LAZY_TYPE || - type.$$typeof === REACT_MEMO_TYPE || - type.$$typeof === REACT_CONTEXT_TYPE || - type.$$typeof === REACT_CONSUMER_TYPE || - type.$$typeof === REACT_FORWARD_REF_TYPE || - type.$$typeof === REACT_CLIENT_REFERENCE$1 || - void 0 !== type.getModuleId)) - ? !0 - : !1; - } - function disabledLog() {} - function disableLogs() { - if (0 === disabledDepth) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: !0, - enumerable: !0, - value: disabledLog, - writable: !0 - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - function reenableLogs() { - disabledDepth--; - if (0 === disabledDepth) { - var props = { configurable: !0, enumerable: !0, writable: !0 }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); - } - 0 > disabledDepth && - console.error( - "disabledDepth fell below zero. This is a bug in React. Please file an issue." - ); - } - function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; - } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (void 0 !== frame) return frame; - reentry = !0; - frame = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = null; - previousDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = null; - disableLogs(); + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; try { - 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$0) { - control = x$0; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (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" } - ); - 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 ( - _RunInRootFrame$Deter = namePropDescriptor = 0; - namePropDescriptor < sampleLines.length && - !sampleLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - for ( - ; - _RunInRootFrame$Deter < controlLines.length && - !controlLines[_RunInRootFrame$Deter].includes( - "DetermineComponentFrameRoot" - ); - - ) - _RunInRootFrame$Deter++; - if ( - namePropDescriptor === sampleLines.length || - _RunInRootFrame$Deter === controlLines.length - ) - for ( - namePropDescriptor = sampleLines.length - 1, - _RunInRootFrame$Deter = controlLines.length - 1; - 1 <= namePropDescriptor && - 0 <= _RunInRootFrame$Deter && - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]; - - ) - _RunInRootFrame$Deter--; - for ( - ; - 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; - namePropDescriptor--, _RunInRootFrame$Deter-- - ) - if ( - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter] - ) { - if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { - do - if ( - (namePropDescriptor--, - _RunInRootFrame$Deter--, - 0 > _RunInRootFrame$Deter || - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]) - ) { - var _frame = - "\n" + - sampleLines[namePropDescriptor].replace( - " at new ", - " at " - ); - fn.displayName && - _frame.includes("") && - (_frame = _frame.replace("", fn.displayName)); - "function" === typeof fn && - componentFrameCache.set(fn, _frame); - return _frame; - } - while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); - } - break; - } - } - } finally { - (reentry = !1), - (ReactSharedInternals.H = previousDispatcher), - reenableLogs(), - (Error.prepareStackTrace = frame); - } - sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(sampleLines) - : ""; - "function" === typeof fn && componentFrameCache.set(fn, sampleLines); - return sampleLines; - } - function describeUnknownElementTypeFrameInDEV(type) { - if (null == type) return ""; - if ("function" === typeof type) { - var prototype = type.prototype; - return describeNativeComponentFrame( - type, - !(!prototype || !prototype.isReactComponent) - ); - } - if ("string" === typeof type) return describeBuiltInComponentFrame(type); - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame("SuspenseList"); + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; } - if ("object" === typeof type) - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeNativeComponentFrame(type.render, !1); - case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type); - case REACT_LAZY_TYPE: - prototype = type._payload; - type = type._init; - try { - return describeUnknownElementTypeFrameInDEV(type(prototype)); - } catch (x) {} - } - return ""; } function getOwner() { var dispatcher = ReactSharedInternals.A; @@ -447,7 +191,16 @@ componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -475,6 +228,18 @@ writable: !0, value: null }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -485,35 +250,14 @@ void 0, void 0, oldElement._owner, - oldElement.props + oldElement.props, + oldElement._debugStack, + oldElement._debugTask ); oldElement._store && (newKey._store.validated = oldElement._store.validated); return newKey; } - function validateChildKeys(node, parentType) { - if ( - "object" === typeof node && - node && - node.$$typeof !== REACT_CLIENT_REFERENCE - ) - if (isArrayImpl(node)) - for (var i = 0; i < node.length; i++) { - var child = node[i]; - isValidElement(child) && validateExplicitKey(child, parentType); - } - else if (isValidElement(node)) - node._store && (node._store.validated = 1); - else if ( - ((i = getIteratorFn(node)), - "function" === typeof i && - i !== node.entries && - ((i = i.call(node)), i !== node)) - ) - for (; !(node = i.next()).done; ) - isValidElement(node.value) && - validateExplicitKey(node.value, parentType); - } function isValidElement(object) { return ( "object" === typeof object && @@ -521,52 +265,6 @@ object.$$typeof === REACT_ELEMENT_TYPE ); } - function validateExplicitKey(element, parentType) { - if ( - element._store && - !element._store.validated && - null == element.key && - ((element._store.validated = 1), - (parentType = getCurrentComponentErrorInfo(parentType)), - !ownerHasKeyUseWarning[parentType]) - ) { - ownerHasKeyUseWarning[parentType] = !0; - var childOwner = ""; - element && - null != element._owner && - element._owner !== getOwner() && - ((childOwner = null), - "number" === typeof element._owner.tag - ? (childOwner = getComponentNameFromType(element._owner.type)) - : "string" === typeof element._owner.name && - (childOwner = element._owner.name), - (childOwner = " It was passed a child from " + childOwner + ".")); - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = function () { - var stack = describeUnknownElementTypeFrameInDEV(element.type); - prevGetCurrentStack && (stack += prevGetCurrentStack() || ""); - return stack; - }; - console.error( - 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - parentType, - childOwner - ); - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; - } - } - function getCurrentComponentErrorInfo(parentType) { - var info = "", - owner = getOwner(); - owner && - (owner = getComponentNameFromType(owner.type)) && - (info = "\n\nCheck the render method of `" + owner + "`."); - info || - ((parentType = getComponentNameFromType(parentType)) && - (info = - "\n\nCheck the top-level render call using <" + parentType + ">.")); - return info; - } function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; return ( @@ -951,7 +649,7 @@ assign(deprecatedAPIs, Component.prototype); deprecatedAPIs.isPureReactComponent = !0; var isArrayImpl = Array.isArray, - REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"), + REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), ReactSharedInternals = { H: null, A: null, @@ -966,28 +664,17 @@ getCurrentStack: null }, hasOwnProperty = Object.prototype.hasOwnProperty, - REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), - disabledDepth = 0, - prevLog, - prevInfo, - prevWarn, - prevError, - prevGroup, - prevGroupCollapsed, - prevGroupEnd; - disabledLog.__reactDisabledLog = !0; - var prefix, - suffix, - reentry = !1; - var componentFrameCache = new ( - "function" === typeof WeakMap ? WeakMap : Map - )(); - var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + new ("function" === typeof WeakMap ? WeakMap : Map)(); + var createTask = console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown, didWarnAboutOldJSXRuntime; var didWarnAboutElementRef = {}; - var ownerHasKeyUseWarning = {}, - didWarnAboutMaps = !1, + var didWarnAboutMaps = !1, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError @@ -1128,8 +815,8 @@ reject ); }); - } catch (error$2) { - ReactSharedInternals.thrownErrors.push(error$2); + } catch (error$0) { + ReactSharedInternals.thrownErrors.push(error$0); } if (0 < ReactSharedInternals.thrownErrors.length) { var _thrownError = aggregateErrors( @@ -1195,6 +882,10 @@ return fn.apply(null, arguments); }; }; + exports.captureOwnerStack = function () { + var getCurrentStack = ReactSharedInternals.getCurrentStack; + return null === getCurrentStack ? null : getCurrentStack(); + }; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error( @@ -1240,9 +931,19 @@ JSCompiler_inline_result[i] = arguments[i + 2]; props.children = JSCompiler_inline_result; } - props = ReactElement(element.type, key, void 0, void 0, owner, props); + props = ReactElement( + element.type, + key, + void 0, + void 0, + owner, + props, + element._debugStack, + element._debugTask + ); for (key = 2; key < arguments.length; key++) - validateChildKeys(arguments[key], props.type); + (owner = arguments[key]), + isValidElement(owner) && owner._store && (owner._store.validated = 1); return props; }; exports.createContext = function (defaultValue) { @@ -1264,40 +965,13 @@ return defaultValue; }; exports.createElement = function (type, config, children) { - if (isValidElementType(type)) - for (var i = 2; i < arguments.length; i++) - validateChildKeys(arguments[i], type); - else { - i = ""; - if ( - void 0 === type || - ("object" === typeof type && - null !== type && - 0 === Object.keys(type).length) - ) - i += - " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - if (null === type) var typeString = "null"; - else - isArrayImpl(type) - ? (typeString = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((typeString = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (i = - " Did you accidentally export a JSX literal instead of a component?")) - : (typeString = typeof type); - console.error( - "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", - typeString, - i - ); + for (var i = 2; i < arguments.length; i++) { + var node = arguments[i]; + isValidElement(node) && node._store && (node._store.validated = 1); } var propName; i = {}; - typeString = null; + node = null; if (null != config) for (propName in (didWarnAboutOldJSXRuntime || !("__self" in config) || @@ -1307,7 +981,7 @@ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" )), hasValidKey(config) && - (checkKeyStringCoercion(config.key), (typeString = "" + config.key)), + (checkKeyStringCoercion(config.key), (node = "" + config.key)), config)) hasOwnProperty.call(config, propName) && "key" !== propName && @@ -1329,14 +1003,23 @@ if (type && type.defaultProps) for (propName in ((childrenLength = type.defaultProps), childrenLength)) void 0 === i[propName] && (i[propName] = childrenLength[propName]); - typeString && + node && defineKeyPropWarningGetter( i, "function" === typeof type ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, typeString, void 0, void 0, getOwner(), i); + return ReactElement( + type, + node, + void 0, + void 0, + getOwner(), + i, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; exports.createRef = function () { var refObject = { current: null }; @@ -1393,7 +1076,23 @@ }; }; exports.memo = function (type, compare) { - isValidElementType(type) || + "string" === typeof type || + "function" === typeof type || + type === REACT_FRAGMENT_TYPE || + type === REACT_PROFILER_TYPE || + type === REACT_STRICT_MODE_TYPE || + type === REACT_SUSPENSE_TYPE || + type === REACT_SUSPENSE_LIST_TYPE || + type === REACT_OFFSCREEN_TYPE || + ("object" === typeof type && + null !== type && + (type.$$typeof === REACT_LAZY_TYPE || + type.$$typeof === REACT_MEMO_TYPE || + type.$$typeof === REACT_CONTEXT_TYPE || + type.$$typeof === REACT_CONSUMER_TYPE || + type.$$typeof === REACT_FORWARD_REF_TYPE || + type.$$typeof === REACT_CLIENT_REFERENCE || + void 0 !== type.getModuleId)) || console.error( "memo: The first argument must be a component. Instead received: %s", null === type ? "null" : typeof type @@ -1539,7 +1238,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react/cjs/react.production.js b/packages/next/src/compiled/react/cjs/react.production.js index 9bfd45fce843c8..e7d96ae02d1e03 100644 --- a/packages/next/src/compiled/react/cjs/react.production.js +++ b/packages/next/src/compiled/react/cjs/react.production.js @@ -363,9 +363,6 @@ exports.__COMPILER_RUNTIME = { return ReactSharedInternals.H.useMemoCache(size); } }; -exports.act = function () { - throw Error("act(...) is not supported in production builds of React."); -}; exports.cache = function (fn) { return function () { return fn.apply(null, arguments); @@ -546,4 +543,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/react/cjs/react.react-server.development.js b/packages/next/src/compiled/react/cjs/react.react-server.development.js index f0a1f3fd8d5c14..f9668fde4f9ea2 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.development.js @@ -49,7 +49,7 @@ function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE$2 + return type.$$typeof === REACT_CLIENT_REFERENCE$1 ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; @@ -102,276 +102,20 @@ } return null; } - function isValidElementType(type) { - return "string" === typeof type || - "function" === typeof type || - type === REACT_FRAGMENT_TYPE || - type === REACT_PROFILER_TYPE || - type === REACT_STRICT_MODE_TYPE || - type === REACT_SUSPENSE_TYPE || - type === REACT_SUSPENSE_LIST_TYPE || - type === REACT_OFFSCREEN_TYPE || - ("object" === typeof type && - null !== type && - (type.$$typeof === REACT_LAZY_TYPE || - type.$$typeof === REACT_MEMO_TYPE || - type.$$typeof === REACT_CONTEXT_TYPE || - type.$$typeof === REACT_CONSUMER_TYPE || - type.$$typeof === REACT_FORWARD_REF_TYPE || - type.$$typeof === REACT_CLIENT_REFERENCE$1 || - void 0 !== type.getModuleId)) - ? !0 - : !1; - } - function disabledLog() {} - function disableLogs() { - if (0 === disabledDepth) { - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; - var props = { - configurable: !0, - enumerable: !0, - value: disabledLog, - writable: !0 - }; - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - } - disabledDepth++; - } - function reenableLogs() { - disabledDepth--; - if (0 === disabledDepth) { - var props = { configurable: !0, enumerable: !0, writable: !0 }; - Object.defineProperties(console, { - log: assign({}, props, { value: prevLog }), - info: assign({}, props, { value: prevInfo }), - warn: assign({}, props, { value: prevWarn }), - error: assign({}, props, { value: prevError }), - group: assign({}, props, { value: prevGroup }), - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: assign({}, props, { value: prevGroupEnd }) - }); - } - 0 > disabledDepth && - console.error( - "disabledDepth fell below zero. This is a bug in React. Please file an issue." - ); - } - function describeBuiltInComponentFrame(name) { - if (void 0 === prefix) - try { - throw Error(); - } catch (x) { - var match = x.stack.trim().match(/\n( *(at )?)/); - prefix = (match && match[1]) || ""; - suffix = - -1 < x.stack.indexOf("\n at") - ? " ()" - : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; - } - return "\n" + prefix + name + suffix; - } - function describeNativeComponentFrame(fn, construct) { - if (!fn || reentry) return ""; - var frame = componentFrameCache.get(fn); - if (void 0 !== frame) return frame; - reentry = !0; - frame = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var previousDispatcher = null; - previousDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = null; - disableLogs(); + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; try { - 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$0) { - control = x$0; - } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (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" } - ); - 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 ( - _RunInRootFrame$Deter = namePropDescriptor = 0; - namePropDescriptor < sampleLines.length && - !sampleLines[namePropDescriptor].includes( - "DetermineComponentFrameRoot" - ); - - ) - namePropDescriptor++; - for ( - ; - _RunInRootFrame$Deter < controlLines.length && - !controlLines[_RunInRootFrame$Deter].includes( - "DetermineComponentFrameRoot" - ); - - ) - _RunInRootFrame$Deter++; - if ( - namePropDescriptor === sampleLines.length || - _RunInRootFrame$Deter === controlLines.length - ) - for ( - namePropDescriptor = sampleLines.length - 1, - _RunInRootFrame$Deter = controlLines.length - 1; - 1 <= namePropDescriptor && - 0 <= _RunInRootFrame$Deter && - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]; - - ) - _RunInRootFrame$Deter--; - for ( - ; - 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; - namePropDescriptor--, _RunInRootFrame$Deter-- - ) - if ( - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter] - ) { - if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { - do - if ( - (namePropDescriptor--, - _RunInRootFrame$Deter--, - 0 > _RunInRootFrame$Deter || - sampleLines[namePropDescriptor] !== - controlLines[_RunInRootFrame$Deter]) - ) { - var _frame = - "\n" + - sampleLines[namePropDescriptor].replace( - " at new ", - " at " - ); - fn.displayName && - _frame.includes("") && - (_frame = _frame.replace("", fn.displayName)); - "function" === typeof fn && - componentFrameCache.set(fn, _frame); - return _frame; - } - while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); - } - break; - } - } - } finally { - (reentry = !1), - (ReactSharedInternals.H = previousDispatcher), - reenableLogs(), - (Error.prepareStackTrace = frame); + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; } - sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") - ? describeBuiltInComponentFrame(sampleLines) - : ""; - "function" === typeof fn && componentFrameCache.set(fn, sampleLines); - return sampleLines; - } - function describeUnknownElementTypeFrameInDEV(type) { - if (null == type) return ""; - if ("function" === typeof type) { - var prototype = type.prototype; - return describeNativeComponentFrame( - type, - !(!prototype || !prototype.isReactComponent) - ); - } - if ("string" === typeof type) return describeBuiltInComponentFrame(type); - switch (type) { - case REACT_SUSPENSE_TYPE: - return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: - return describeBuiltInComponentFrame("SuspenseList"); - } - if ("object" === typeof type) - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - return describeNativeComponentFrame(type.render, !1); - case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type); - case REACT_LAZY_TYPE: - prototype = type._payload; - type = type._init; - try { - return describeUnknownElementTypeFrameInDEV(type(prototype)); - } catch (x) {} - } - return ""; } function getOwner() { var dispatcher = ReactSharedInternals.A; @@ -409,7 +153,16 @@ componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -437,6 +190,18 @@ writable: !0, value: null }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -447,35 +212,14 @@ void 0, void 0, oldElement._owner, - oldElement.props + oldElement.props, + oldElement._debugStack, + oldElement._debugTask ); oldElement._store && (newKey._store.validated = oldElement._store.validated); return newKey; } - function validateChildKeys(node, parentType) { - if ( - "object" === typeof node && - node && - node.$$typeof !== REACT_CLIENT_REFERENCE - ) - if (isArrayImpl(node)) - for (var i = 0; i < node.length; i++) { - var child = node[i]; - isValidElement(child) && validateExplicitKey(child, parentType); - } - else if (isValidElement(node)) - node._store && (node._store.validated = 1); - else if ( - ((i = getIteratorFn(node)), - "function" === typeof i && - i !== node.entries && - ((i = i.call(node)), i !== node)) - ) - for (; !(node = i.next()).done; ) - isValidElement(node.value) && - validateExplicitKey(node.value, parentType); - } function isValidElement(object) { return ( "object" === typeof object && @@ -483,52 +227,6 @@ object.$$typeof === REACT_ELEMENT_TYPE ); } - function validateExplicitKey(element, parentType) { - if ( - element._store && - !element._store.validated && - null == element.key && - ((element._store.validated = 1), - (parentType = getCurrentComponentErrorInfo(parentType)), - !ownerHasKeyUseWarning[parentType]) - ) { - ownerHasKeyUseWarning[parentType] = !0; - var childOwner = ""; - element && - null != element._owner && - element._owner !== getOwner() && - ((childOwner = null), - "number" === typeof element._owner.tag - ? (childOwner = getComponentNameFromType(element._owner.type)) - : "string" === typeof element._owner.name && - (childOwner = element._owner.name), - (childOwner = " It was passed a child from " + childOwner + ".")); - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = function () { - var stack = describeUnknownElementTypeFrameInDEV(element.type); - prevGetCurrentStack && (stack += prevGetCurrentStack() || ""); - return stack; - }; - console.error( - 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - parentType, - childOwner - ); - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; - } - } - function getCurrentComponentErrorInfo(parentType) { - var info = "", - owner = getOwner(); - owner && - (owner = getComponentNameFromType(owner.type)) && - (info = "\n\nCheck the render method of `" + owner + "`."); - info || - ((parentType = getComponentNameFromType(parentType)) && - (info = - "\n\nCheck the top-level render call using <" + parentType + ">.")); - return info; - } function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; return ( @@ -780,31 +478,20 @@ REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"), + REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), hasOwnProperty = Object.prototype.hasOwnProperty, assign = Object.assign, - REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), - disabledDepth = 0, - prevLog, - prevInfo, - prevWarn, - prevError, - prevGroup, - prevGroupCollapsed, - prevGroupEnd; - disabledLog.__reactDisabledLog = !0; - var prefix, - suffix, - reentry = !1; - var componentFrameCache = new ( - "function" === typeof WeakMap ? WeakMap : Map - )(); - var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); + new ("function" === typeof WeakMap ? WeakMap : Map)(); + var createTask = console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown, didWarnAboutOldJSXRuntime; var didWarnAboutElementRef = {}; - var ownerHasKeyUseWarning = {}, - didWarnAboutMaps = !1, + var didWarnAboutMaps = !1, userProvidedKeyEscapeRegex = /\/+/g; exports.Children = { map: mapChildren, @@ -889,6 +576,10 @@ } }; }; + exports.captureOwnerStack = function () { + var getCurrentStack = ReactSharedInternals.getCurrentStack; + return null === getCurrentStack ? null : getCurrentStack(); + }; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error( @@ -934,46 +625,29 @@ JSCompiler_inline_result[i] = arguments[i + 2]; props.children = JSCompiler_inline_result; } - props = ReactElement(element.type, key, void 0, void 0, owner, props); + props = ReactElement( + element.type, + key, + void 0, + void 0, + owner, + props, + element._debugStack, + element._debugTask + ); for (key = 2; key < arguments.length; key++) - validateChildKeys(arguments[key], props.type); + (owner = arguments[key]), + isValidElement(owner) && owner._store && (owner._store.validated = 1); return props; }; exports.createElement = function (type, config, children) { - if (isValidElementType(type)) - for (var i = 2; i < arguments.length; i++) - validateChildKeys(arguments[i], type); - else { - i = ""; - if ( - void 0 === type || - ("object" === typeof type && - null !== type && - 0 === Object.keys(type).length) - ) - i += - " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; - if (null === type) var typeString = "null"; - else - isArrayImpl(type) - ? (typeString = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((typeString = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (i = - " Did you accidentally export a JSX literal instead of a component?")) - : (typeString = typeof type); - console.error( - "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", - typeString, - i - ); + for (var i = 2; i < arguments.length; i++) { + var node = arguments[i]; + isValidElement(node) && node._store && (node._store.validated = 1); } var propName; i = {}; - typeString = null; + node = null; if (null != config) for (propName in (didWarnAboutOldJSXRuntime || !("__self" in config) || @@ -983,7 +657,7 @@ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" )), hasValidKey(config) && - (checkKeyStringCoercion(config.key), (typeString = "" + config.key)), + (checkKeyStringCoercion(config.key), (node = "" + config.key)), config)) hasOwnProperty.call(config, propName) && "key" !== propName && @@ -1005,14 +679,23 @@ if (type && type.defaultProps) for (propName in ((childrenLength = type.defaultProps), childrenLength)) void 0 === i[propName] && (i[propName] = childrenLength[propName]); - typeString && + node && defineKeyPropWarningGetter( i, "function" === typeof type ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, typeString, void 0, void 0, getOwner(), i); + return ReactElement( + type, + node, + void 0, + void 0, + getOwner(), + i, + Error("react-stack-top-frame"), + createTask(getTaskName(type)) + ); }; exports.createRef = function () { var refObject = { current: null }; @@ -1069,7 +752,23 @@ }; }; exports.memo = function (type, compare) { - isValidElementType(type) || + "string" === typeof type || + "function" === typeof type || + type === REACT_FRAGMENT_TYPE || + type === REACT_PROFILER_TYPE || + type === REACT_STRICT_MODE_TYPE || + type === REACT_SUSPENSE_TYPE || + type === REACT_SUSPENSE_LIST_TYPE || + type === REACT_OFFSCREEN_TYPE || + ("object" === typeof type && + null !== type && + (type.$$typeof === REACT_LAZY_TYPE || + type.$$typeof === REACT_MEMO_TYPE || + type.$$typeof === REACT_CONTEXT_TYPE || + type.$$typeof === REACT_CONSUMER_TYPE || + type.$$typeof === REACT_FORWARD_REF_TYPE || + type.$$typeof === REACT_CLIENT_REFERENCE || + void 0 !== type.getModuleId)) || console.error( "memo: The first argument must be a component. Instead received: %s", null === type ? "null" : typeof type @@ -1111,5 +810,5 @@ exports.useMemo = function (create, deps) { return resolveDispatcher().useMemo(create, deps); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-32b0cad8-20250213"; })(); diff --git a/packages/next/src/compiled/react/cjs/react.react-server.production.js b/packages/next/src/compiled/react/cjs/react.react-server.production.js index 35532471d461f4..6dbb142dfa53e1 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.production.js @@ -340,6 +340,9 @@ exports.cache = function (fn) { } }; }; +exports.captureOwnerStack = function () { + return null; +}; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error(formatProdErrorMessage(267, element)); @@ -423,4 +426,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.1.0-canary-cbbe8666-20250213"; +exports.version = "19.1.0-canary-32b0cad8-20250213"; diff --git a/packages/next/src/compiled/unistore/unistore.js b/packages/next/src/compiled/unistore/unistore.js index be3deb584b62cf..c65026a34ca93d 100644 --- a/packages/next/src/compiled/unistore/unistore.js +++ b/packages/next/src/compiled/unistore/unistore.js @@ -1 +1 @@ -(()=>{var t={793:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a{var t={635:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a = z.lazy(() => .readonly() .optional(), taint: z.boolean().optional(), - reactOwnerStack: z.boolean().optional(), prerenderEarlyExit: z.boolean().optional(), proxyTimeout: z.number().gte(0).optional(), scrollRestoration: z.boolean().optional(), diff --git a/packages/next/src/server/config-shared.ts b/packages/next/src/server/config-shared.ts index e581fa62d0e50c..cd4b158729d65b 100644 --- a/packages/next/src/server/config-shared.ts +++ b/packages/next/src/server/config-shared.ts @@ -472,12 +472,6 @@ export interface ExperimentalConfig { */ taint?: boolean - /** - * Enables leveraging experimental captureOwnerStack API in React, - * to create a better stack trace for React errors. - */ - reactOwnerStack?: boolean - serverActions?: { /** * Allows adjusting body parser size limit for server actions. @@ -1235,7 +1229,6 @@ export const defaultConfig: NextConfig = { process.env.__NEXT_EXPERIMENTAL_PPR === 'true' ), authInterrupts: false, - reactOwnerStack: false, webpackBuildWorker: undefined, webpackMemoryOptimizations: false, optimizeServerReact: true, diff --git a/packages/next/src/server/config.ts b/packages/next/src/server/config.ts index 23c4deb1a2b2b8..973d1637f03afe 100644 --- a/packages/next/src/server/config.ts +++ b/packages/next/src/server/config.ts @@ -921,14 +921,9 @@ function assignDefaults( } // TODO(jiwon): remove once we've made new UI default - // Enable reactOwnerStack when newDevOverlay is enabled to have - // better call stack output in the new UI. if (process.env.__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY === 'false') { result.experimental.newDevOverlay = false } - if (result.experimental.newDevOverlay) { - result.experimental.reactOwnerStack = true - } result.experimental.optimizePackageImports = [ ...new Set([ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3801d8883369fc..83fb53b47d572a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,10 +16,10 @@ overrides: '@types/react': 19.0.8 '@types/react-dom': 19.0.3 jest-snapshot: 30.0.0-alpha.6 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 - react-is: 19.1.0-canary-cbbe8666-20250213 - scheduler: 0.26.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 + scheduler: 0.26.0-canary-32b0cad8-20250213 patchedDependencies: '@storybook/react@8.5.2': @@ -71,7 +71,7 @@ importers: version: 11.11.0 '@emotion/react': specifier: 11.11.1 - version: 11.11.1(@types/react@19.0.8)(react@19.1.0-canary-cbbe8666-20250213) + version: 11.11.1(@types/react@19.0.8)(react@19.1.0-canary-32b0cad8-20250213) '@fullhuman/postcss-purgecss': specifier: 1.3.0 version: 1.3.0 @@ -83,7 +83,7 @@ importers: version: 2.2.1(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) '@mdx-js/react': specifier: 2.2.1 - version: 2.2.1(react@19.1.0-canary-cbbe8666-20250213) + version: 2.2.1(react@19.1.0-canary-32b0cad8-20250213) '@next/bundle-analyzer': specifier: workspace:* version: link:packages/next-bundle-analyzer @@ -143,7 +143,7 @@ importers: version: 6.1.2(@jest/globals@29.7.0)(@types/jest@29.5.5)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(vitest@3.0.4(@types/node@20.17.6)(sass@1.54.0)) '@testing-library/react': specifier: ^15.0.5 - version: 15.0.7(@types/react@19.0.8)(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213) + version: 15.0.7(@types/react@19.0.8)(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213) '@types/busboy': specifier: 1.5.3 version: 1.5.3 @@ -460,44 +460,44 @@ importers: specifier: 0.3.0 version: 0.3.0 react: - specifier: 19.1.0-canary-cbbe8666-20250213 - version: 19.1.0-canary-cbbe8666-20250213 + specifier: 19.1.0-canary-32b0cad8-20250213 + version: 19.1.0-canary-32b0cad8-20250213 react-builtin: - specifier: npm:react@19.1.0-canary-cbbe8666-20250213 - version: react@19.1.0-canary-cbbe8666-20250213 + specifier: npm:react@19.1.0-canary-32b0cad8-20250213 + version: react@19.1.0-canary-32b0cad8-20250213 react-dom: - specifier: 19.1.0-canary-cbbe8666-20250213 - version: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + specifier: 19.1.0-canary-32b0cad8-20250213 + version: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) react-dom-builtin: - specifier: npm:react-dom@19.1.0-canary-cbbe8666-20250213 - version: react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + specifier: npm:react-dom@19.1.0-canary-32b0cad8-20250213 + version: react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) react-dom-experimental-builtin: - specifier: npm:react-dom@0.0.0-experimental-cbbe8666-20250213 - version: react-dom@0.0.0-experimental-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + specifier: npm:react-dom@0.0.0-experimental-32b0cad8-20250213 + version: react-dom@0.0.0-experimental-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) react-experimental-builtin: - specifier: npm:react@0.0.0-experimental-cbbe8666-20250213 - version: react@0.0.0-experimental-cbbe8666-20250213 + specifier: npm:react@0.0.0-experimental-32b0cad8-20250213 + version: react@0.0.0-experimental-32b0cad8-20250213 react-is-builtin: - specifier: npm:react-is@19.1.0-canary-cbbe8666-20250213 - version: react-is@19.1.0-canary-cbbe8666-20250213 + specifier: npm:react-is@19.1.0-canary-32b0cad8-20250213 + version: react-is@19.1.0-canary-32b0cad8-20250213 react-server-dom-turbopack: - specifier: 19.1.0-canary-cbbe8666-20250213 - version: 19.1.0-canary-cbbe8666-20250213(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213) + specifier: 19.1.0-canary-32b0cad8-20250213 + version: 19.1.0-canary-32b0cad8-20250213(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213) react-server-dom-turbopack-experimental: - specifier: npm:react-server-dom-turbopack@0.0.0-experimental-cbbe8666-20250213 - version: react-server-dom-turbopack@0.0.0-experimental-cbbe8666-20250213(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213) + specifier: npm:react-server-dom-turbopack@0.0.0-experimental-32b0cad8-20250213 + version: react-server-dom-turbopack@0.0.0-experimental-32b0cad8-20250213(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213) react-server-dom-webpack: - specifier: 19.1.0-canary-cbbe8666-20250213 - version: 19.1.0-canary-cbbe8666-20250213(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) + specifier: 19.1.0-canary-32b0cad8-20250213 + version: 19.1.0-canary-32b0cad8-20250213(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) react-server-dom-webpack-experimental: - specifier: npm:react-server-dom-webpack@0.0.0-experimental-cbbe8666-20250213 - version: react-server-dom-webpack@0.0.0-experimental-cbbe8666-20250213(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) + specifier: npm:react-server-dom-webpack@0.0.0-experimental-32b0cad8-20250213 + version: react-server-dom-webpack@0.0.0-experimental-32b0cad8-20250213(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) react-ssr-prepass: specifier: 1.0.8 - version: 1.0.8(react-is@19.1.0-canary-ff628334-20250205)(react@19.1.0-canary-cbbe8666-20250213) + version: 1.0.8(react-is@19.1.0-canary-ff628334-20250205)(react@19.1.0-canary-32b0cad8-20250213) react-virtualized: specifier: 9.22.3 - version: 9.22.3(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213) + version: 9.22.3(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213) relay-compiler: specifier: 13.0.2 version: 13.0.2 @@ -520,11 +520,11 @@ importers: specifier: 0.12.1 version: 0.12.1 scheduler-builtin: - specifier: npm:scheduler@0.26.0-canary-cbbe8666-20250213 - version: scheduler@0.26.0-canary-cbbe8666-20250213 + specifier: npm:scheduler@0.26.0-canary-32b0cad8-20250213 + version: scheduler@0.26.0-canary-32b0cad8-20250213 scheduler-experimental-builtin: - specifier: npm:scheduler@0.0.0-experimental-cbbe8666-20250213 - version: scheduler@0.0.0-experimental-cbbe8666-20250213 + specifier: npm:scheduler@0.0.0-experimental-32b0cad8-20250213 + version: scheduler@0.0.0-experimental-32b0cad8-20250213 seedrandom: specifier: 3.0.5 version: 3.0.5 @@ -539,16 +539,16 @@ importers: version: 6.0.0 styled-components: specifier: 6.0.0-rc.3 - version: 6.0.0-rc.3(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213) + version: 6.0.0-rc.3(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213) styled-jsx: specifier: 5.1.6 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-cbbe8666-20250213) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-32b0cad8-20250213) styled-jsx-plugin-postcss: specifier: 3.0.2 version: 3.0.2 swr: specifier: ^2.2.4 - version: 2.2.4(react@19.1.0-canary-cbbe8666-20250213) + version: 2.2.4(react@19.1.0-canary-32b0cad8-20250213) tailwindcss: specifier: 3.2.7 version: 3.2.7(postcss@8.4.31) @@ -875,17 +875,17 @@ importers: specifier: 8.4.31 version: 8.4.31 react: - specifier: 19.1.0-canary-cbbe8666-20250213 - version: 19.1.0-canary-cbbe8666-20250213 + specifier: 19.1.0-canary-32b0cad8-20250213 + version: 19.1.0-canary-32b0cad8-20250213 react-dom: - specifier: 19.1.0-canary-cbbe8666-20250213 - version: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + specifier: 19.1.0-canary-32b0cad8-20250213 + version: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) sass: specifier: ^1.3.0 version: 1.77.8 styled-jsx: specifier: 5.1.6 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-cbbe8666-20250213) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-32b0cad8-20250213) optionalDependencies: sharp: specifier: ^0.33.5 @@ -1016,13 +1016,13 @@ importers: version: 1.0.5(@swc/helpers@0.5.15)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)) '@storybook/blocks': specifier: 8.5.2 - version: 8.5.2(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3)) + version: 8.5.2(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3)) '@storybook/react': specifier: 8.5.2 - version: 8.5.2(patch_hash=3vtnbaj5dhujyrhznezprlo624)(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) + version: 8.5.2(patch_hash=3vtnbaj5dhujyrhznezprlo624)(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) '@storybook/react-webpack5': specifier: 8.5.2 - version: 8.5.2(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) + version: 8.5.2(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) '@storybook/test': specifier: 8.5.2 version: 8.5.2(storybook@8.5.2(prettier@3.3.3)) @@ -1499,7 +1499,7 @@ importers: version: 1.0.35 unistore: specifier: 3.4.1 - version: 3.4.1(react@19.1.0-canary-cbbe8666-20250213) + version: 3.4.1(react@19.1.0-canary-32b0cad8-20250213) util: specifier: 0.12.4 version: 0.12.4 @@ -1657,8 +1657,8 @@ importers: packages/third-parties: dependencies: react: - specifier: 19.1.0-canary-cbbe8666-20250213 - version: 19.1.0-canary-cbbe8666-20250213 + specifier: 19.1.0-canary-32b0cad8-20250213 + version: 19.1.0-canary-32b0cad8-20250213 third-party-capital: specifier: 1.0.20 version: 1.0.20 @@ -1721,14 +1721,14 @@ importers: specifier: 29.5.0 version: 29.5.0 react: - specifier: 19.1.0-canary-cbbe8666-20250213 - version: 19.1.0-canary-cbbe8666-20250213 + specifier: 19.1.0-canary-32b0cad8-20250213 + version: 19.1.0-canary-32b0cad8-20250213 react-test-renderer: specifier: 18.2.0 - version: 18.2.0(react@19.1.0-canary-cbbe8666-20250213) + version: 18.2.0(react@19.1.0-canary-32b0cad8-20250213) styled-jsx: specifier: ^5.1.2 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-cbbe8666-20250213) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-32b0cad8-20250213) turbopack/packages/devlow-bench: dependencies: @@ -3467,7 +3467,7 @@ packages: resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} peerDependencies: '@types/react': '*' - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true @@ -3484,7 +3484,7 @@ packages: '@emotion/use-insertion-effect-with-fallbacks@1.0.1': resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 '@emotion/utils@1.2.1': resolution: {integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==} @@ -3983,14 +3983,14 @@ packages: '@floating-ui/react-dom@2.1.0': resolution: {integrity: sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 '@floating-ui/react@0.26.16': resolution: {integrity: sha512-HEf43zxZNAI/E781QIVpYSF3K2VH4TTYZpqecjdsFkjsaU1EbaWcM++kw0HXFffj7gDUcBFevX8s0rQGQpxkow==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 '@floating-ui/utils@0.2.2': resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} @@ -4654,13 +4654,13 @@ packages: resolution: {integrity: sha512-l9ypojKN3PjwO1CSLIsqxi7mA25+7w+xc71Q+JuCCREI0tuGwkZsKbIOpuTATIJOjPh8ycLiW7QxX1LYsRTq6w==} peerDependencies: '@mantine/hooks': 7.10.1 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 '@mantine/hooks@7.11.2': resolution: {integrity: sha512-jhyVe/sbDEG2U8rr2lMecUPgQxcfr5hh9HazqGfkS7ZRIMDO7uJ947yAcTMGGkp5Lxtt5TBFt1Cb6tiB2/1agg==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 '@mapbox/node-pre-gyp@1.0.5': resolution: {integrity: sha512-4srsKPXWlIxp5Vbqz5uLfBN+du2fJChBoYn/f2h991WLdk7jUvcSk/McVLSv/X+xQIPI8eGD5GjrnygdyHnhPA==} @@ -4677,13 +4677,13 @@ packages: '@mdx-js/react@2.2.1': resolution: {integrity: sha512-YdXcMcEnqZhzql98RNrqYo9cEhTTesBiCclEtoiQUbJwx87q9453GTapYU6kJ8ZZ2ek1Vp25SiAXEFy5O/eAPw==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 '@mdx-js/react@3.1.0': resolution: {integrity: sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==} peerDependencies: '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 '@mswjs/cookies@1.1.0': resolution: {integrity: sha512-0ZcCVQxifZmhwNBoQIrystCb+2sWBY2Zw8lpfJBPCHGCA/HWqehITeCRVIv4VMy8MPlaHo2w2pTHFV2pFfqKPw==} @@ -5274,8 +5274,8 @@ packages: '@storybook/blocks@8.5.2': resolution: {integrity: sha512-C6Bz/YTG5ZuyAzglqgqozYUWaS39j1PnkVuMNots6S3Fp8ZJ6iZOlQ+rpumiuvnbfD5rkEZG+614RWNyNlFy7g==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 storybook: ^8.5.2 peerDependenciesMeta: react: @@ -5325,8 +5325,8 @@ packages: resolution: {integrity: sha512-Nz/UzeYQdUZUhacrPyfkiiysSjydyjgg/p0P9HxB4p/WaJUUjMAcaoaLgy3EXx61zZJ3iD36WPuDkZs5QYrA0A==} engines: {node: '>=14.0.0'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 '@storybook/instrumenter@8.5.2': resolution: {integrity: sha512-BbaUw9GXVzRg3Km95t2mRu4W6C1n1erjzll5maBaVe2+lV9MbCvBcdYwGUgjFNlQ/ETgq6vLfLOEtziycq/B6g==} @@ -5342,8 +5342,8 @@ packages: resolution: {integrity: sha512-CpRunaOl4tB7Z+1dQEG/LSAdwnCZCaKdfn+Q71k6Pk1vpR6aFlhVbbVP5kgt47vimHDKYKYBQKudP+5IjJNvFA==} engines: {node: '>=18.0.0'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 storybook: ^8.5.2 typescript: '*' peerDependenciesMeta: @@ -5364,16 +5364,16 @@ packages: '@storybook/react-dom-shim@8.5.2': resolution: {integrity: sha512-lt7XoaeWI8iPlWnWzIm/Wam9TpRFhlqP0KZJoKwDyHiCByqkeMrw5MJREyWq626nf34bOW8D6vkuyTzCHGTxKg==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 storybook: ^8.5.2 '@storybook/react-webpack5@8.5.2': resolution: {integrity: sha512-OrHaOSaabqOJ3433B0Ea5gVhsR1WaZRs49Y+S/z33VX9iILlougXVx9zNPoeZzgDSG4xEEn2uimFpjjcLLkWzA==} engines: {node: '>=18.0.0'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 storybook: ^8.5.2 typescript: '>= 4.2.x' peerDependenciesMeta: @@ -5385,8 +5385,8 @@ packages: engines: {node: '>=18.0.0'} peerDependencies: '@storybook/test': 8.5.2 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 storybook: ^8.5.2 typescript: '>= 4.2.x' peerDependenciesMeta: @@ -5622,8 +5622,8 @@ packages: engines: {node: '>=18'} peerDependencies: '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true @@ -11528,7 +11528,7 @@ packages: lucide-react@0.383.0: resolution: {integrity: sha512-13xlG0CQCJtzjSQYwwJ3WRqMHtRj3EXmLlorrARt7y+IHnxUCp3XyFNL1DfaGySWxHObDvnu1u1dV+0VMKHUSg==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} @@ -13971,23 +13971,23 @@ packages: resolution: {integrity: sha512-APPU8HB2uZnpl6Vt/+0AFoVYgSRtfiP6FLrZgPPTDmqSb2R4qZRbgd0A3VzIFxDt5e+Fozjx79WjLWnF69DK8g==} engines: {node: '>=16.14.0'} - react-dom@0.0.0-experimental-cbbe8666-20250213: - resolution: {integrity: sha512-Fmbfa98NDXJXef5un3AxtotHBxCbvNLyUmUOdRZdPfuroJQDLkgTTRGqiH7fFo8HOUZHEk9t7swFGfFPPVDz1Q==} + react-dom@0.0.0-experimental-32b0cad8-20250213: + resolution: {integrity: sha512-BtpiRudohNOvKOZocJHkZjK7krvE59lfOkB+vME3j0r5qBKRE+J7iCdS23m0Nqk+iNXQglaTFiT3SJP2eJdUyQ==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 - react-dom@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-pslvPz3DmBQlDzIB5Nrh9XAJaWKN2ootEO1DTF7WN0XzFOfEYaEhNnuM9rBP1GhizAdybB3Uw4+RoWmb0AJ5aA==} + react-dom@19.1.0-canary-32b0cad8-20250213: + resolution: {integrity: sha512-LdQ0E+qfcMwU94J/4I76wIiel71I5pS+McDAFPDLMSz845hX8OckhKF4fTI/tqiIgoyBN9/9fqgGKzeblpri0g==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 react-dom@19.1.0-canary-ff628334-20250205: resolution: {integrity: sha512-O/FFWzQNHqKLavROUliPXDPAwJcjwDcFbZmg2YfsWtSDJj1pRFTNzYvOUChC/hgBQiIM5rAiznQjBw2D9naH1g==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 - react-is@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-exkCIfnr9J9Kf6CnpqjUxA3cd7t7JQvZ3tHqELhxqTlNTFDCgQ7uQz2JFZWB+ozMkrUzVGz4I6+lKrwJypjfHA==} + react-is@19.1.0-canary-32b0cad8-20250213: + resolution: {integrity: sha512-6v4tB1Ae1WYd26o30ao97xH1WqGmGI7oUyXjOjByrRf+H1dfl49Xz/scL/MM4fY0TYkvoP4oRSEzKloMSwe34w==} react-is@19.1.0-canary-ff628334-20250205: resolution: {integrity: sha512-tydzrH7c0S7kxlrN/Si8T4uoOWV3gMtNfTLfW3XubcKNzZwN//JEfzE1fe82nkmw7Gy2wpN6Gg+gMvOpKmiAtw==} @@ -13998,8 +13998,8 @@ packages: react-number-format@5.4.0: resolution: {integrity: sha512-NWdICrqLhI7rAS8yUeLVd6Wr4cN7UjJ9IBTS0f/a9i7UB4x4Ti70kGnksBtZ7o4Z7YRbvCMMR/jQmkoOBa/4fg==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 react-refresh@0.12.0: resolution: {integrity: sha512-suLIhrU2IHKL5JEKR/fAwJv7bbeq4kJ+pJopf77jHwuR+HmJS/HbrPIGsTBUVfw7tXPOmYv7UJ7PCaN49e8x4A==} @@ -14010,7 +14010,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true @@ -14020,58 +14020,58 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true - react-server-dom-turbopack@0.0.0-experimental-cbbe8666-20250213: - resolution: {integrity: sha512-qS7p47SXWIX3xZt+mzcV5YDjI9jbfVtN/eVuIi3VP7NjnyayxxuHjxUHVP3V35z/wJgIwV9CZlUW96PN87N61g==} + react-server-dom-turbopack@0.0.0-experimental-32b0cad8-20250213: + resolution: {integrity: sha512-ZpbXOKT3VL+yJ+cN7+VKhiUZ8J4PGcUoITVGJKm+/7mVVAjg8AcLJqoswwITTicRYVABHOyFc7YUTAQVK+SNUA==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 - react-server-dom-turbopack@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-jbBVeCuQ5lvpPkuLZIqzukxC4Wx2DzxEsxxVuZH1XtPUJtNr1WwmyXO9uNQC1cMmHGEhI1QjDdOX64J+X11eaw==} + react-server-dom-turbopack@19.1.0-canary-32b0cad8-20250213: + resolution: {integrity: sha512-I7SG9NauYJqHa0btAVo88aAZ3UFkkjxUNul38Q4FA4F1skZTuLtH+vjWHarJnxFCJnmP8KRHvwNg+QiQGrEHMw==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 - react-server-dom-webpack@0.0.0-experimental-cbbe8666-20250213: - resolution: {integrity: sha512-VjamR+UgHTgsSRd9oS3AkEXu0loj5GW/0idUIvOwBEbV08ZmbWYz92Y8sKikmYnMjum36guLYsRZQuXn/azrQA==} + react-server-dom-webpack@0.0.0-experimental-32b0cad8-20250213: + resolution: {integrity: sha512-gOj1Lb79UBKX36ZNQGU8v9qeZ6W1nkwU+sGIteGTJLL0SfqWz8fsov0kbTg64V3KV1MYfsYwPu+Pztu6rHNIfA==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 webpack: 5.96.1 - react-server-dom-webpack@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-1CBRY5rEGNjXZf5hlLzS/H1CsI7RkHuGI8qR/JXGBziezFehYC/fug4kJlo81GdvS+iB+0B4jml9dutoKbSc4g==} + react-server-dom-webpack@19.1.0-canary-32b0cad8-20250213: + resolution: {integrity: sha512-pn9NW9+8AcYAU2PwUyrH0QWugMrQVxVZ0LsRg7cVIs8qPcmF4gXWXsn9n++pRjC3cfcNlmT58/c4SKwUfNTK8Q==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 webpack: 5.96.1 react-shallow-renderer@16.15.0: resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 react-ssr-prepass@1.0.8: resolution: {integrity: sha512-O0gfRA1SaK+9ITKxqfnXsej2jF+OHGP/+GxD4unROQaM/0/UczGF9fuF+wTboxaQoKdIf4FvS3h/OigWh704VA==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-is: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 react-style-singleton@2.2.1: resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true @@ -14079,26 +14079,26 @@ packages: react-test-renderer@18.2.0: resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 react-textarea-autosize@8.5.3: resolution: {integrity: sha512-XT1024o2pqCuZSuBt9FwHlaDeNtVrtCXu0Rnz88t1jUGheCLa3PhjE1GH8Ctm2axEtvdCl5SUHYschyQ0L5QHQ==} engines: {node: '>=10'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 react-virtualized@9.22.3: resolution: {integrity: sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 - react@0.0.0-experimental-cbbe8666-20250213: - resolution: {integrity: sha512-ODlwQg48Z/JS9AUli5BtiGeA0QjWL7zNXrODXNa6L0BBwG9+3sgr0mpVNbxgRHOorQLYQ6O00JfBbxxecBLIZg==} + react@0.0.0-experimental-32b0cad8-20250213: + resolution: {integrity: sha512-lC7f8hTMyRz9r4QXYctBoxCuhj5sHuI6dId4wr5Q4zJmww/NUuOaDYqQtVR++qUa9vZJiZ9/G7Rfb97tu5WXOQ==} engines: {node: '>=0.10.0'} - react@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-Bpp/DlY/LSKmC41f24nBfsYRISASvSDwJ4L2kn+aftqX3TKpUGWWUxDQoQYq0OC27zmEjQiUvwaDmTzYgb6wgA==} + react@19.1.0-canary-32b0cad8-20250213: + resolution: {integrity: sha512-Gfrqvqx0z5hOpPc4+OxRwVgm+/BXQ+uQnW5Yidcpa1yCpJmXugX0/IUuCO1yDZAq0x+cuRP7SnwGHxmWRNaGtA==} engines: {node: '>=0.10.0'} react@19.1.0-canary-ff628334-20250205: @@ -14643,11 +14643,11 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - scheduler@0.0.0-experimental-cbbe8666-20250213: - resolution: {integrity: sha512-UALLbqHCpVB2X87c5SFZxRUklAwVuX/dNmNYDvSCepg0qE197cBR6bQlCSklhkhOfTCFQjKFzIVzO+kBYmGIbg==} + scheduler@0.0.0-experimental-32b0cad8-20250213: + resolution: {integrity: sha512-mfHbnQHo+PlqTIgfrQ0m8nRQ2LhY6qeg8xdJfNiEwoevh2A5QwavzmAuMALsrfkIEMNCPVaBHE+nhQZKi+W7Ag==} - scheduler@0.26.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-+qFz4ccaqDv7uKM4QX+KDldGlYaGsnn+tsQf1nTjn45IoP6BaOO/lcFOVeqp4Mi4Iv/9zZExhYBg0775tTIiww==} + scheduler@0.26.0-canary-32b0cad8-20250213: + resolution: {integrity: sha512-KF+7OsPSPifuVSl3nMj6rUBJx+6vvA0JrfXhYmkcF46vhgK78B6xiTU+Bg3mS6ZoA0/yqkylI6IYLBx5yL8olw==} schema-utils@2.7.1: resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} @@ -15243,8 +15243,8 @@ packages: engines: {node: '>= 16'} peerDependencies: babel-plugin-styled-components: '>= 2' - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: babel-plugin-styled-components: optional: true @@ -15258,7 +15258,7 @@ packages: peerDependencies: '@babel/core': '*' babel-plugin-macros: '*' - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@babel/core': optional: true @@ -15342,7 +15342,7 @@ packages: swr@2.2.4: resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 symbol-observable@1.0.1: resolution: {integrity: sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==} @@ -16115,7 +16115,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true @@ -16123,13 +16123,13 @@ packages: use-composed-ref@1.3.0: resolution: {integrity: sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 use-isomorphic-layout-effect@1.1.2: resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==} peerDependencies: '@types/react': '*' - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true @@ -16138,7 +16138,7 @@ packages: resolution: {integrity: sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw==} peerDependencies: '@types/react': '*' - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true @@ -16148,7 +16148,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 peerDependenciesMeta: '@types/react': optional: true @@ -16156,7 +16156,7 @@ packages: use-sync-external-store@1.2.0: resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -18933,17 +18933,17 @@ snapshots: '@emotion/memoize@0.8.1': {} - '@emotion/react@11.11.1(@types/react@19.0.8)(react@19.1.0-canary-cbbe8666-20250213)': + '@emotion/react@11.11.1(@types/react@19.0.8)(react@19.1.0-canary-32b0cad8-20250213)': dependencies: '@babel/runtime': 7.22.5 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.1.0-canary-cbbe8666-20250213) + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.1.0-canary-32b0cad8-20250213) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 hoist-non-react-statics: 3.3.2 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 optionalDependencies: '@types/react': 19.0.8 transitivePeerDependencies: @@ -18961,9 +18961,9 @@ snapshots: '@emotion/unitless@0.8.1': {} - '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.1.0-canary-cbbe8666-20250213)': + '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.1.0-canary-32b0cad8-20250213)': dependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 '@emotion/utils@1.2.1': {} @@ -20484,11 +20484,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@mdx-js/react@2.2.1(react@19.1.0-canary-cbbe8666-20250213)': + '@mdx-js/react@2.2.1(react@19.1.0-canary-32b0cad8-20250213)': dependencies: '@types/mdx': 2.0.3 '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 '@mdx-js/react@2.2.1(react@19.1.0-canary-ff628334-20250205)': dependencies: @@ -20496,11 +20496,11 @@ snapshots: '@types/react': 19.0.8 react: 19.1.0-canary-ff628334-20250205 - '@mdx-js/react@3.1.0(@types/react@19.0.8)(react@19.1.0-canary-cbbe8666-20250213)': + '@mdx-js/react@3.1.0(@types/react@19.0.8)(react@19.1.0-canary-32b0cad8-20250213)': dependencies: '@types/mdx': 2.0.3 '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 '@mswjs/cookies@1.1.0': {} @@ -21145,12 +21145,12 @@ snapshots: '@storybook/addon-docs@8.5.2(@types/react@19.0.8)(storybook@8.5.2(prettier@3.3.3))': dependencies: - '@mdx-js/react': 3.1.0(@types/react@19.0.8)(react@19.1.0-canary-cbbe8666-20250213) - '@storybook/blocks': 8.5.2(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3)) + '@mdx-js/react': 3.1.0(@types/react@19.0.8)(react@19.1.0-canary-32b0cad8-20250213) + '@storybook/blocks': 8.5.2(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3)) '@storybook/csf-plugin': 8.5.2(storybook@8.5.2(prettier@3.3.3)) - '@storybook/react-dom-shim': 8.5.2(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3)) - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + '@storybook/react-dom-shim': 8.5.2(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3)) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) storybook: 8.5.2(prettier@3.3.3) ts-dedent: 2.2.0 transitivePeerDependencies: @@ -21215,15 +21215,15 @@ snapshots: - '@swc/helpers' - webpack - '@storybook/blocks@8.5.2(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))': + '@storybook/blocks@8.5.2(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))': dependencies: '@storybook/csf': 0.1.12 - '@storybook/icons': 1.3.0(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213) + '@storybook/icons': 1.3.0(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213) storybook: 8.5.2(prettier@3.3.3) ts-dedent: 2.2.0 optionalDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) '@storybook/builder-webpack5@8.5.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2)': dependencies: @@ -21301,10 +21301,10 @@ snapshots: '@storybook/global@5.0.0': {} - '@storybook/icons@1.3.0(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)': + '@storybook/icons@1.3.0(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)': dependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) '@storybook/instrumenter@8.5.2(storybook@8.5.2(prettier@3.3.3))': dependencies: @@ -21316,17 +21316,17 @@ snapshots: dependencies: storybook: 8.5.2(prettier@3.3.3) - '@storybook/preset-react-webpack@8.5.2(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2)': + '@storybook/preset-react-webpack@8.5.2(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2)': dependencies: '@storybook/core-webpack': 8.5.2(storybook@8.5.2(prettier@3.3.3)) - '@storybook/react': 8.5.2(patch_hash=3vtnbaj5dhujyrhznezprlo624)(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) + '@storybook/react': 8.5.2(patch_hash=3vtnbaj5dhujyrhznezprlo624)(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) '@storybook/react-docgen-typescript-plugin': 1.0.6--canary.9.0c3f3b7.0(typescript@5.7.2)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)) '@types/semver': 7.5.6 find-up: 5.0.0 magic-string: 0.30.17 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 react-docgen: 7.1.0 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) resolve: 1.22.8 semver: 7.6.3 storybook: 8.5.2(prettier@3.3.3) @@ -21360,19 +21360,19 @@ snapshots: transitivePeerDependencies: - supports-color - '@storybook/react-dom-shim@8.5.2(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))': + '@storybook/react-dom-shim@8.5.2(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))': dependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) storybook: 8.5.2(prettier@3.3.3) - '@storybook/react-webpack5@8.5.2(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2)': + '@storybook/react-webpack5@8.5.2(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2)': dependencies: '@storybook/builder-webpack5': 8.5.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) - '@storybook/preset-react-webpack': 8.5.2(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) - '@storybook/react': 8.5.2(patch_hash=3vtnbaj5dhujyrhznezprlo624)(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + '@storybook/preset-react-webpack': 8.5.2(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2)(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) + '@storybook/react': 8.5.2(patch_hash=3vtnbaj5dhujyrhznezprlo624)(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) storybook: 8.5.2(prettier@3.3.3) optionalDependencies: typescript: 5.7.2 @@ -21385,16 +21385,16 @@ snapshots: - uglify-js - webpack-cli - '@storybook/react@8.5.2(patch_hash=3vtnbaj5dhujyrhznezprlo624)(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2)': + '@storybook/react@8.5.2(patch_hash=3vtnbaj5dhujyrhznezprlo624)(@storybook/test@8.5.2(storybook@8.5.2(prettier@3.3.3)))(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2)': dependencies: '@storybook/components': 8.5.2(storybook@8.5.2(prettier@3.3.3)) '@storybook/global': 5.0.0 '@storybook/manager-api': 8.5.2(storybook@8.5.2(prettier@3.3.3)) '@storybook/preview-api': 8.5.2(storybook@8.5.2(prettier@3.3.3)) - '@storybook/react-dom-shim': 8.5.2(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(storybook@8.5.2(prettier@3.3.3)) + '@storybook/react-dom-shim': 8.5.2(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(storybook@8.5.2(prettier@3.3.3)) '@storybook/theming': 8.5.2(storybook@8.5.2(prettier@3.3.3)) - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) storybook: 8.5.2(prettier@3.3.3) optionalDependencies: '@storybook/test': 8.5.2(storybook@8.5.2(prettier@3.3.3)) @@ -21669,13 +21669,13 @@ snapshots: lodash: 4.17.21 redent: 3.0.0 - '@testing-library/react@15.0.7(@types/react@19.0.8)(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)': + '@testing-library/react@15.0.7(@types/react@19.0.8)(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)': dependencies: '@babel/runtime': 7.22.5 '@testing-library/dom': 10.1.0 '@types/react-dom': 19.0.3(@types/react@19.0.8) - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) optionalDependencies: '@types/react': 19.0.8 @@ -27186,7 +27186,7 @@ snapshots: hoist-non-react-statics@3.3.2: dependencies: - react-is: 19.1.0-canary-cbbe8666-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 homedir-polyfill@1.0.3: dependencies: @@ -31977,25 +31977,25 @@ snapshots: dependencies: ansi-regex: 5.0.1 ansi-styles: 5.2.0 - react-is: 19.1.0-canary-cbbe8666-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 pretty-format@29.5.0: dependencies: '@jest/schemas': 29.4.3 ansi-styles: 5.2.0 - react-is: 19.1.0-canary-cbbe8666-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 - react-is: 19.1.0-canary-cbbe8666-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 pretty-format@30.0.0-alpha.6: dependencies: '@jest/schemas': 30.0.0-alpha.6 ansi-styles: 5.2.0 - react-is: 19.1.0-canary-cbbe8666-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 pretty-ms@7.0.0: dependencies: @@ -32058,7 +32058,7 @@ snapshots: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react-is: 19.1.0-canary-cbbe8666-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 property-information@5.6.0: dependencies: @@ -32249,22 +32249,22 @@ snapshots: transitivePeerDependencies: - supports-color - react-dom@0.0.0-experimental-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213): + react-dom@0.0.0-experimental-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213): dependencies: - react: 19.1.0-canary-cbbe8666-20250213 - scheduler: 0.26.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + scheduler: 0.26.0-canary-32b0cad8-20250213 - react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213): + react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213): dependencies: - react: 19.1.0-canary-cbbe8666-20250213 - scheduler: 0.26.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + scheduler: 0.26.0-canary-32b0cad8-20250213 react-dom@19.1.0-canary-ff628334-20250205(react@19.1.0-canary-ff628334-20250205): dependencies: react: 19.1.0-canary-ff628334-20250205 - scheduler: 0.26.0-canary-cbbe8666-20250213 + scheduler: 0.26.0-canary-32b0cad8-20250213 - react-is@19.1.0-canary-cbbe8666-20250213: {} + react-is@19.1.0-canary-32b0cad8-20250213: {} react-is@19.1.0-canary-ff628334-20250205: {} @@ -32297,48 +32297,48 @@ snapshots: optionalDependencies: '@types/react': 19.0.8 - react-server-dom-turbopack@0.0.0-experimental-cbbe8666-20250213(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213): + react-server-dom-turbopack@0.0.0-experimental-32b0cad8-20250213(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) - react-server-dom-turbopack@19.1.0-canary-cbbe8666-20250213(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213): + react-server-dom-turbopack@19.1.0-canary-32b0cad8-20250213(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) - react-server-dom-webpack@0.0.0-experimental-cbbe8666-20250213(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))): + react-server-dom-webpack@0.0.0-experimental-32b0cad8-20250213(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) webpack: 5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-server-dom-webpack@19.1.0-canary-cbbe8666-20250213(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))): + react-server-dom-webpack@19.1.0-canary-32b0cad8-20250213(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) webpack: 5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-shallow-renderer@16.15.0(react@19.1.0-canary-cbbe8666-20250213): + react-shallow-renderer@16.15.0(react@19.1.0-canary-32b0cad8-20250213): dependencies: object-assign: 4.1.1 - react: 19.1.0-canary-cbbe8666-20250213 - react-is: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 - react-ssr-prepass@1.0.8(react-is@19.1.0-canary-ff628334-20250205)(react@19.1.0-canary-cbbe8666-20250213): + react-ssr-prepass@1.0.8(react-is@19.1.0-canary-ff628334-20250205)(react@19.1.0-canary-32b0cad8-20250213): dependencies: object-is: 1.0.2 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 react-is: 19.1.0-canary-ff628334-20250205 react-style-singleton@2.2.1(@types/react@19.0.8)(react@19.1.0-canary-ff628334-20250205): @@ -32350,12 +32350,12 @@ snapshots: optionalDependencies: '@types/react': 19.0.8 - react-test-renderer@18.2.0(react@19.1.0-canary-cbbe8666-20250213): + react-test-renderer@18.2.0(react@19.1.0-canary-32b0cad8-20250213): dependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-is: 19.1.0-canary-cbbe8666-20250213 - react-shallow-renderer: 16.15.0(react@19.1.0-canary-cbbe8666-20250213) - scheduler: 0.26.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 + react-is: 19.1.0-canary-32b0cad8-20250213 + react-shallow-renderer: 16.15.0(react@19.1.0-canary-32b0cad8-20250213) + scheduler: 0.26.0-canary-32b0cad8-20250213 react-textarea-autosize@8.5.3(@types/react@19.0.8)(react@19.1.0-canary-ff628334-20250205): dependencies: @@ -32366,20 +32366,20 @@ snapshots: transitivePeerDependencies: - '@types/react' - react-virtualized@9.22.3(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213): + react-virtualized@9.22.3(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213): dependencies: '@babel/runtime': 7.22.5 clsx: 1.1.1 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) react-lifecycles-compat: 3.0.4 - react@0.0.0-experimental-cbbe8666-20250213: {} + react@0.0.0-experimental-32b0cad8-20250213: {} - react@19.1.0-canary-cbbe8666-20250213: {} + react@19.1.0-canary-32b0cad8-20250213: {} react@19.1.0-canary-ff628334-20250205: {} @@ -33135,9 +33135,9 @@ snapshots: dependencies: xmlchars: 2.2.0 - scheduler@0.0.0-experimental-cbbe8666-20250213: {} + scheduler@0.0.0-experimental-32b0cad8-20250213: {} - scheduler@0.26.0-canary-cbbe8666-20250213: {} + scheduler@0.26.0-canary-32b0cad8-20250213: {} schema-utils@2.7.1: dependencies: @@ -33806,7 +33806,7 @@ snapshots: dependencies: inline-style-parser: 0.1.1 - styled-components@6.0.0-rc.3(react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213))(react@19.1.0-canary-cbbe8666-20250213): + styled-components@6.0.0-rc.3(react-dom@19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213))(react@19.1.0-canary-32b0cad8-20250213): dependencies: '@babel/cli': 7.21.5(@babel/core@7.22.5) '@babel/core': 7.22.5 @@ -33821,8 +33821,8 @@ snapshots: '@emotion/unitless': 0.8.1 css-to-react-native: 3.2.0 postcss: 8.4.31 - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + react-dom: 19.1.0-canary-32b0cad8-20250213(react@19.1.0-canary-32b0cad8-20250213) shallowequal: 1.1.0 stylis: 4.2.0 tslib: 2.5.3 @@ -33834,10 +33834,10 @@ snapshots: postcss: 7.0.32 postcss-load-plugins: 2.3.0 - styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-cbbe8666-20250213): + styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-32b0cad8-20250213): dependencies: client-only: 0.0.1 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 optionalDependencies: '@babel/core': 7.22.5 babel-plugin-macros: 3.1.0 @@ -33933,11 +33933,11 @@ snapshots: '@swc/counter': 0.1.3 webpack: 5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.2) - swr@2.2.4(react@19.1.0-canary-cbbe8666-20250213): + swr@2.2.4(react@19.1.0-canary-32b0cad8-20250213): dependencies: client-only: 0.0.1 - react: 19.1.0-canary-cbbe8666-20250213 - use-sync-external-store: 1.2.0(react@19.1.0-canary-cbbe8666-20250213) + react: 19.1.0-canary-32b0cad8-20250213 + use-sync-external-store: 1.2.0(react@19.1.0-canary-32b0cad8-20250213) symbol-observable@1.0.1: {} @@ -34713,9 +34713,9 @@ snapshots: unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 - unistore@3.4.1(react@19.1.0-canary-cbbe8666-20250213): + unistore@3.4.1(react@19.1.0-canary-32b0cad8-20250213): optionalDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 universal-github-app-jwt@1.1.1: dependencies: @@ -34841,9 +34841,9 @@ snapshots: optionalDependencies: '@types/react': 19.0.8 - use-sync-external-store@1.2.0(react@19.1.0-canary-cbbe8666-20250213): + use-sync-external-store@1.2.0(react@19.1.0-canary-32b0cad8-20250213): dependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-32b0cad8-20250213 util-deprecate@1.0.2: {} diff --git a/test/development/acceptance-app/hydration-error.test.ts b/test/development/acceptance-app/hydration-error.test.ts index e33577f7d872b5..3144834169c82f 100644 --- a/test/development/acceptance-app/hydration-error.test.ts +++ b/test/development/acceptance-app/hydration-error.test.ts @@ -5,12 +5,6 @@ import path from 'path' import { outdent } from 'outdent' import { getRedboxTotalErrorCount, retry } from 'next-test-utils' -// https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js used as a reference - -const enableOwnerStacks = - process.env.__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY === 'true' || - process.env.__NEXT_EXPERIMENTAL_PPR === 'true' - describe('Error overlay for hydration errors in App router', () => { const { next, isTurbopack } = nextTestSetup({ files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), @@ -800,10 +794,7 @@ describe('Error overlay for hydration errors in App router', () => { await session.openRedbox() await retry(async () => { - expect(await getRedboxTotalErrorCount(browser)).toBe( - // With owner stacks, we also get an error for the parent context - enableOwnerStacks ? 3 : 2 - ) + expect(await getRedboxTotalErrorCount(browser)).toBe(3) }) const description = await session.getRedboxDescription() @@ -874,10 +865,7 @@ describe('Error overlay for hydration errors in App router', () => { await retry(async () => { expect(await getRedboxTotalErrorCount(browser)).toBe( // One error for "Cannot render a sync or defer