diff --git a/package.json b/package.json index dea3c69518fc6..67c2c98821e93 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-e670e72f-20250214", "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-e670e72f-20250214", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-e670e72f-20250214", + "react-experimental-builtin": "npm:react@0.0.0-experimental-e670e72f-20250214", + "react-is-builtin": "npm:react-is@19.1.0-canary-e670e72f-20250214", + "react-server-dom-turbopack": "19.1.0-canary-e670e72f-20250214", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-e670e72f-20250214", + "react-server-dom-webpack": "19.1.0-canary-e670e72f-20250214", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-e670e72f-20250214", "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-e670e72f-20250214", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-e670e72f-20250214", "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-e670e72f-20250214", + "react-dom": "19.1.0-canary-e670e72f-20250214", + "react-is": "19.1.0-canary-e670e72f-20250214", + "scheduler": "0.26.0-canary-e670e72f-20250214" }, "patchedDependencies": { "webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch", 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 7d4576385bcd6..dda30019a2010 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 @@ -582,6 +582,7 @@ case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -596,7 +597,7 @@ case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -658,7 +659,7 @@ ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -676,10 +677,10 @@ case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -719,7 +720,7 @@ function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -795,7 +796,7 @@ root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -818,7 +819,6 @@ case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -837,7 +837,7 @@ case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -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": @@ -3770,6 +3773,11 @@ enqueueUpdate$1(fiber, null, null, lane); return getRootForUpdatedFiber(fiber); } + function enqueueGestureRender(fiber) { + fiber = markUpdateLaneFromFiberToRoot(fiber, null, 64); + null !== fiber && markRootUpdated$1(fiber, 64); + return fiber; + } function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { sourceFiber.lanes |= lane; var alternate = sourceFiber.alternate; @@ -3785,17 +3793,19 @@ (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (nestedUpdateCount > NESTED_UPDATE_LIMIT) @@ -3961,7 +3971,7 @@ (blockingEventTime = lane), (blockingEventType = JSCompiler_temp)); else if ( - 0 !== (lane & 4194176) && + 0 !== (lane & 4194048) && 0 > transitionUpdateTime && ((transitionUpdateTime = now()), 0 > transitionStartTime) ) { @@ -4054,9 +4064,9 @@ } function setCurrentTrackFromLanes(lanes) { reusableLaneDevToolDetails.track = - lanes & 63 + lanes & 127 ? "Blocking" - : lanes & 4194240 + : lanes & 4194176 ? "Transition" : lanes & 62914560 ? "Suspense" @@ -4173,13 +4183,13 @@ function logRenderPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure( (lanes & 536870912) === lanes ? "Prepared" - : (lanes & 201326677) === lanes + : (lanes & 201326741) === lanes ? "Hydrated" : "Render", reusableLaneOptions @@ -4188,7 +4198,7 @@ function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); @@ -4196,7 +4206,7 @@ function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -4616,7 +4626,7 @@ } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5211,6 +5221,28 @@ ? null : { parent: CacheContext._currentValue, pool: cacheFromPool }; } + function scheduleGesture(root, provider) { + for (var prev = root.gestures; null !== prev; ) { + if (prev.provider === provider) return prev.count++, prev; + var next = prev.next; + if (null === next) break; + prev = next; + } + provider = { provider: provider, count: 1, prev: prev, next: null }; + null === prev ? (root.gestures = provider) : (prev.next = provider); + ensureRootIsScheduled(root); + return provider; + } + function deleteScheduledGesture(root, gesture) { + null === gesture.prev + ? root.gestures === gesture && + ((root.gestures = gesture.next), + null === root.gestures && (root.pendingLanes &= -65)) + : ((gesture.prev.next = gesture.next), + null !== gesture.next && (gesture.next.prev = gesture.prev), + (gesture.prev = null), + (gesture.next = null)); + } function mountHookTypesDev() { var hookName = currentHookNameInDev; null === hookTypesDev @@ -5805,7 +5837,7 @@ throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } hook.memoizedState = nextSnapshot; @@ -5888,7 +5920,7 @@ "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -6862,7 +6894,7 @@ queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -6870,6 +6902,61 @@ markRootEntangled(root, lane); } } + function startGesture(fiber, queue, gestureProvider) { + var root = enqueueGestureRender(fiber); + if (null === root) return function () {}; + var update = { + gesture: scheduleGesture(root, gestureProvider), + prev: null, + next: queue.pending + }; + null !== queue.pending && (queue.pending.prev = update); + queue.pending = update; + return function () { + if (null === update.prev) + if (queue.pending === update) queue.pending = update.next; + else return; + else + (update.prev.next = update.next), + null !== update.next && (update.next.prev = update.prev), + (update.prev = null), + (update.next = null); + var gesture = update.gesture; + gesture.count--; + 0 === gesture.count && deleteScheduledGesture(root, gesture); + }; + } + function mountSwipeTransition(previous, current) { + previous = { pending: null, dispatch: null }; + var startGestureOnHook = (previous.dispatch = startGesture.bind( + null, + currentlyRenderingFiber, + previous + )); + mountWorkInProgressHook().queue = previous; + return [current, startGestureOnHook]; + } + function updateSwipeTransition(previous, current) { + var queue = updateWorkInProgressHook().queue, + startGestureOnHook = queue.dispatch; + if (64 === workInProgressRootRenderLanes) { + var root = workInProgressRoot; + if (null === root) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + root = root.gestures; + for (var update = queue.pending; null !== update; ) { + if (root === update.gesture) { + current = previous; + break; + } + update = update.next; + } + } + null !== queue.pending && (currentlyRenderingFiber.lanes |= 64); + return [current, startGestureOnHook]; + } function pushDebugInfo(debugInfo) { var previousDebugInfo = currentDebugInfo; null != debugInfo && @@ -8744,7 +8831,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -9060,7 +9147,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 +9227,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 +9260,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 +9282,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 +9301,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 +9315,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 +9344,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 +9357,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 +9375,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -9348,33 +9427,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_2581; + var JSCompiler_object_inline_stack_2580 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2579 = !1; + var JSCompiler_object_inline_message_2578 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2582 = didSuspend) || - (JSCompiler_object_inline_componentStack_2582 = + (JSCompiler_object_inline_componentStack_2581 = didSuspend) || + (JSCompiler_object_inline_componentStack_2581 = 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_2581 && + ((JSCompiler_object_inline_message_2578 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2582 = + JSCompiler_object_inline_componentStack_2581 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2579 + JSCompiler_object_inline_message_2578 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2580 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2579 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2580)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2579)) { c: { - var instance = JSCompiler_object_inline_digest_2580; + var instance = JSCompiler_object_inline_digest_2579; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -9416,87 +9495,87 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2580 + JSCompiler_object_inline_digest_2579 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2580 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2579 = 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_2579 && + ((JSCompiler_object_inline_digest_2579 = + JSCompiler_object_inline_digest_2579.dehydrated), + null !== JSCompiler_object_inline_digest_2579) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2580) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2579) ? (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_2579 = + JSCompiler_object_inline_stack_2580.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2580.fallback; + if (JSCompiler_object_inline_message_2578) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2581 = + (JSCompiler_object_inline_stack_2580 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2580, + JSCompiler_object_inline_digest_2579, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2579 = workInProgress.child), - (JSCompiler_object_inline_message_2579.memoizedState = + (JSCompiler_object_inline_message_2578 = workInProgress.child), + (JSCompiler_object_inline_message_2578.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2579.childLanes = + (JSCompiler_object_inline_message_2578.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2581, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2580 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2581.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2580.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2581 = + (JSCompiler_object_inline_stack_2580 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2580, + JSCompiler_object_inline_digest_2579, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2579 = workInProgress.child), - (JSCompiler_object_inline_message_2579.memoizedState = + (JSCompiler_object_inline_message_2578 = workInProgress.child), + (JSCompiler_object_inline_message_2578.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2579.childLanes = + (JSCompiler_object_inline_message_2578.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2581, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2580 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2580 + JSCompiler_object_inline_digest_2579 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2580 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2580) + ((JSCompiler_object_inline_digest_2579 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2579) ) { if (didSuspend) workInProgress.flags & 256 @@ -9513,94 +9592,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_2578 = + JSCompiler_object_inline_stack_2580.fallback), + (JSCompiler_object_inline_digest_2579 = workInProgress.mode), + (JSCompiler_object_inline_stack_2580 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2581.children + children: JSCompiler_object_inline_stack_2580.children }, - JSCompiler_object_inline_digest_2580 + JSCompiler_object_inline_digest_2579 )), - (JSCompiler_object_inline_message_2579 = + (JSCompiler_object_inline_message_2578 = createFiberFromFragment( - JSCompiler_object_inline_message_2579, - JSCompiler_object_inline_digest_2580, + JSCompiler_object_inline_message_2578, + JSCompiler_object_inline_digest_2579, 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_2578.flags |= 2), + (JSCompiler_object_inline_stack_2580.return = workInProgress), + (JSCompiler_object_inline_message_2578.return = workInProgress), + (JSCompiler_object_inline_stack_2580.sibling = + JSCompiler_object_inline_message_2578), + (workInProgress.child = JSCompiler_object_inline_stack_2580), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2581 = workInProgress.child), - (JSCompiler_object_inline_stack_2581.memoizedState = + (JSCompiler_object_inline_stack_2580 = workInProgress.child), + (JSCompiler_object_inline_stack_2580.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2581.childLanes = + (JSCompiler_object_inline_stack_2580.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2581, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2579)); + (workInProgress = JSCompiler_object_inline_message_2578)); 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_2579)) ) { - 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_2581 = + JSCompiler_object_inline_digest_2579.nextSibling && + JSCompiler_object_inline_digest_2579.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2581) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2581.dgst; + var message = JSCompiler_object_inline_componentStack_2581.msg; + instance = JSCompiler_object_inline_componentStack_2581.stck; var componentStack = - JSCompiler_object_inline_componentStack_2582.cstck; + JSCompiler_object_inline_componentStack_2581.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_2578 = message; + JSCompiler_object_inline_digest_2579 = JSCompiler_temp; + JSCompiler_object_inline_stack_2580 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2581 = 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_2579 && + ((JSCompiler_object_inline_componentStack_2581 = + JSCompiler_object_inline_message_2578 + ? Error(JSCompiler_object_inline_message_2578) : 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_2581.stack = + JSCompiler_object_inline_stack_2580 || ""), + (JSCompiler_object_inline_componentStack_2581.digest = + JSCompiler_object_inline_digest_2579), + (JSCompiler_object_inline_stack_2580 = void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2579 = { - value: JSCompiler_object_inline_componentStack_2582, + (JSCompiler_object_inline_message_2578 = { + value: JSCompiler_object_inline_componentStack_2581, source: null, - stack: JSCompiler_object_inline_stack_2581 + stack: JSCompiler_object_inline_stack_2580 }), - "string" === typeof JSCompiler_object_inline_stack_2581 && + "string" === typeof JSCompiler_object_inline_stack_2580 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2582, - JSCompiler_object_inline_message_2579 + JSCompiler_object_inline_componentStack_2581, + JSCompiler_object_inline_message_2578 ), - queueHydrationError(JSCompiler_object_inline_message_2579)); + queueHydrationError(JSCompiler_object_inline_message_2578)); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9614,44 +9693,44 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2582 = + (JSCompiler_object_inline_componentStack_2581 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2582) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2581) ) { - JSCompiler_object_inline_componentStack_2582 = workInProgressRoot; + JSCompiler_object_inline_componentStack_2581 = 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_2581 && + ((JSCompiler_object_inline_stack_2580 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2580 = + 0 !== (JSCompiler_object_inline_stack_2580 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2580 )), - (JSCompiler_object_inline_stack_2581 = + (JSCompiler_object_inline_stack_2580 = 0 !== - (JSCompiler_object_inline_stack_2581 & - (JSCompiler_object_inline_componentStack_2582.suspendedLanes | + (JSCompiler_object_inline_stack_2580 & + (JSCompiler_object_inline_componentStack_2581.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_2580), + 0 !== JSCompiler_object_inline_stack_2580 && + JSCompiler_object_inline_stack_2580 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2581), + ((prevState.retryLane = JSCompiler_object_inline_stack_2580), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2580 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2581, current, - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2580 ), SelectiveHydrationException) ); - JSCompiler_object_inline_digest_2580.data === + JSCompiler_object_inline_digest_2579.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9659,14 +9738,14 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2580.data === + JSCompiler_object_inline_digest_2579.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_2579.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9684,54 +9763,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2581.children + JSCompiler_object_inline_stack_2580.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2579) + if (JSCompiler_object_inline_message_2578) 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_2578 = + JSCompiler_object_inline_stack_2580.fallback), + (JSCompiler_object_inline_digest_2579 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2581 = createWorkInProgress( + (JSCompiler_object_inline_stack_2580 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2581.children + children: JSCompiler_object_inline_stack_2580.children } )), - (JSCompiler_object_inline_stack_2581.subtreeFlags = + (JSCompiler_object_inline_stack_2580.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_message_2579 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2578 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2579 + JSCompiler_object_inline_message_2578 )) - : ((JSCompiler_object_inline_message_2579 = createFiberFromFragment( - JSCompiler_object_inline_message_2579, - JSCompiler_object_inline_digest_2580, + : ((JSCompiler_object_inline_message_2578 = createFiberFromFragment( + JSCompiler_object_inline_message_2578, + JSCompiler_object_inline_digest_2579, 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_2578.flags |= 2)), + (JSCompiler_object_inline_message_2578.return = workInProgress), + (JSCompiler_object_inline_stack_2580.return = workInProgress), + (JSCompiler_object_inline_stack_2580.sibling = + JSCompiler_object_inline_message_2578), + (workInProgress.child = JSCompiler_object_inline_stack_2580), + (JSCompiler_object_inline_stack_2580 = + JSCompiler_object_inline_message_2578), + (JSCompiler_object_inline_message_2578 = workInProgress.child), + (JSCompiler_object_inline_digest_2579 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2579 + ? (JSCompiler_object_inline_digest_2579 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2580.cachePool), + JSCompiler_object_inline_digest_2579.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9739,38 +9818,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2580 = { + (JSCompiler_object_inline_digest_2579 = { baseLanes: - JSCompiler_object_inline_digest_2580.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2579.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_2578.memoizedState = + JSCompiler_object_inline_digest_2579), + (JSCompiler_object_inline_message_2578.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2582, + JSCompiler_object_inline_componentStack_2581, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2581 + JSCompiler_object_inline_stack_2580 ); 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_2580.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2582 = + ((JSCompiler_object_inline_componentStack_2581 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2582 + null === JSCompiler_object_inline_componentStack_2581 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2582.push(current)); + : JSCompiler_object_inline_componentStack_2581.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11530,7 +11609,7 @@ selectionRange: JSCompiler_temp }; shouldStartViewTransition = _enabled = !1; - committedLanes = (committedLanes & 335544192) === committedLanes; + committedLanes = (committedLanes & 335544064) === committedLanes; nextEffect = firstChild; for (firstChild = committedLanes ? 9238 : 1028; null !== nextEffect; ) { root = nextEffect; @@ -13090,7 +13169,7 @@ viewTransitionMutationContext = !1; recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); - (lanes & 335544192) === lanes && + (lanes & 335544064) === lanes && null !== current && viewTransitionMutationContext && (finishedWork.flags |= 4); @@ -13553,7 +13632,7 @@ endTime ) { var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; if ( parentFiber.subtreeFlags & (isViewTransitionEligible ? 10262 : 10256) || (0 !== parentFiber.actualDuration && @@ -13594,7 +13673,7 @@ inHydratedSubtree ); var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; isViewTransitionEligible && null === finishedWork.alternate && null !== finishedWork.return && @@ -14955,7 +15034,7 @@ resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -15896,7 +15975,7 @@ } yieldDuration = (forceSync = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root.expiredLanes)) || checkIfRootIsPrerendering(root, lanes)) ? renderRootConcurrent(root, lanes) @@ -16003,15 +16082,15 @@ case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case RootSuspendedAtTheShell: setCurrentTrackFromLanes(lanes); logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); yieldEndTime = lanes; - 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60) + 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 124) ? (blockingSuspendedTime = startTime) - : 0 !== (yieldEndTime & 4194176) && + : 0 !== (yieldEndTime & 4194048) && (transitionSuspendedTime = startTime); markRootSuspended( forceSync, @@ -16124,7 +16203,7 @@ ) { root.timeoutHandle = noTimeout; var subtreeFlags = finishedWork.subtreeFlags, - isViewTransitionEligible = (lanes & 335544192) === lanes; + isViewTransitionEligible = (lanes & 335544064) === lanes; if ( isViewTransitionEligible || subtreeFlags & 8192 || @@ -16273,9 +16352,9 @@ } } function finalizeRender(lanes, finalizationTime) { - if (0 !== (lanes & 3) || 0 !== (lanes & 60)) + if (0 !== (lanes & 3) || 0 !== (lanes & 124)) blockingClampTime = finalizationTime; - 0 !== (lanes & 4194176) && (transitionClampTime = finalizationTime); + 0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime); } function prepareFreshStack(root, lanes) { supportsUserTiming && @@ -16300,13 +16379,13 @@ var endTime = renderStartTime; supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), performance.measure( (lanes & 536870912) === lanes ? "Prewarm" - : (lanes & 201326677) === lanes + : (lanes & 201326741) === lanes ? "Interrupted Hydration" : "Interrupted Render", reusableLaneOptions @@ -16314,7 +16393,7 @@ } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } - if (0 !== (lanes & 3) || 0 !== (lanes & 60)) { + if (0 !== (lanes & 3) || 0 !== (lanes & 124)) { previousRenderStartTime = 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime ? blockingClampTime @@ -16357,7 +16436,7 @@ 0 < previousRenderStartTime && ((reusableLaneDevToolDetails.color = isSpawnedUpdate ? "error" - : (lanes & 738197589) === lanes + : (lanes & 738197653) === lanes ? "tertiary-light" : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), @@ -16370,7 +16449,7 @@ blockingEventIsRepeat = !0; blockingSpawnedUpdate = !1; } - 0 !== (lanes & 4194176) && + 0 !== (lanes & 4194048) && ((previousRenderStartTime = 0 <= transitionStartTime && transitionStartTime < transitionClampTime ? transitionClampTime @@ -16519,7 +16598,7 @@ function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -17030,6 +17109,7 @@ didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes; didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + null === root.gestures && (didIncludeRenderPhaseUpdate &= -65); markRootFinished( root, lanes, @@ -17041,68 +17121,71 @@ root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - pendingFinishedWork = finishedWork; - pendingEffectsRoot = root; - pendingEffectsLanes = lanes; - pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; - pendingPassiveTransitions = transitions; - pendingRecoverableErrors = recoverableErrors; - pendingEffectsRenderEndTime = completedRenderEndTime; - pendingSuspendedCommitReason = suspendedCommitReason; - pendingViewTransitionEvents = null; - (lanes & 335544192) === lanes - ? ((pendingTransitionTypes = ReactSharedInternals.V), - (ReactSharedInternals.V = null), - (recoverableErrors = 10262)) - : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); - 0 !== finishedWork.actualDuration || - 0 !== (finishedWork.subtreeFlags & recoverableErrors) || - 0 !== (finishedWork.flags & recoverableErrors) - ? ((root.callbackNode = null), - (root.callbackPriority = 0), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), (root.callbackPriority = 0)); - commitErrors = null; - commitStartTime = now(); - suspendedCommitReason === SUSPENDED_COMMIT - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : suspendedCommitReason === THROTTLED_COMMIT && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - suspendedCommitReason = 0 !== (finishedWork.flags & 13878); - if ( - 0 !== (finishedWork.subtreeFlags & 13878) || - suspendedCommitReason - ) { - suspendedCommitReason = ReactSharedInternals.T; - ReactSharedInternals.T = null; - completedRenderEndTime = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = DiscreteEventPriority; - recoverableErrors = executionContext; - executionContext |= CommitContext; - try { - commitBeforeMutationEffects(root, finishedWork, lanes); - } finally { - (executionContext = recoverableErrors), - (ReactDOMSharedInternals.p = completedRenderEndTime), - (ReactSharedInternals.T = suspendedCommitReason); + if (64 === lanes) commitGestureOnRoot(root); + else { + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingEffectsRenderEndTime = completedRenderEndTime; + pendingSuspendedCommitReason = suspendedCommitReason; + pendingViewTransitionEvents = null; + (lanes & 335544064) === lanes + ? ((pendingTransitionTypes = ReactSharedInternals.V), + (ReactSharedInternals.V = null), + (recoverableErrors = 10262)) + : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & recoverableErrors) || + 0 !== (finishedWork.flags & recoverableErrors) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback$1(NormalPriority$1, function () { + schedulerEvent = window.event; + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitErrors = null; + commitStartTime = now(); + suspendedCommitReason === SUSPENDED_COMMIT + ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) + : suspendedCommitReason === THROTTLED_COMMIT && + logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); + suspendedCommitReason = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + suspendedCommitReason + ) { + suspendedCommitReason = ReactSharedInternals.T; + ReactSharedInternals.T = null; + completedRenderEndTime = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + recoverableErrors = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork, lanes); + } finally { + (executionContext = recoverableErrors), + (ReactDOMSharedInternals.p = completedRenderEndTime), + (ReactSharedInternals.T = suspendedCommitReason); + } } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + (shouldStartViewTransition && + startViewTransition( + root.containerInfo, + pendingTransitionTypes, + flushMutationEffects, + flushLayoutEffects, + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects + )) || + (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } - pendingEffectsStatus = PENDING_MUTATION_PHASE; - (shouldStartViewTransition && - startViewTransition( - root.containerInfo, - pendingTransitionTypes, - flushMutationEffects, - flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects - )) || - (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } } function flushAfterMutationEffects() { @@ -17311,7 +17394,7 @@ (reusableLaneOptions.start = completedRenderEndTime), (reusableLaneOptions.end = suspendedCommitReason), performance.measure("Commit", reusableLaneOptions)); - completedRenderEndTime = (lanes & 335544192) === lanes ? 10262 : 10256; + completedRenderEndTime = (lanes & 335544064) === lanes ? 10262 : 10256; (completedRenderEndTime = 0 !== finishedWork.actualDuration || 0 !== (finishedWork.subtreeFlags & completedRenderEndTime) || @@ -17407,7 +17490,7 @@ 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); suspendedCommitReason = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (suspendedCommitReason & 42) + 0 !== (lanes & 4194090) && 0 !== (suspendedCommitReason & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -17417,6 +17500,14 @@ flushSyncWorkAcrossRoots_impl(0, !1); } } + function commitGestureOnRoot(root) { + var finishedGesture = root.gestures; + if (null === finishedGesture) + throw Error( + "Finished rendering the gesture lane but there were no pending gestures. React should not have started a render in this case. This is a bug in React." + ); + deleteScheduledGesture(root, finishedGesture); + } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; Object.defineProperty(componentStack, "digest", { @@ -17626,10 +17717,10 @@ null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; root.warmLanes &= ~pingedLanes; - 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 60) + 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 124) ? 0 > blockingUpdateTime && (blockingClampTime = blockingUpdateTime = now()) - : 0 !== (pingedLanes & 4194176) && + : 0 !== (pingedLanes & 4194048) && 0 > transitionUpdateTime && (transitionClampTime = transitionUpdateTime = now()); isConcurrentActEnvironment() && @@ -17831,8 +17922,8 @@ (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); nextLanes = - nextLanes & 201326677 - ? (nextLanes & 201326677) | 1 + nextLanes & 201326741 + ? (nextLanes & 201326741) | 1 : nextLanes ? nextLanes | 2 : 0; @@ -17848,7 +17939,7 @@ null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout )), - 0 === (nextLanes & 3) || + (0 === (nextLanes & 3) && 64 !== nextLanes) || checkIfRootIsPrerendering(root, nextLanes) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); @@ -17884,7 +17975,10 @@ null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev); else if ( - ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3)) + ((prev = root), + 0 !== syncTransitionLanes || + 0 !== (nextLanes & 3) || + 64 === nextLanes) ) mightHavePendingSyncWork = !0; root = next; @@ -22414,6 +22508,7 @@ this.pooledCache = null; this.pooledCacheLanes = 0; this.formState = formState; + this.gestures = null; this.incompleteTransitions = new Map(); this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); @@ -23195,7 +23290,7 @@ clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log = Math.log, LN2 = Math.LN2, - nextTransitionLane = 128, + nextTransitionLane = 256, nextRetryLane = 4194304, DiscreteEventPriority = 2, ContinuousEventPriority = 8, @@ -24922,6 +25017,7 @@ useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; + ContextOnlyDispatcher.useSwipeTransition = throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -25067,6 +25163,11 @@ currentHookNameInDev = "useEffectEvent"; mountHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + mountHookTypesDev(); + return mountSwipeTransition(previous, current); } }; HooksDispatcherOnMountWithHookTypesInDEV = { @@ -25201,6 +25302,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; HooksDispatcherOnUpdateInDEV = { @@ -25335,6 +25441,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; HooksDispatcherOnRerenderInDEV = { @@ -25469,6 +25580,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnMountInDEV = { @@ -25628,6 +25744,12 @@ warnInvalidHookAccess(); mountHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnUpdateInDEV = { @@ -25787,6 +25909,12 @@ warnInvalidHookAccess(); updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnRerenderInDEV = { @@ -25946,6 +26074,12 @@ warnInvalidHookAccess(); updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; var callComponent = { @@ -26887,11 +27021,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26928,10 +27062,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-e670e72f-20250214" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27073,7 +27207,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-e670e72f-20250214"; "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 f37c6a7fdc773..8bf7b1d849430 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 @@ -340,7 +340,7 @@ function clz32Fallback(x) { x >>>= 0; return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } -var nextTransitionLane = 128, +var nextTransitionLane = 256, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { var pendingSyncLanes = lanes & 42; @@ -361,6 +361,7 @@ function getHighestPriorityLanes(lanes) { case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -375,7 +376,7 @@ function getHighestPriorityLanes(lanes) { case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -431,7 +432,7 @@ function getNextLanes(root, wipLanes, rootHasPendingCommit) { ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -449,10 +450,10 @@ function computeExpirationTime(lane, currentTime) { case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -487,7 +488,7 @@ function computeExpirationTime(lane, currentTime) { function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -561,7 +562,7 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -584,7 +585,6 @@ function getBumpedLaneForHydrationByLane(lane) { case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -603,7 +603,7 @@ function getBumpedLaneForHydrationByLane(lane) { case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -2021,19 +2021,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$287; + var JSCompiler_inline_result$jscomp$288; if (canUseDOM) { - var isSupported$jscomp$inline_425 = "oninput" in document; - if (!isSupported$jscomp$inline_425) { - var element$jscomp$inline_426 = document.createElement("div"); - element$jscomp$inline_426.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_425 = - "function" === typeof element$jscomp$inline_426.oninput; + var isSupported$jscomp$inline_426 = "oninput" in document; + if (!isSupported$jscomp$inline_426) { + var element$jscomp$inline_427 = document.createElement("div"); + element$jscomp$inline_427.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_426 = + "function" === typeof element$jscomp$inline_427.oninput; } - JSCompiler_inline_result$jscomp$287 = isSupported$jscomp$inline_425; - } else JSCompiler_inline_result$jscomp$287 = !1; + JSCompiler_inline_result$jscomp$288 = isSupported$jscomp$inline_426; + } else JSCompiler_inline_result$jscomp$288 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$287 && + JSCompiler_inline_result$jscomp$288 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2345,6 +2345,11 @@ function enqueueConcurrentRenderForLane(fiber, lane) { enqueueUpdate$1(fiber, null, null, lane); return getRootForUpdatedFiber(fiber); } +function enqueueGestureRender(fiber) { + fiber = markUpdateLaneFromFiberToRoot(fiber, null, 64); + null !== fiber && markRootUpdated$1(fiber, 64); + return fiber; +} function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { sourceFiber.lanes |= lane; var alternate = sourceFiber.alternate; @@ -2358,17 +2363,19 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (50 < nestedUpdateCount) @@ -2652,7 +2659,7 @@ function enqueueUpdate(fiber, update, lane) { } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -3183,6 +3190,28 @@ function getSuspendedCache() { ? null : { parent: CacheContext._currentValue, pool: cacheFromPool }; } +function scheduleGesture(root, provider) { + for (var prev = root.gestures; null !== prev; ) { + if (prev.provider === provider) return prev.count++, prev; + var next = prev.next; + if (null === next) break; + prev = next; + } + provider = { provider: provider, count: 1, prev: prev, next: null }; + null === prev ? (root.gestures = provider) : (prev.next = provider); + ensureRootIsScheduled(root); + return provider; +} +function deleteScheduledGesture(root, gesture) { + null === gesture.prev + ? root.gestures === gesture && + ((root.gestures = gesture.next), + null === root.gestures && (root.pendingLanes &= -65)) + : ((gesture.prev.next = gesture.next), + null !== gesture.next && (gesture.next.prev = gesture.prev), + (gesture.prev = null), + (gesture.next = null)); +} var renderLanes = 0, currentlyRenderingFiber = null, currentHook = null, @@ -3589,7 +3618,7 @@ function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { ); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -4305,7 +4334,7 @@ function enqueueRenderPhaseUpdate(queue, update) { queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -4313,6 +4342,49 @@ function entangleTransitionUpdate(root, queue, lane) { markRootEntangled(root, lane); } } +function startGesture(fiber, queue, gestureProvider) { + var root = enqueueGestureRender(fiber); + if (null === root) return function () {}; + var update = { + gesture: scheduleGesture(root, gestureProvider), + prev: null, + next: queue.pending + }; + null !== queue.pending && (queue.pending.prev = update); + queue.pending = update; + return function () { + if (null === update.prev) + if (queue.pending === update) queue.pending = update.next; + else return; + else + (update.prev.next = update.next), + null !== update.next && (update.next.prev = update.prev), + (update.prev = null), + (update.next = null); + var cancelledGestured = update.gesture; + cancelledGestured.count--; + 0 === cancelledGestured.count && + deleteScheduledGesture(root, cancelledGestured); + }; +} +function updateSwipeTransition(previous, current) { + var queue = updateWorkInProgressHook().queue, + startGestureOnHook = queue.dispatch; + if (64 === workInProgressRootRenderLanes) { + var root$46 = workInProgressRoot; + if (null === root$46) throw Error(formatProdErrorMessage(349)); + root$46 = root$46.gestures; + for (var update = queue.pending; null !== update; ) { + if (root$46 === update.gesture) { + current = previous; + break; + } + update = update.next; + } + } + null !== queue.pending && (currentlyRenderingFiber.lanes |= 64); + return [current, startGestureOnHook]; +} var ContextOnlyDispatcher = { readContext: readContext, use: use, @@ -4339,6 +4411,7 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; +ContextOnlyDispatcher.useSwipeTransition = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -4450,7 +4523,7 @@ var HooksDispatcherOnMount = { getServerSnapshot = getSnapshot(); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; @@ -4528,6 +4601,16 @@ var HooksDispatcherOnMount = { throw Error(formatProdErrorMessage(440)); return ref.impl.apply(void 0, arguments); }; + }, + useSwipeTransition: function (previous, current) { + previous = { pending: null, dispatch: null }; + var startGestureOnHook = (previous.dispatch = startGesture.bind( + null, + currentlyRenderingFiber, + previous + )); + mountWorkInProgressHook().queue = previous; + return [current, startGestureOnHook]; } }, HooksDispatcherOnUpdate = { @@ -4578,6 +4661,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: updateRefresh }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; +HooksDispatcherOnUpdate.useSwipeTransition = updateSwipeTransition; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4631,6 +4715,7 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; +HooksDispatcherOnRerender.useSwipeTransition = updateSwipeTransition; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -5485,9 +5570,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$75) { + } catch (e$76) { setTimeout(function () { - throw e$75; + throw e$76; }); } } @@ -5498,9 +5583,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$76) { + } catch (e$77) { setTimeout(function () { - throw e$76; + throw e$77; }); } } @@ -7565,8 +7650,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$115) { - captureCommitPhaseError(current, nearestMountedAncestor, error$115); + } catch (error$116) { + captureCommitPhaseError(current, nearestMountedAncestor, error$116); } else ref.current = null; } @@ -7785,7 +7870,7 @@ function commitBeforeMutationEffects(root, firstChild, committedLanes) { } else JSCompiler_temp = null; selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; shouldStartViewTransition = _enabled = !1; - committedLanes = (committedLanes & 335544192) === committedLanes; + committedLanes = (committedLanes & 335544064) === committedLanes; nextEffect = firstChild; for (firstChild = committedLanes ? 9238 : 1028; null !== nextEffect; ) { root = nextEffect; @@ -8372,11 +8457,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$114) { + } catch (error$115) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$114 + error$115 ); } } @@ -9150,7 +9235,7 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { viewTransitionMutationContext = !1; recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); - (lanes & 335544192) === lanes && + (lanes & 335544064) === lanes && null !== current && viewTransitionMutationContext && (finishedWork.flags |= 4); @@ -9184,21 +9269,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$116 = JSCompiler_inline_result.stateNode; + var parent$117 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$116, ""), + (setTextContent(parent$117, ""), (JSCompiler_inline_result.flags &= -33)); - var before$117 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$117, parent$116); + var before$118 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$118, parent$117); break; case 3: case 4: - var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, - before$119 = getHostSibling(finishedWork); + var parent$119 = JSCompiler_inline_result.stateNode.containerInfo, + before$120 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$119, - parent$118 + before$120, + parent$119 ); break; default: @@ -9562,7 +9647,7 @@ function recursivelyTraversePassiveMountEffects( committedTransitions ) { var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; if (parentFiber.subtreeFlags & (isViewTransitionEligible ? 10262 : 10256)) for (parentFiber = parentFiber.child; null !== parentFiber; ) commitPassiveMountOnFiber( @@ -9581,7 +9666,7 @@ function commitPassiveMountOnFiber( committedTransitions ) { var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; isViewTransitionEligible && null === finishedWork.alternate && null !== finishedWork.return && @@ -10527,7 +10612,7 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -10565,14 +10650,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$137 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$137 = lastTailNode), + for (var lastTailNode$138 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$138 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$137 + null === lastTailNode$138 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$137.sibling = null); + : (lastTailNode$138.sibling = null); } } function bubbleProperties(completedWork) { @@ -10582,19 +10667,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$138 = completedWork.child; null !== child$138; ) - (newChildLanes |= child$138.lanes | child$138.childLanes), - (subtreeFlags |= child$138.subtreeFlags & 65011712), - (subtreeFlags |= child$138.flags & 65011712), - (child$138.return = completedWork), - (child$138 = child$138.sibling); + for (var child$139 = completedWork.child; null !== child$139; ) + (newChildLanes |= child$139.lanes | child$139.childLanes), + (subtreeFlags |= child$139.subtreeFlags & 65011712), + (subtreeFlags |= child$139.flags & 65011712), + (child$139.return = completedWork), + (child$139 = child$139.sibling); else - for (child$138 = completedWork.child; null !== child$138; ) - (newChildLanes |= child$138.lanes | child$138.childLanes), - (subtreeFlags |= child$138.subtreeFlags), - (subtreeFlags |= child$138.flags), - (child$138.return = completedWork), - (child$138 = child$138.sibling); + for (child$139 = completedWork.child; null !== child$139; ) + (newChildLanes |= child$139.lanes | child$139.childLanes), + (subtreeFlags |= child$139.subtreeFlags), + (subtreeFlags |= child$139.flags), + (child$139.return = completedWork), + (child$139 = child$139.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10875,11 +10960,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$151 = null; + var cache$152 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$151 = newProps.memoizedState.cachePool.pool); - cache$151 !== type && (newProps.flags |= 2048); + (cache$152 = newProps.memoizedState.cachePool.pool); + cache$152 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10904,8 +10989,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$151 = type.rendering; - if (null === cache$151) + cache$152 = type.rendering; + if (null === cache$152) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10913,11 +10998,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$151 = findFirstSuspended(current); - if (null !== cache$151) { + cache$152 = findFirstSuspended(current); + if (null !== cache$152) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$151.updateQueue; + current = cache$152.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10942,7 +11027,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$151)), null !== current)) { + if (((current = findFirstSuspended(cache$152)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10952,7 +11037,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$151.alternate && + !cache$152.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10965,13 +11050,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$151.sibling = workInProgress.child), - (workInProgress.child = cache$151)) + ? ((cache$152.sibling = workInProgress.child), + (workInProgress.child = cache$152)) : ((current = type.last), null !== current - ? (current.sibling = cache$151) - : (workInProgress.child = cache$151), - (type.last = cache$151)); + ? (current.sibling = cache$152) + : (workInProgress.child = cache$152), + (type.last = cache$152)); } if (null !== type.tail) return ( @@ -11242,7 +11327,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); var shouldTimeSlice = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root$jscomp$0.expiredLanes)) || checkIfRootIsPrerendering(root$jscomp$0, lanes), exitStatus = shouldTimeSlice @@ -11330,7 +11415,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { case 1: throw Error(formatProdErrorMessage(345)); case 4: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case 6: markRootSuspended( shouldTimeSlice, @@ -11422,7 +11507,7 @@ function commitRootWhenReady( ) { root.timeoutHandle = -1; suspendedCommitReason = finishedWork.subtreeFlags; - var isViewTransitionEligible = (lanes & 335544192) === lanes; + var isViewTransitionEligible = (lanes & 335544064) === lanes; if ( isViewTransitionEligible || suspendedCommitReason & 8192 || @@ -11642,7 +11727,7 @@ function pushAsyncDispatcher() { function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -11707,8 +11792,8 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$170) { - handleThrow(root, thrownValue$170); + } catch (thrownValue$171) { + handleThrow(root, thrownValue$171); } while (1); lanes && root.shellSuspendCounter++; @@ -11823,8 +11908,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrentByScheduler(); break; - } catch (thrownValue$172) { - handleThrow(root, thrownValue$172); + } catch (thrownValue$173) { + handleThrow(root, thrownValue$173); } while (1); lastContextDependency = currentlyRenderingFiber$1 = null; @@ -12013,6 +12098,7 @@ function commitRoot( if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes; didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + null === root.gestures && (didIncludeRenderPhaseUpdate &= -65); markRootFinished( root, lanes, @@ -12024,55 +12110,58 @@ function commitRoot( root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - pendingFinishedWork = finishedWork; - pendingEffectsRoot = root; - pendingEffectsLanes = lanes; - pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; - pendingPassiveTransitions = transitions; - pendingRecoverableErrors = recoverableErrors; - pendingViewTransitionEvents = null; - (lanes & 335544192) === lanes - ? ((pendingTransitionTypes = ReactSharedInternals.V), - (ReactSharedInternals.V = null), - (recoverableErrors = 10262)) - : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); - 0 !== (finishedWork.subtreeFlags & recoverableErrors) || - 0 !== (finishedWork.flags & recoverableErrors) - ? ((root.callbackNode = null), - (root.callbackPriority = 0), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), (root.callbackPriority = 0)); - recoverableErrors = 0 !== (finishedWork.flags & 13878); - if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) { - recoverableErrors = ReactSharedInternals.T; - ReactSharedInternals.T = null; - transitions = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = 2; - spawnedLane = executionContext; - executionContext |= 4; - try { - commitBeforeMutationEffects(root, finishedWork, lanes); - } finally { - (executionContext = spawnedLane), - (ReactDOMSharedInternals.p = transitions), - (ReactSharedInternals.T = recoverableErrors); + if (64 === lanes) commitGestureOnRoot(root); + else { + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingViewTransitionEvents = null; + (lanes & 335544064) === lanes + ? ((pendingTransitionTypes = ReactSharedInternals.V), + (ReactSharedInternals.V = null), + (recoverableErrors = 10262)) + : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); + 0 !== (finishedWork.subtreeFlags & recoverableErrors) || + 0 !== (finishedWork.flags & recoverableErrors) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback$1(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + recoverableErrors = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) { + recoverableErrors = ReactSharedInternals.T; + ReactSharedInternals.T = null; + transitions = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + spawnedLane = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork, lanes); + } finally { + (executionContext = spawnedLane), + (ReactDOMSharedInternals.p = transitions), + (ReactSharedInternals.T = recoverableErrors); + } } + pendingEffectsStatus = 1; + (shouldStartViewTransition && + startViewTransition( + root.containerInfo, + pendingTransitionTypes, + flushMutationEffects, + flushLayoutEffects, + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects + )) || + (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } - pendingEffectsStatus = 1; - (shouldStartViewTransition && - startViewTransition( - root.containerInfo, - pendingTransitionTypes, - flushMutationEffects, - flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects - )) || - (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } } function flushAfterMutationEffects() { @@ -12236,7 +12325,7 @@ function flushSpawnedWork() { finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, recoverableErrors = pendingRecoverableErrors, - passiveSubtreeMask = (lanes & 335544192) === lanes ? 10262 : 10256; + passiveSubtreeMask = (lanes & 335544064) === lanes ? 10262 : 10256; 0 !== (finishedWork.subtreeFlags & passiveSubtreeMask) || 0 !== (finishedWork.flags & passiveSubtreeMask) ? (pendingEffectsStatus = 5) @@ -12292,7 +12381,7 @@ function flushSpawnedWork() { 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); passiveSubtreeMask = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (passiveSubtreeMask & 42) + 0 !== (lanes & 4194090) && 0 !== (passiveSubtreeMask & 42) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -12300,6 +12389,11 @@ function flushSpawnedWork() { flushSyncWorkAcrossRoots_impl(0, !1); } } +function commitGestureOnRoot(root) { + var finishedGesture = root.gestures; + if (null === finishedGesture) throw Error(formatProdErrorMessage(548)); + deleteScheduledGesture(root, finishedGesture); +} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -12493,41 +12587,42 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$178 = firstScheduledRoot; null !== root$178; ) { + for (var root$179 = firstScheduledRoot; null !== root$179; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$178.pendingLanes; + var pendingLanes = root$179.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$178.suspendedLanes, - pingedLanes = root$178.pingedLanes; + var suspendedLanes = root$179.suspendedLanes, + pingedLanes = root$179.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes); JSCompiler_inline_result = - JSCompiler_inline_result & 201326677 - ? (JSCompiler_inline_result & 201326677) | 1 + JSCompiler_inline_result & 201326741 + ? (JSCompiler_inline_result & 201326741) | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0; } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$178, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$179, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$178, - root$178 === workInProgressRoot ? JSCompiler_inline_result : 0, - null !== root$178.cancelPendingCommit || - -1 !== root$178.timeoutHandle + root$179, + root$179 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$179.cancelPendingCommit || + -1 !== root$179.timeoutHandle )), - 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$178, JSCompiler_inline_result) || + (0 === (JSCompiler_inline_result & 3) && + 64 !== JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$179, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$178, JSCompiler_inline_result)); - root$178 = root$178.next; + performSyncWorkOnRoot(root$179, JSCompiler_inline_result)); + root$179 = root$179.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -12555,7 +12650,8 @@ function processRootScheduleInMicrotask() { null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev); else if ( - ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3)) + ((prev = root), + 0 !== syncTransitionLanes || 0 !== (nextLanes & 3) || 64 === nextLanes) ) mightHavePendingSyncWork = !0; root = next; @@ -12767,20 +12863,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1572 = 0; - i$jscomp$inline_1572 < simpleEventPluginEvents.length; - i$jscomp$inline_1572++ + var i$jscomp$inline_1576 = 0; + i$jscomp$inline_1576 < simpleEventPluginEvents.length; + i$jscomp$inline_1576++ ) { - var eventName$jscomp$inline_1573 = - simpleEventPluginEvents[i$jscomp$inline_1572], - domEventName$jscomp$inline_1574 = - eventName$jscomp$inline_1573.toLowerCase(), - capitalizedEvent$jscomp$inline_1575 = - eventName$jscomp$inline_1573[0].toUpperCase() + - eventName$jscomp$inline_1573.slice(1); + var eventName$jscomp$inline_1577 = + simpleEventPluginEvents[i$jscomp$inline_1576], + domEventName$jscomp$inline_1578 = + eventName$jscomp$inline_1577.toLowerCase(), + capitalizedEvent$jscomp$inline_1579 = + eventName$jscomp$inline_1577[0].toUpperCase() + + eventName$jscomp$inline_1577.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1574, - "on" + capitalizedEvent$jscomp$inline_1575 + domEventName$jscomp$inline_1578, + "on" + capitalizedEvent$jscomp$inline_1579 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13961,34 +14057,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$192 = props[hasSrc]; - if (null != propValue$192) + var propValue$193 = props[hasSrc]; + if (null != propValue$193) switch (hasSrc) { case "name": - hasSrcSet = propValue$192; + hasSrcSet = propValue$193; break; case "type": - propValue = propValue$192; + propValue = propValue$193; break; case "checked": - checked = propValue$192; + checked = propValue$193; break; case "defaultChecked": - defaultChecked = propValue$192; + defaultChecked = propValue$193; break; case "value": - propKey = propValue$192; + propKey = propValue$193; break; case "defaultValue": - defaultValue = propValue$192; + defaultValue = propValue$193; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$192) + if (null != propValue$193) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$192, props, null); + setProp(domElement, tag, hasSrc, propValue$193, props, null); } } initInput( @@ -14125,14 +14221,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$192 in props) - props.hasOwnProperty(propValue$192) && - ((hasSrc = props[propValue$192]), + for (propValue$193 in props) + props.hasOwnProperty(propValue$193) && + ((hasSrc = props[propValue$193]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$192, + propValue$193, hasSrc, props, void 0 @@ -14180,14 +14276,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$209 in nextProps) { - var propKey = nextProps[propKey$209]; - lastProp = lastProps[propKey$209]; + for (var propKey$210 in nextProps) { + var propKey = nextProps[propKey$210]; + lastProp = lastProps[propKey$210]; if ( - nextProps.hasOwnProperty(propKey$209) && + nextProps.hasOwnProperty(propKey$210) && (null != propKey || null != lastProp) ) - switch (propKey$209) { + switch (propKey$210) { case "type": propKey !== lastProp && (viewTransitionMutationContext = !0); type = propKey; @@ -14222,7 +14318,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$209, + propKey$210, propKey, nextProps, lastProp @@ -14241,7 +14337,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$209 = null; + propKey = value = defaultValue = propKey$210 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14273,7 +14369,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (name) { case "value": type !== lastDefaultValue && (viewTransitionMutationContext = !0); - propKey$209 = type; + propKey$210 = type; break; case "defaultValue": type !== lastDefaultValue && (viewTransitionMutationContext = !0); @@ -14296,15 +14392,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$209 - ? updateOptions(domElement, !!lastProps, propKey$209, !1) + null != propKey$210 + ? updateOptions(domElement, !!lastProps, propKey$210, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$209 = null; + propKey = propKey$210 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14329,7 +14425,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (value) { case "value": name !== type && (viewTransitionMutationContext = !0); - propKey$209 = name; + propKey$210 = name; break; case "defaultValue": name !== type && (viewTransitionMutationContext = !0); @@ -14344,17 +14440,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$209, propKey); + updateTextarea(domElement, propKey$210, propKey); return; case "option": - for (var propKey$225 in lastProps) + for (var propKey$226 in lastProps) if ( - ((propKey$209 = lastProps[propKey$225]), - lastProps.hasOwnProperty(propKey$225) && - null != propKey$209 && - !nextProps.hasOwnProperty(propKey$225)) + ((propKey$210 = lastProps[propKey$226]), + lastProps.hasOwnProperty(propKey$226) && + null != propKey$210 && + !nextProps.hasOwnProperty(propKey$226)) ) - switch (propKey$225) { + switch (propKey$226) { case "selected": domElement.selected = !1; break; @@ -14362,34 +14458,34 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$225, + propKey$226, null, nextProps, - propKey$209 + propKey$210 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$209 = nextProps[lastDefaultValue]), + ((propKey$210 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$209 !== propKey && - (null != propKey$209 || null != propKey)) + propKey$210 !== propKey && + (null != propKey$210 || null != propKey)) ) switch (lastDefaultValue) { case "selected": - propKey$209 !== propKey && (viewTransitionMutationContext = !0); + propKey$210 !== propKey && (viewTransitionMutationContext = !0); domElement.selected = - propKey$209 && - "function" !== typeof propKey$209 && - "symbol" !== typeof propKey$209; + propKey$210 && + "function" !== typeof propKey$210 && + "symbol" !== typeof propKey$210; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$209, + propKey$210, nextProps, propKey ); @@ -14410,24 +14506,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$230 in lastProps) - (propKey$209 = lastProps[propKey$230]), - lastProps.hasOwnProperty(propKey$230) && - null != propKey$209 && - !nextProps.hasOwnProperty(propKey$230) && - setProp(domElement, tag, propKey$230, null, nextProps, propKey$209); + for (var propKey$231 in lastProps) + (propKey$210 = lastProps[propKey$231]), + lastProps.hasOwnProperty(propKey$231) && + null != propKey$210 && + !nextProps.hasOwnProperty(propKey$231) && + setProp(domElement, tag, propKey$231, null, nextProps, propKey$210); for (checked in nextProps) if ( - ((propKey$209 = nextProps[checked]), + ((propKey$210 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$209 !== propKey && - (null != propKey$209 || null != propKey)) + propKey$210 !== propKey && + (null != propKey$210 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$209) + if (null != propKey$210) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14435,7 +14531,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$209, + propKey$210, nextProps, propKey ); @@ -14443,49 +14539,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$235 in lastProps) - (propKey$209 = lastProps[propKey$235]), - lastProps.hasOwnProperty(propKey$235) && - void 0 !== propKey$209 && - !nextProps.hasOwnProperty(propKey$235) && + for (var propKey$236 in lastProps) + (propKey$210 = lastProps[propKey$236]), + lastProps.hasOwnProperty(propKey$236) && + void 0 !== propKey$210 && + !nextProps.hasOwnProperty(propKey$236) && setPropOnCustomElement( domElement, tag, - propKey$235, + propKey$236, void 0, nextProps, - propKey$209 + propKey$210 ); for (defaultChecked in nextProps) - (propKey$209 = nextProps[defaultChecked]), + (propKey$210 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$209 === propKey || - (void 0 === propKey$209 && void 0 === propKey) || + propKey$210 === propKey || + (void 0 === propKey$210 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$209, + propKey$210, nextProps, propKey ); return; } } - for (var propKey$240 in lastProps) - (propKey$209 = lastProps[propKey$240]), - lastProps.hasOwnProperty(propKey$240) && - null != propKey$209 && - !nextProps.hasOwnProperty(propKey$240) && - setProp(domElement, tag, propKey$240, null, nextProps, propKey$209); + for (var propKey$241 in lastProps) + (propKey$210 = lastProps[propKey$241]), + lastProps.hasOwnProperty(propKey$241) && + null != propKey$210 && + !nextProps.hasOwnProperty(propKey$241) && + setProp(domElement, tag, propKey$241, null, nextProps, propKey$210); for (lastProp in nextProps) - (propKey$209 = nextProps[lastProp]), + (propKey$210 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$209 === propKey || - (null == propKey$209 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$209, nextProps, propKey); + propKey$210 === propKey || + (null == propKey$210 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$210, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15237,26 +15333,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$248 = getResourcesFromRoot( + var styles$249 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$249 = styles$248.get(type); - resource$249 || + resource$250 = styles$249.get(type); + resource$250 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$249 = { + (resource$250 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$248.set(type, resource$249), - (styles$248 = JSCompiler_inline_result.querySelector( + styles$249.set(type, resource$250), + (styles$249 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$248._p && - ((resource$249.instance = styles$248), - (resource$249.state.loading = 5)), + !styles$249._p && + ((resource$250.instance = styles$249), + (resource$250.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15269,16 +15365,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$248 || + styles$249 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$249.state + resource$250.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$249; + return resource$250; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15375,37 +15471,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$254 = hoistableRoot.querySelector( + var instance$255 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$254) + if (instance$255) return ( (resource.state.loading |= 4), - (resource.instance = instance$254), - markNodeAsHoistable(instance$254), - instance$254 + (resource.instance = instance$255), + markNodeAsHoistable(instance$255), + instance$255 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$254 = ( + instance$255 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$254); - var linkInstance = instance$254; + markNodeAsHoistable(instance$255); + var linkInstance = instance$255; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$254, "link", instance); + setInitialProperties(instance$255, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$254, props.precedence, hoistableRoot); - return (resource.instance = instance$254); + insertStylesheet(instance$255, props.precedence, hoistableRoot); + return (resource.instance = instance$255); case "script": - instance$254 = getScriptKey(props.src); + instance$255 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$254) + getScriptSelectorFromKey(instance$255) )) ) return ( @@ -15414,7 +15510,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$254))) + if ((styleProps = preloadPropsMap.get(instance$255))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -15746,6 +15842,7 @@ function FiberRootNode( this.pooledCache = null; this.pooledCacheLanes = 0; this.formState = formState; + this.gestures = null; this.incompleteTransitions = new Map(); } function createFiberRoot( @@ -16433,16 +16530,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1824 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1828 = React.version; if ( - "19.1.0-experimental-cbbe8666-20250213" !== - isomorphicReactPackageVersion$jscomp$inline_1824 + "19.1.0-experimental-e670e72f-20250214" !== + isomorphicReactPackageVersion$jscomp$inline_1828 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1824, - "19.1.0-experimental-cbbe8666-20250213" + isomorphicReactPackageVersion$jscomp$inline_1828, + "19.1.0-experimental-e670e72f-20250214" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16462,24 +16559,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2359 = { +var internals$jscomp$inline_2363 = { bundleType: 0, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-e670e72f-20250214" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2360 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2364 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2360.isDisabled && - hook$jscomp$inline_2360.supportsFiber + !hook$jscomp$inline_2364.isDisabled && + hook$jscomp$inline_2364.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2360.inject( - internals$jscomp$inline_2359 + (rendererID = hook$jscomp$inline_2364.inject( + internals$jscomp$inline_2363 )), - (injectedHook = hook$jscomp$inline_2360); + (injectedHook = hook$jscomp$inline_2364); } catch (err) {} } exports.createRoot = function (container, options) { @@ -16571,4 +16668,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-e670e72f-20250214"; 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 2c8a745a404c1..77ddca526716c 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 @@ -590,6 +590,7 @@ case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -604,7 +605,7 @@ case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -666,7 +667,7 @@ ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -684,10 +685,10 @@ case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -727,7 +728,7 @@ function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -803,7 +804,7 @@ root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -826,7 +827,6 @@ case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -845,7 +845,7 @@ case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -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": @@ -3778,6 +3781,11 @@ enqueueUpdate$1(fiber, null, null, lane); return getRootForUpdatedFiber(fiber); } + function enqueueGestureRender(fiber) { + fiber = markUpdateLaneFromFiberToRoot(fiber, null, 64); + null !== fiber && markRootUpdated$1(fiber, 64); + return fiber; + } function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { sourceFiber.lanes |= lane; var alternate = sourceFiber.alternate; @@ -3793,17 +3801,19 @@ (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (nestedUpdateCount > NESTED_UPDATE_LIMIT) @@ -3969,7 +3979,7 @@ (blockingEventTime = lane), (blockingEventType = JSCompiler_temp)); else if ( - 0 !== (lane & 4194176) && + 0 !== (lane & 4194048) && 0 > transitionUpdateTime && ((transitionUpdateTime = now()), 0 > transitionStartTime) ) { @@ -4062,9 +4072,9 @@ } function setCurrentTrackFromLanes(lanes) { reusableLaneDevToolDetails.track = - lanes & 63 + lanes & 127 ? "Blocking" - : lanes & 4194240 + : lanes & 4194176 ? "Transition" : lanes & 62914560 ? "Suspense" @@ -4181,13 +4191,13 @@ function logRenderPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure( (lanes & 536870912) === lanes ? "Prepared" - : (lanes & 201326677) === lanes + : (lanes & 201326741) === lanes ? "Hydrated" : "Render", reusableLaneOptions @@ -4196,7 +4206,7 @@ function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); @@ -4204,7 +4214,7 @@ function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -4624,7 +4634,7 @@ } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5219,6 +5229,28 @@ ? null : { parent: CacheContext._currentValue, pool: cacheFromPool }; } + function scheduleGesture(root, provider) { + for (var prev = root.gestures; null !== prev; ) { + if (prev.provider === provider) return prev.count++, prev; + var next = prev.next; + if (null === next) break; + prev = next; + } + provider = { provider: provider, count: 1, prev: prev, next: null }; + null === prev ? (root.gestures = provider) : (prev.next = provider); + ensureRootIsScheduled(root); + return provider; + } + function deleteScheduledGesture(root, gesture) { + null === gesture.prev + ? root.gestures === gesture && + ((root.gestures = gesture.next), + null === root.gestures && (root.pendingLanes &= -65)) + : ((gesture.prev.next = gesture.next), + null !== gesture.next && (gesture.next.prev = gesture.prev), + (gesture.prev = null), + (gesture.next = null)); + } function mountHookTypesDev() { var hookName = currentHookNameInDev; null === hookTypesDev @@ -5813,7 +5845,7 @@ throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } hook.memoizedState = nextSnapshot; @@ -5896,7 +5928,7 @@ "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -6870,7 +6902,7 @@ queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -6878,6 +6910,61 @@ markRootEntangled(root, lane); } } + function startGesture(fiber, queue, gestureProvider) { + var root = enqueueGestureRender(fiber); + if (null === root) return function () {}; + var update = { + gesture: scheduleGesture(root, gestureProvider), + prev: null, + next: queue.pending + }; + null !== queue.pending && (queue.pending.prev = update); + queue.pending = update; + return function () { + if (null === update.prev) + if (queue.pending === update) queue.pending = update.next; + else return; + else + (update.prev.next = update.next), + null !== update.next && (update.next.prev = update.prev), + (update.prev = null), + (update.next = null); + var gesture = update.gesture; + gesture.count--; + 0 === gesture.count && deleteScheduledGesture(root, gesture); + }; + } + function mountSwipeTransition(previous, current) { + previous = { pending: null, dispatch: null }; + var startGestureOnHook = (previous.dispatch = startGesture.bind( + null, + currentlyRenderingFiber, + previous + )); + mountWorkInProgressHook().queue = previous; + return [current, startGestureOnHook]; + } + function updateSwipeTransition(previous, current) { + var queue = updateWorkInProgressHook().queue, + startGestureOnHook = queue.dispatch; + if (64 === workInProgressRootRenderLanes) { + var root = workInProgressRoot; + if (null === root) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + root = root.gestures; + for (var update = queue.pending; null !== update; ) { + if (root === update.gesture) { + current = previous; + break; + } + update = update.next; + } + } + null !== queue.pending && (currentlyRenderingFiber.lanes |= 64); + return [current, startGestureOnHook]; + } function pushDebugInfo(debugInfo) { var previousDebugInfo = currentDebugInfo; null != debugInfo && @@ -8752,7 +8839,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -9068,7 +9155,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 +9235,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 +9268,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 +9290,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 +9309,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 +9323,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 +9352,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 +9365,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 +9383,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -9356,33 +9435,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_2586; + var JSCompiler_object_inline_stack_2585 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2584 = !1; + var JSCompiler_object_inline_message_2583 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2587 = didSuspend) || - (JSCompiler_object_inline_componentStack_2587 = + (JSCompiler_object_inline_componentStack_2586 = didSuspend) || + (JSCompiler_object_inline_componentStack_2586 = 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_2586 && + ((JSCompiler_object_inline_message_2583 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2587 = + JSCompiler_object_inline_componentStack_2586 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2584 + JSCompiler_object_inline_message_2583 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2585 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2584 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2585)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2584)) { c: { - var instance = JSCompiler_object_inline_digest_2585; + var instance = JSCompiler_object_inline_digest_2584; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -9424,87 +9503,87 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2585 + JSCompiler_object_inline_digest_2584 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2585 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2584 = 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_2584 && + ((JSCompiler_object_inline_digest_2584 = + JSCompiler_object_inline_digest_2584.dehydrated), + null !== JSCompiler_object_inline_digest_2584) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2585) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2584) ? (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_2584 = + JSCompiler_object_inline_stack_2585.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2585.fallback; + if (JSCompiler_object_inline_message_2583) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2586 = + (JSCompiler_object_inline_stack_2585 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2585, + JSCompiler_object_inline_digest_2584, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2584 = workInProgress.child), - (JSCompiler_object_inline_message_2584.memoizedState = + (JSCompiler_object_inline_message_2583 = workInProgress.child), + (JSCompiler_object_inline_message_2583.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2584.childLanes = + (JSCompiler_object_inline_message_2583.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2586, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2585 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2586.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2585.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2586 = + (JSCompiler_object_inline_stack_2585 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2585, + JSCompiler_object_inline_digest_2584, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2584 = workInProgress.child), - (JSCompiler_object_inline_message_2584.memoizedState = + (JSCompiler_object_inline_message_2583 = workInProgress.child), + (JSCompiler_object_inline_message_2583.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2584.childLanes = + (JSCompiler_object_inline_message_2583.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2586, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2585 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2585 + JSCompiler_object_inline_digest_2584 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2585 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2585) + ((JSCompiler_object_inline_digest_2584 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2584) ) { if (didSuspend) workInProgress.flags & 256 @@ -9521,94 +9600,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_2583 = + JSCompiler_object_inline_stack_2585.fallback), + (JSCompiler_object_inline_digest_2584 = workInProgress.mode), + (JSCompiler_object_inline_stack_2585 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2586.children + children: JSCompiler_object_inline_stack_2585.children }, - JSCompiler_object_inline_digest_2585 + JSCompiler_object_inline_digest_2584 )), - (JSCompiler_object_inline_message_2584 = + (JSCompiler_object_inline_message_2583 = createFiberFromFragment( - JSCompiler_object_inline_message_2584, - JSCompiler_object_inline_digest_2585, + JSCompiler_object_inline_message_2583, + JSCompiler_object_inline_digest_2584, 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_2583.flags |= 2), + (JSCompiler_object_inline_stack_2585.return = workInProgress), + (JSCompiler_object_inline_message_2583.return = workInProgress), + (JSCompiler_object_inline_stack_2585.sibling = + JSCompiler_object_inline_message_2583), + (workInProgress.child = JSCompiler_object_inline_stack_2585), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2586 = workInProgress.child), - (JSCompiler_object_inline_stack_2586.memoizedState = + (JSCompiler_object_inline_stack_2585 = workInProgress.child), + (JSCompiler_object_inline_stack_2585.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2586.childLanes = + (JSCompiler_object_inline_stack_2585.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2586, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2584)); + (workInProgress = JSCompiler_object_inline_message_2583)); 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_2584)) ) { - 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_2586 = + JSCompiler_object_inline_digest_2584.nextSibling && + JSCompiler_object_inline_digest_2584.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2586) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2586.dgst; + var message = JSCompiler_object_inline_componentStack_2586.msg; + instance = JSCompiler_object_inline_componentStack_2586.stck; var componentStack = - JSCompiler_object_inline_componentStack_2587.cstck; + JSCompiler_object_inline_componentStack_2586.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_2583 = message; + JSCompiler_object_inline_digest_2584 = JSCompiler_temp; + JSCompiler_object_inline_stack_2585 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2586 = 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_2584 && + ((JSCompiler_object_inline_componentStack_2586 = + JSCompiler_object_inline_message_2583 + ? Error(JSCompiler_object_inline_message_2583) : 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_2586.stack = + JSCompiler_object_inline_stack_2585 || ""), + (JSCompiler_object_inline_componentStack_2586.digest = + JSCompiler_object_inline_digest_2584), + (JSCompiler_object_inline_stack_2585 = void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2584 = { - value: JSCompiler_object_inline_componentStack_2587, + (JSCompiler_object_inline_message_2583 = { + value: JSCompiler_object_inline_componentStack_2586, source: null, - stack: JSCompiler_object_inline_stack_2586 + stack: JSCompiler_object_inline_stack_2585 }), - "string" === typeof JSCompiler_object_inline_stack_2586 && + "string" === typeof JSCompiler_object_inline_stack_2585 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2587, - JSCompiler_object_inline_message_2584 + JSCompiler_object_inline_componentStack_2586, + JSCompiler_object_inline_message_2583 ), - queueHydrationError(JSCompiler_object_inline_message_2584)); + queueHydrationError(JSCompiler_object_inline_message_2583)); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9622,44 +9701,44 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2587 = + (JSCompiler_object_inline_componentStack_2586 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2587) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2586) ) { - JSCompiler_object_inline_componentStack_2587 = workInProgressRoot; + JSCompiler_object_inline_componentStack_2586 = 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_2586 && + ((JSCompiler_object_inline_stack_2585 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2585 = + 0 !== (JSCompiler_object_inline_stack_2585 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2585 )), - (JSCompiler_object_inline_stack_2586 = + (JSCompiler_object_inline_stack_2585 = 0 !== - (JSCompiler_object_inline_stack_2586 & - (JSCompiler_object_inline_componentStack_2587.suspendedLanes | + (JSCompiler_object_inline_stack_2585 & + (JSCompiler_object_inline_componentStack_2586.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_2585), + 0 !== JSCompiler_object_inline_stack_2585 && + JSCompiler_object_inline_stack_2585 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2586), + ((prevState.retryLane = JSCompiler_object_inline_stack_2585), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2585 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2586, current, - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2585 ), SelectiveHydrationException) ); - JSCompiler_object_inline_digest_2585.data === + JSCompiler_object_inline_digest_2584.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9667,14 +9746,14 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2585.data === + JSCompiler_object_inline_digest_2584.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_2584.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9692,54 +9771,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2586.children + JSCompiler_object_inline_stack_2585.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2584) + if (JSCompiler_object_inline_message_2583) 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_2583 = + JSCompiler_object_inline_stack_2585.fallback), + (JSCompiler_object_inline_digest_2584 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2586 = createWorkInProgress( + (JSCompiler_object_inline_stack_2585 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2586.children + children: JSCompiler_object_inline_stack_2585.children } )), - (JSCompiler_object_inline_stack_2586.subtreeFlags = + (JSCompiler_object_inline_stack_2585.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_message_2584 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2583 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2584 + JSCompiler_object_inline_message_2583 )) - : ((JSCompiler_object_inline_message_2584 = createFiberFromFragment( - JSCompiler_object_inline_message_2584, - JSCompiler_object_inline_digest_2585, + : ((JSCompiler_object_inline_message_2583 = createFiberFromFragment( + JSCompiler_object_inline_message_2583, + JSCompiler_object_inline_digest_2584, 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_2583.flags |= 2)), + (JSCompiler_object_inline_message_2583.return = workInProgress), + (JSCompiler_object_inline_stack_2585.return = workInProgress), + (JSCompiler_object_inline_stack_2585.sibling = + JSCompiler_object_inline_message_2583), + (workInProgress.child = JSCompiler_object_inline_stack_2585), + (JSCompiler_object_inline_stack_2585 = + JSCompiler_object_inline_message_2583), + (JSCompiler_object_inline_message_2583 = workInProgress.child), + (JSCompiler_object_inline_digest_2584 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2584 + ? (JSCompiler_object_inline_digest_2584 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2585.cachePool), + JSCompiler_object_inline_digest_2584.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9747,38 +9826,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2585 = { + (JSCompiler_object_inline_digest_2584 = { baseLanes: - JSCompiler_object_inline_digest_2585.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2584.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_2583.memoizedState = + JSCompiler_object_inline_digest_2584), + (JSCompiler_object_inline_message_2583.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2587, + JSCompiler_object_inline_componentStack_2586, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2586 + JSCompiler_object_inline_stack_2585 ); 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_2585.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2587 = + ((JSCompiler_object_inline_componentStack_2586 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2587 + null === JSCompiler_object_inline_componentStack_2586 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2587.push(current)); + : JSCompiler_object_inline_componentStack_2586.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11538,7 +11617,7 @@ selectionRange: JSCompiler_temp }; shouldStartViewTransition = _enabled = !1; - committedLanes = (committedLanes & 335544192) === committedLanes; + committedLanes = (committedLanes & 335544064) === committedLanes; nextEffect = firstChild; for (firstChild = committedLanes ? 9238 : 1028; null !== nextEffect; ) { root = nextEffect; @@ -13098,7 +13177,7 @@ viewTransitionMutationContext = !1; recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); - (lanes & 335544192) === lanes && + (lanes & 335544064) === lanes && null !== current && viewTransitionMutationContext && (finishedWork.flags |= 4); @@ -13561,7 +13640,7 @@ endTime ) { var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; if ( parentFiber.subtreeFlags & (isViewTransitionEligible ? 10262 : 10256) || (0 !== parentFiber.actualDuration && @@ -13602,7 +13681,7 @@ inHydratedSubtree ); var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; isViewTransitionEligible && null === finishedWork.alternate && null !== finishedWork.return && @@ -14963,7 +15042,7 @@ resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -15904,7 +15983,7 @@ } yieldDuration = (forceSync = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root.expiredLanes)) || checkIfRootIsPrerendering(root, lanes)) ? renderRootConcurrent(root, lanes) @@ -16011,15 +16090,15 @@ case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case RootSuspendedAtTheShell: setCurrentTrackFromLanes(lanes); logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); yieldEndTime = lanes; - 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60) + 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 124) ? (blockingSuspendedTime = startTime) - : 0 !== (yieldEndTime & 4194176) && + : 0 !== (yieldEndTime & 4194048) && (transitionSuspendedTime = startTime); markRootSuspended( forceSync, @@ -16132,7 +16211,7 @@ ) { root.timeoutHandle = noTimeout; var subtreeFlags = finishedWork.subtreeFlags, - isViewTransitionEligible = (lanes & 335544192) === lanes; + isViewTransitionEligible = (lanes & 335544064) === lanes; if ( isViewTransitionEligible || subtreeFlags & 8192 || @@ -16281,9 +16360,9 @@ } } function finalizeRender(lanes, finalizationTime) { - if (0 !== (lanes & 3) || 0 !== (lanes & 60)) + if (0 !== (lanes & 3) || 0 !== (lanes & 124)) blockingClampTime = finalizationTime; - 0 !== (lanes & 4194176) && (transitionClampTime = finalizationTime); + 0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime); } function prepareFreshStack(root, lanes) { supportsUserTiming && @@ -16308,13 +16387,13 @@ var endTime = renderStartTime; supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), performance.measure( (lanes & 536870912) === lanes ? "Prewarm" - : (lanes & 201326677) === lanes + : (lanes & 201326741) === lanes ? "Interrupted Hydration" : "Interrupted Render", reusableLaneOptions @@ -16322,7 +16401,7 @@ } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } - if (0 !== (lanes & 3) || 0 !== (lanes & 60)) { + if (0 !== (lanes & 3) || 0 !== (lanes & 124)) { previousRenderStartTime = 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime ? blockingClampTime @@ -16365,7 +16444,7 @@ 0 < previousRenderStartTime && ((reusableLaneDevToolDetails.color = isSpawnedUpdate ? "error" - : (lanes & 738197589) === lanes + : (lanes & 738197653) === lanes ? "tertiary-light" : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), @@ -16378,7 +16457,7 @@ blockingEventIsRepeat = !0; blockingSpawnedUpdate = !1; } - 0 !== (lanes & 4194176) && + 0 !== (lanes & 4194048) && ((previousRenderStartTime = 0 <= transitionStartTime && transitionStartTime < transitionClampTime ? transitionClampTime @@ -16527,7 +16606,7 @@ function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -17038,6 +17117,7 @@ didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes; didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + null === root.gestures && (didIncludeRenderPhaseUpdate &= -65); markRootFinished( root, lanes, @@ -17049,68 +17129,71 @@ root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - pendingFinishedWork = finishedWork; - pendingEffectsRoot = root; - pendingEffectsLanes = lanes; - pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; - pendingPassiveTransitions = transitions; - pendingRecoverableErrors = recoverableErrors; - pendingEffectsRenderEndTime = completedRenderEndTime; - pendingSuspendedCommitReason = suspendedCommitReason; - pendingViewTransitionEvents = null; - (lanes & 335544192) === lanes - ? ((pendingTransitionTypes = ReactSharedInternals.V), - (ReactSharedInternals.V = null), - (recoverableErrors = 10262)) - : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); - 0 !== finishedWork.actualDuration || - 0 !== (finishedWork.subtreeFlags & recoverableErrors) || - 0 !== (finishedWork.flags & recoverableErrors) - ? ((root.callbackNode = null), - (root.callbackPriority = 0), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), (root.callbackPriority = 0)); - commitErrors = null; - commitStartTime = now(); - suspendedCommitReason === SUSPENDED_COMMIT - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : suspendedCommitReason === THROTTLED_COMMIT && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - suspendedCommitReason = 0 !== (finishedWork.flags & 13878); - if ( - 0 !== (finishedWork.subtreeFlags & 13878) || - suspendedCommitReason - ) { - suspendedCommitReason = ReactSharedInternals.T; - ReactSharedInternals.T = null; - completedRenderEndTime = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = DiscreteEventPriority; - recoverableErrors = executionContext; - executionContext |= CommitContext; - try { - commitBeforeMutationEffects(root, finishedWork, lanes); - } finally { - (executionContext = recoverableErrors), - (ReactDOMSharedInternals.p = completedRenderEndTime), - (ReactSharedInternals.T = suspendedCommitReason); + if (64 === lanes) commitGestureOnRoot(root); + else { + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingEffectsRenderEndTime = completedRenderEndTime; + pendingSuspendedCommitReason = suspendedCommitReason; + pendingViewTransitionEvents = null; + (lanes & 335544064) === lanes + ? ((pendingTransitionTypes = ReactSharedInternals.V), + (ReactSharedInternals.V = null), + (recoverableErrors = 10262)) + : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & recoverableErrors) || + 0 !== (finishedWork.flags & recoverableErrors) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback$1(NormalPriority$1, function () { + schedulerEvent = window.event; + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitErrors = null; + commitStartTime = now(); + suspendedCommitReason === SUSPENDED_COMMIT + ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) + : suspendedCommitReason === THROTTLED_COMMIT && + logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); + suspendedCommitReason = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + suspendedCommitReason + ) { + suspendedCommitReason = ReactSharedInternals.T; + ReactSharedInternals.T = null; + completedRenderEndTime = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + recoverableErrors = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork, lanes); + } finally { + (executionContext = recoverableErrors), + (ReactDOMSharedInternals.p = completedRenderEndTime), + (ReactSharedInternals.T = suspendedCommitReason); + } } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + (shouldStartViewTransition && + startViewTransition( + root.containerInfo, + pendingTransitionTypes, + flushMutationEffects, + flushLayoutEffects, + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects + )) || + (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } - pendingEffectsStatus = PENDING_MUTATION_PHASE; - (shouldStartViewTransition && - startViewTransition( - root.containerInfo, - pendingTransitionTypes, - flushMutationEffects, - flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects - )) || - (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } } function flushAfterMutationEffects() { @@ -17319,7 +17402,7 @@ (reusableLaneOptions.start = completedRenderEndTime), (reusableLaneOptions.end = suspendedCommitReason), performance.measure("Commit", reusableLaneOptions)); - completedRenderEndTime = (lanes & 335544192) === lanes ? 10262 : 10256; + completedRenderEndTime = (lanes & 335544064) === lanes ? 10262 : 10256; (completedRenderEndTime = 0 !== finishedWork.actualDuration || 0 !== (finishedWork.subtreeFlags & completedRenderEndTime) || @@ -17415,7 +17498,7 @@ 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); suspendedCommitReason = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (suspendedCommitReason & 42) + 0 !== (lanes & 4194090) && 0 !== (suspendedCommitReason & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -17425,6 +17508,14 @@ flushSyncWorkAcrossRoots_impl(0, !1); } } + function commitGestureOnRoot(root) { + var finishedGesture = root.gestures; + if (null === finishedGesture) + throw Error( + "Finished rendering the gesture lane but there were no pending gestures. React should not have started a render in this case. This is a bug in React." + ); + deleteScheduledGesture(root, finishedGesture); + } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; Object.defineProperty(componentStack, "digest", { @@ -17634,10 +17725,10 @@ null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; root.warmLanes &= ~pingedLanes; - 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 60) + 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 124) ? 0 > blockingUpdateTime && (blockingClampTime = blockingUpdateTime = now()) - : 0 !== (pingedLanes & 4194176) && + : 0 !== (pingedLanes & 4194048) && 0 > transitionUpdateTime && (transitionClampTime = transitionUpdateTime = now()); isConcurrentActEnvironment() && @@ -17839,8 +17930,8 @@ (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); nextLanes = - nextLanes & 201326677 - ? (nextLanes & 201326677) | 1 + nextLanes & 201326741 + ? (nextLanes & 201326741) | 1 : nextLanes ? nextLanes | 2 : 0; @@ -17856,7 +17947,7 @@ null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout )), - 0 === (nextLanes & 3) || + (0 === (nextLanes & 3) && 64 !== nextLanes) || checkIfRootIsPrerendering(root, nextLanes) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); @@ -17892,7 +17983,10 @@ null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev); else if ( - ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3)) + ((prev = root), + 0 !== syncTransitionLanes || + 0 !== (nextLanes & 3) || + 64 === nextLanes) ) mightHavePendingSyncWork = !0; root = next; @@ -22422,6 +22516,7 @@ this.pooledCache = null; this.pooledCacheLanes = 0; this.formState = formState; + this.gestures = null; this.incompleteTransitions = new Map(); this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); @@ -23248,7 +23343,7 @@ clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log = Math.log, LN2 = Math.LN2, - nextTransitionLane = 128, + nextTransitionLane = 256, nextRetryLane = 4194304, DiscreteEventPriority = 2, ContinuousEventPriority = 8, @@ -24975,6 +25070,7 @@ useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; + ContextOnlyDispatcher.useSwipeTransition = throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -25120,6 +25216,11 @@ currentHookNameInDev = "useEffectEvent"; mountHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + mountHookTypesDev(); + return mountSwipeTransition(previous, current); } }; HooksDispatcherOnMountWithHookTypesInDEV = { @@ -25254,6 +25355,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; HooksDispatcherOnUpdateInDEV = { @@ -25388,6 +25494,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; HooksDispatcherOnRerenderInDEV = { @@ -25522,6 +25633,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnMountInDEV = { @@ -25681,6 +25797,12 @@ warnInvalidHookAccess(); mountHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnUpdateInDEV = { @@ -25840,6 +25962,12 @@ warnInvalidHookAccess(); updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnRerenderInDEV = { @@ -25999,6 +26127,12 @@ warnInvalidHookAccess(); updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; var callComponent = { @@ -26940,11 +27074,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26981,10 +27115,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-e670e72f-20250214" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27456,7 +27590,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-e670e72f-20250214"; "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 2eeacd5c4bb10..28cc5119661fe 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 @@ -403,7 +403,7 @@ function clz32Fallback(x) { x >>>= 0; return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } -var nextTransitionLane = 128, +var nextTransitionLane = 256, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { var pendingSyncLanes = lanes & 42; @@ -424,6 +424,7 @@ function getHighestPriorityLanes(lanes) { case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -438,7 +439,7 @@ function getHighestPriorityLanes(lanes) { case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -494,7 +495,7 @@ function getNextLanes(root, wipLanes, rootHasPendingCommit) { ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -512,10 +513,10 @@ function computeExpirationTime(lane, currentTime) { case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -550,7 +551,7 @@ function computeExpirationTime(lane, currentTime) { function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -624,7 +625,7 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -647,7 +648,6 @@ function getBumpedLaneForHydrationByLane(lane) { case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -666,7 +666,7 @@ function getBumpedLaneForHydrationByLane(lane) { case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -2114,19 +2114,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$310; + var JSCompiler_inline_result$jscomp$311; if (canUseDOM) { - var isSupported$jscomp$inline_449 = "oninput" in document; - if (!isSupported$jscomp$inline_449) { - var element$jscomp$inline_450 = document.createElement("div"); - element$jscomp$inline_450.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_449 = - "function" === typeof element$jscomp$inline_450.oninput; + var isSupported$jscomp$inline_450 = "oninput" in document; + if (!isSupported$jscomp$inline_450) { + var element$jscomp$inline_451 = document.createElement("div"); + element$jscomp$inline_451.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_450 = + "function" === typeof element$jscomp$inline_451.oninput; } - JSCompiler_inline_result$jscomp$310 = isSupported$jscomp$inline_449; - } else JSCompiler_inline_result$jscomp$310 = !1; + JSCompiler_inline_result$jscomp$311 = isSupported$jscomp$inline_450; + } else JSCompiler_inline_result$jscomp$311 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$310 && + JSCompiler_inline_result$jscomp$311 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2438,6 +2438,11 @@ function enqueueConcurrentRenderForLane(fiber, lane) { enqueueUpdate$1(fiber, null, null, lane); return getRootForUpdatedFiber(fiber); } +function enqueueGestureRender(fiber) { + fiber = markUpdateLaneFromFiberToRoot(fiber, null, 64); + null !== fiber && markRootUpdated$1(fiber, 64); + return fiber; +} function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { sourceFiber.lanes |= lane; var alternate = sourceFiber.alternate; @@ -2451,17 +2456,19 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (50 < nestedUpdateCount) @@ -2517,7 +2524,7 @@ function startUpdateTimerByLane(lane) { (blockingEventTime = lane), (blockingEventType = JSCompiler_temp)); else if ( - 0 !== (lane & 4194176) && + 0 !== (lane & 4194048) && 0 > transitionUpdateTime && ((transitionUpdateTime = now()), 0 > transitionStartTime) ) { @@ -2631,9 +2638,9 @@ var supportsUserTiming = }; function setCurrentTrackFromLanes(lanes) { reusableLaneDevToolDetails.track = - lanes & 63 + lanes & 127 ? "Blocking" - : lanes & 4194240 + : lanes & 4194176 ? "Transition" : lanes & 62914560 ? "Suspense" @@ -2763,13 +2770,13 @@ function logComponentEffect(fiber, startTime, endTime, selfTime, errors) { function logRenderPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure( (lanes & 536870912) === lanes ? "Prepared" - : (lanes & 201326677) === lanes + : (lanes & 201326741) === lanes ? "Hydrated" : "Render", reusableLaneOptions @@ -2778,7 +2785,7 @@ function logRenderPhase(startTime, endTime, lanes) { function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); @@ -2786,7 +2793,7 @@ function logSuspendedRenderPhase(startTime, endTime, lanes) { function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -3099,7 +3106,7 @@ function enqueueUpdate(fiber, update, lane) { } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -3648,6 +3655,28 @@ function getSuspendedCache() { ? null : { parent: CacheContext._currentValue, pool: cacheFromPool }; } +function scheduleGesture(root, provider) { + for (var prev = root.gestures; null !== prev; ) { + if (prev.provider === provider) return prev.count++, prev; + var next = prev.next; + if (null === next) break; + prev = next; + } + provider = { provider: provider, count: 1, prev: prev, next: null }; + null === prev ? (root.gestures = provider) : (prev.next = provider); + ensureRootIsScheduled(root); + return provider; +} +function deleteScheduledGesture(root, gesture) { + null === gesture.prev + ? root.gestures === gesture && + ((root.gestures = gesture.next), + null === root.gestures && (root.pendingLanes &= -65)) + : ((gesture.prev.next = gesture.next), + null !== gesture.next && (gesture.next.prev = gesture.prev), + (gesture.prev = null), + (gesture.next = null)); +} var renderLanes = 0, currentlyRenderingFiber = null, currentHook = null, @@ -4054,7 +4083,7 @@ function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { ); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -4774,7 +4803,7 @@ function enqueueRenderPhaseUpdate(queue, update) { queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -4782,6 +4811,49 @@ function entangleTransitionUpdate(root, queue, lane) { markRootEntangled(root, lane); } } +function startGesture(fiber, queue, gestureProvider) { + var root = enqueueGestureRender(fiber); + if (null === root) return function () {}; + var update = { + gesture: scheduleGesture(root, gestureProvider), + prev: null, + next: queue.pending + }; + null !== queue.pending && (queue.pending.prev = update); + queue.pending = update; + return function () { + if (null === update.prev) + if (queue.pending === update) queue.pending = update.next; + else return; + else + (update.prev.next = update.next), + null !== update.next && (update.next.prev = update.prev), + (update.prev = null), + (update.next = null); + var cancelledGestured = update.gesture; + cancelledGestured.count--; + 0 === cancelledGestured.count && + deleteScheduledGesture(root, cancelledGestured); + }; +} +function updateSwipeTransition(previous, current) { + var queue = updateWorkInProgressHook().queue, + startGestureOnHook = queue.dispatch; + if (64 === workInProgressRootRenderLanes) { + var root$50 = workInProgressRoot; + if (null === root$50) throw Error(formatProdErrorMessage(349)); + root$50 = root$50.gestures; + for (var update = queue.pending; null !== update; ) { + if (root$50 === update.gesture) { + current = previous; + break; + } + update = update.next; + } + } + null !== queue.pending && (currentlyRenderingFiber.lanes |= 64); + return [current, startGestureOnHook]; +} var ContextOnlyDispatcher = { readContext: readContext, use: use, @@ -4808,6 +4880,7 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; +ContextOnlyDispatcher.useSwipeTransition = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -4919,7 +4992,7 @@ var HooksDispatcherOnMount = { getServerSnapshot = getSnapshot(); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; @@ -4997,6 +5070,16 @@ var HooksDispatcherOnMount = { throw Error(formatProdErrorMessage(440)); return ref.impl.apply(void 0, arguments); }; + }, + useSwipeTransition: function (previous, current) { + previous = { pending: null, dispatch: null }; + var startGestureOnHook = (previous.dispatch = startGesture.bind( + null, + currentlyRenderingFiber, + previous + )); + mountWorkInProgressHook().queue = previous; + return [current, startGestureOnHook]; } }, HooksDispatcherOnUpdate = { @@ -5047,6 +5130,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: updateRefresh }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; +HooksDispatcherOnUpdate.useSwipeTransition = updateSwipeTransition; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -5100,6 +5184,7 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; +HooksDispatcherOnRerender.useSwipeTransition = updateSwipeTransition; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -5954,9 +6039,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$79) { + } catch (e$80) { setTimeout(function () { - throw e$79; + throw e$80; }); } } @@ -5967,9 +6052,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$80) { + } catch (e$81) { setTimeout(function () { - throw e$80; + throw e$81; }); } } @@ -8063,8 +8148,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$122) { - captureCommitPhaseError(current, nearestMountedAncestor, error$122); + } catch (error$123) { + captureCommitPhaseError(current, nearestMountedAncestor, error$123); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -8130,8 +8215,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordEffectDuration(current); } else ref(null); - } catch (error$123) { - captureCommitPhaseError(current, nearestMountedAncestor, error$123); + } catch (error$124) { + captureCommitPhaseError(current, nearestMountedAncestor, error$124); } else ref.current = null; } @@ -8385,7 +8470,7 @@ function commitBeforeMutationEffects(root, firstChild, committedLanes) { } else JSCompiler_temp = null; selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; shouldStartViewTransition = _enabled = !1; - committedLanes = (committedLanes & 335544192) === committedLanes; + committedLanes = (committedLanes & 335544064) === committedLanes; nextEffect = firstChild; for (firstChild = committedLanes ? 9238 : 1028; null !== nextEffect; ) { root = nextEffect; @@ -8968,11 +9053,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$119) { + } catch (error$120) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$119 + error$120 ); } else { @@ -8989,11 +9074,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$120) { + } catch (error$121) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$120 + error$121 ); } recordEffectDuration(); @@ -9004,11 +9089,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$121) { + } catch (error$122) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$121 + error$122 ); } } @@ -9817,7 +9902,7 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { viewTransitionMutationContext = !1; recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); - (lanes & 335544192) === lanes && + (lanes & 335544064) === lanes && null !== current && viewTransitionMutationContext && (finishedWork.flags |= 4); @@ -9864,21 +9949,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$124 = JSCompiler_inline_result.stateNode; + var parent$125 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$124, ""), + (setTextContent(parent$125, ""), (JSCompiler_inline_result.flags &= -33)); - var before$125 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$125, parent$124); + var before$126 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$126, parent$125); break; case 3: case 4: - var parent$126 = JSCompiler_inline_result.stateNode.containerInfo, - before$127 = getHostSibling(finishedWork); + var parent$127 = JSCompiler_inline_result.stateNode.containerInfo, + before$128 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$127, - parent$126 + before$128, + parent$127 ); break; default: @@ -10288,7 +10373,7 @@ function recursivelyTraversePassiveMountEffects( endTime ) { var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; if ( parentFiber.subtreeFlags & (isViewTransitionEligible ? 10262 : 10256) || (0 !== parentFiber.actualDuration && @@ -10329,7 +10414,7 @@ function commitPassiveMountOnFiber( inHydratedSubtree ); var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; isViewTransitionEligible && null === finishedWork.alternate && null !== finishedWork.return && @@ -11475,7 +11560,7 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -11513,14 +11598,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$152 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$152 = lastTailNode), + for (var lastTailNode$153 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$153 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$152 + null === lastTailNode$153 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$152.sibling = null); + : (lastTailNode$153.sibling = null); } } function bubbleProperties(completedWork) { @@ -11532,53 +11617,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$154 = completedWork.selfBaseDuration, - child$155 = completedWork.child; - null !== child$155; + var treeBaseDuration$155 = completedWork.selfBaseDuration, + child$156 = completedWork.child; + null !== child$156; ) - (newChildLanes |= child$155.lanes | child$155.childLanes), - (subtreeFlags |= child$155.subtreeFlags & 65011712), - (subtreeFlags |= child$155.flags & 65011712), - (treeBaseDuration$154 += child$155.treeBaseDuration), - (child$155 = child$155.sibling); - completedWork.treeBaseDuration = treeBaseDuration$154; + (newChildLanes |= child$156.lanes | child$156.childLanes), + (subtreeFlags |= child$156.subtreeFlags & 65011712), + (subtreeFlags |= child$156.flags & 65011712), + (treeBaseDuration$155 += child$156.treeBaseDuration), + (child$156 = child$156.sibling); + completedWork.treeBaseDuration = treeBaseDuration$155; } else for ( - treeBaseDuration$154 = completedWork.child; - null !== treeBaseDuration$154; + treeBaseDuration$155 = completedWork.child; + null !== treeBaseDuration$155; ) (newChildLanes |= - treeBaseDuration$154.lanes | treeBaseDuration$154.childLanes), - (subtreeFlags |= treeBaseDuration$154.subtreeFlags & 65011712), - (subtreeFlags |= treeBaseDuration$154.flags & 65011712), - (treeBaseDuration$154.return = completedWork), - (treeBaseDuration$154 = treeBaseDuration$154.sibling); + treeBaseDuration$155.lanes | treeBaseDuration$155.childLanes), + (subtreeFlags |= treeBaseDuration$155.subtreeFlags & 65011712), + (subtreeFlags |= treeBaseDuration$155.flags & 65011712), + (treeBaseDuration$155.return = completedWork), + (treeBaseDuration$155 = treeBaseDuration$155.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$154 = completedWork.actualDuration; - child$155 = completedWork.selfBaseDuration; + treeBaseDuration$155 = completedWork.actualDuration; + child$156 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$154 += child.actualDuration), - (child$155 += child.treeBaseDuration), + (treeBaseDuration$155 += child.actualDuration), + (child$156 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$154; - completedWork.treeBaseDuration = child$155; + completedWork.actualDuration = treeBaseDuration$155; + completedWork.treeBaseDuration = child$156; } else for ( - treeBaseDuration$154 = completedWork.child; - null !== treeBaseDuration$154; + treeBaseDuration$155 = completedWork.child; + null !== treeBaseDuration$155; ) (newChildLanes |= - treeBaseDuration$154.lanes | treeBaseDuration$154.childLanes), - (subtreeFlags |= treeBaseDuration$154.subtreeFlags), - (subtreeFlags |= treeBaseDuration$154.flags), - (treeBaseDuration$154.return = completedWork), - (treeBaseDuration$154 = treeBaseDuration$154.sibling); + treeBaseDuration$155.lanes | treeBaseDuration$155.childLanes), + (subtreeFlags |= treeBaseDuration$155.subtreeFlags), + (subtreeFlags |= treeBaseDuration$155.flags), + (treeBaseDuration$155.return = completedWork), + (treeBaseDuration$155 = treeBaseDuration$155.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -11875,11 +11960,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$171 = null; + var cache$172 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$171 = newProps.memoizedState.cachePool.pool); - cache$171 !== type && (newProps.flags |= 2048); + (cache$172 = newProps.memoizedState.cachePool.pool); + cache$172 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -11909,8 +11994,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$171 = type.rendering; - if (null === cache$171) + cache$172 = type.rendering; + if (null === cache$172) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -11918,11 +12003,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$171 = findFirstSuspended(current); - if (null !== cache$171) { + cache$172 = findFirstSuspended(current); + if (null !== cache$172) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$171.updateQueue; + current = cache$172.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -11947,7 +12032,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$171)), null !== current)) { + if (((current = findFirstSuspended(cache$172)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -11957,7 +12042,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$171.alternate && + !cache$172.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -11970,13 +12055,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$171.sibling = workInProgress.child), - (workInProgress.child = cache$171)) + ? ((cache$172.sibling = workInProgress.child), + (workInProgress.child = cache$172)) : ((current = type.last), null !== current - ? (current.sibling = cache$171) - : (workInProgress.child = cache$171), - (type.last = cache$171)); + ? (current.sibling = cache$172) + : (workInProgress.child = cache$172), + (type.last = cache$172)); } if (null !== type.tail) return ( @@ -12297,7 +12382,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } var exitStatus = (yieldEndTime = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root$jscomp$0.expiredLanes)) || checkIfRootIsPrerendering(root$jscomp$0, lanes)) ? renderRootConcurrent(root$jscomp$0, lanes) @@ -12388,15 +12473,15 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { case 1: throw Error(formatProdErrorMessage(345)); case 4: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case 6: setCurrentTrackFromLanes(lanes); logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); forceSync = lanes; - 0 !== (forceSync & 3) || 0 !== (forceSync & 60) + 0 !== (forceSync & 3) || 0 !== (forceSync & 124) ? (blockingSuspendedTime = startTime) - : 0 !== (forceSync & 4194176) && + : 0 !== (forceSync & 4194048) && (transitionSuspendedTime = startTime); markRootSuspended( yieldEndTime, @@ -12488,7 +12573,7 @@ function commitRootWhenReady( ) { root.timeoutHandle = -1; var subtreeFlags = finishedWork.subtreeFlags, - isViewTransitionEligible = (lanes & 335544192) === lanes; + isViewTransitionEligible = (lanes & 335544064) === lanes; if ( isViewTransitionEligible || subtreeFlags & 8192 || @@ -12629,9 +12714,9 @@ function resetWorkInProgressStack() { } } function finalizeRender(lanes, finalizationTime) { - if (0 !== (lanes & 3) || 0 !== (lanes & 60)) + if (0 !== (lanes & 3) || 0 !== (lanes & 124)) blockingClampTime = finalizationTime; - 0 !== (lanes & 4194176) && (transitionClampTime = finalizationTime); + 0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime); } function prepareFreshStack(root, lanes) { supportsUserTiming && @@ -12652,13 +12737,13 @@ function prepareFreshStack(root, lanes) { var endTime = renderStartTime; supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), performance.measure( (lanes & 536870912) === lanes ? "Prewarm" - : (lanes & 201326677) === lanes + : (lanes & 201326741) === lanes ? "Interrupted Hydration" : "Interrupted Render", reusableLaneOptions @@ -12666,7 +12751,7 @@ function prepareFreshStack(root, lanes) { } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } - if (0 !== (lanes & 3) || 0 !== (lanes & 60)) { + if (0 !== (lanes & 3) || 0 !== (lanes & 124)) { previousRenderStartTime = 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime ? blockingClampTime @@ -12709,7 +12794,7 @@ function prepareFreshStack(root, lanes) { 0 < previousRenderStartTime && ((reusableLaneDevToolDetails.color = isSpawnedUpdate ? "error" - : (lanes & 738197589) === lanes + : (lanes & 738197653) === lanes ? "tertiary-light" : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), @@ -12722,7 +12807,7 @@ function prepareFreshStack(root, lanes) { blockingEventIsRepeat = !0; blockingSpawnedUpdate = !1; } - 0 !== (lanes & 4194176) && + 0 !== (lanes & 4194048) && ((previousRenderStartTime = 0 <= transitionStartTime && transitionStartTime < transitionClampTime ? transitionClampTime @@ -12860,7 +12945,7 @@ function pushAsyncDispatcher() { function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -12934,8 +13019,8 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$192) { - handleThrow(root, thrownValue$192); + } catch (thrownValue$193) { + handleThrow(root, thrownValue$193); } while (1); lanes && root.shellSuspendCounter++; @@ -13056,8 +13141,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrentByScheduler(); break; - } catch (thrownValue$194) { - handleThrow(root, thrownValue$194); + } catch (thrownValue$195) { + handleThrow(root, thrownValue$195); } while (1); lastContextDependency = currentlyRenderingFiber$1 = null; @@ -13293,6 +13378,7 @@ function commitRoot( if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes; didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + null === root.gestures && (didIncludeRenderPhaseUpdate &= -65); markRootFinished( root, lanes, @@ -13304,65 +13390,68 @@ function commitRoot( root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - pendingFinishedWork = finishedWork; - pendingEffectsRoot = root; - pendingEffectsLanes = lanes; - pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; - pendingPassiveTransitions = transitions; - pendingRecoverableErrors = recoverableErrors; - pendingEffectsRenderEndTime = completedRenderEndTime; - pendingSuspendedCommitReason = suspendedCommitReason; - pendingViewTransitionEvents = null; - (lanes & 335544192) === lanes - ? ((pendingTransitionTypes = ReactSharedInternals.V), - (ReactSharedInternals.V = null), - (recoverableErrors = 10262)) - : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); - 0 !== finishedWork.actualDuration || - 0 !== (finishedWork.subtreeFlags & recoverableErrors) || - 0 !== (finishedWork.flags & recoverableErrors) - ? ((root.callbackNode = null), - (root.callbackPriority = 0), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), (root.callbackPriority = 0)); - commitErrors = null; - commitStartTime = now(); - 1 === suspendedCommitReason - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : 2 === suspendedCommitReason && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - suspendedCommitReason = 0 !== (finishedWork.flags & 13878); - if (0 !== (finishedWork.subtreeFlags & 13878) || suspendedCommitReason) { - suspendedCommitReason = ReactSharedInternals.T; - ReactSharedInternals.T = null; - completedRenderEndTime = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = 2; - recoverableErrors = executionContext; - executionContext |= 4; - try { - commitBeforeMutationEffects(root, finishedWork, lanes); - } finally { - (executionContext = recoverableErrors), - (ReactDOMSharedInternals.p = completedRenderEndTime), - (ReactSharedInternals.T = suspendedCommitReason); + if (64 === lanes) commitGestureOnRoot(root); + else { + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingEffectsRenderEndTime = completedRenderEndTime; + pendingSuspendedCommitReason = suspendedCommitReason; + pendingViewTransitionEvents = null; + (lanes & 335544064) === lanes + ? ((pendingTransitionTypes = ReactSharedInternals.V), + (ReactSharedInternals.V = null), + (recoverableErrors = 10262)) + : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & recoverableErrors) || + 0 !== (finishedWork.flags & recoverableErrors) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback$1(NormalPriority$1, function () { + schedulerEvent = window.event; + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitErrors = null; + commitStartTime = now(); + 1 === suspendedCommitReason + ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) + : 2 === suspendedCommitReason && + logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); + suspendedCommitReason = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || suspendedCommitReason) { + suspendedCommitReason = ReactSharedInternals.T; + ReactSharedInternals.T = null; + completedRenderEndTime = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + recoverableErrors = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork, lanes); + } finally { + (executionContext = recoverableErrors), + (ReactDOMSharedInternals.p = completedRenderEndTime), + (ReactSharedInternals.T = suspendedCommitReason); + } } + pendingEffectsStatus = 1; + (shouldStartViewTransition && + startViewTransition( + root.containerInfo, + pendingTransitionTypes, + flushMutationEffects, + flushLayoutEffects, + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects + )) || + (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } - pendingEffectsStatus = 1; - (shouldStartViewTransition && - startViewTransition( - root.containerInfo, - pendingTransitionTypes, - flushMutationEffects, - flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects - )) || - (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } } function flushAfterMutationEffects() { @@ -13553,7 +13642,7 @@ function flushSpawnedWork() { (reusableLaneOptions.start = completedRenderEndTime), (reusableLaneOptions.end = suspendedCommitReason), performance.measure("Commit", reusableLaneOptions)); - completedRenderEndTime = (lanes & 335544192) === lanes ? 10262 : 10256; + completedRenderEndTime = (lanes & 335544064) === lanes ? 10262 : 10256; (completedRenderEndTime = 0 !== finishedWork.actualDuration || 0 !== (finishedWork.subtreeFlags & completedRenderEndTime) || @@ -13631,7 +13720,7 @@ function flushSpawnedWork() { 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); suspendedCommitReason = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (suspendedCommitReason & 42) + 0 !== (lanes & 4194090) && 0 !== (suspendedCommitReason & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -13641,6 +13730,11 @@ function flushSpawnedWork() { flushSyncWorkAcrossRoots_impl(0, !1); } } +function commitGestureOnRoot(root) { + var finishedGesture = root.gestures; + if (null === finishedGesture) throw Error(formatProdErrorMessage(548)); + deleteScheduledGesture(root, finishedGesture); +} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -13806,9 +13900,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; root.warmLanes &= ~pingedLanes; - 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 60) + 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 124) ? 0 > blockingUpdateTime && (blockingClampTime = blockingUpdateTime = now()) - : 0 !== (pingedLanes & 4194176) && + : 0 !== (pingedLanes & 4194048) && 0 > transitionUpdateTime && (transitionClampTime = transitionUpdateTime = now()); workInProgressRoot === root && @@ -13887,41 +13981,42 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$200 = firstScheduledRoot; null !== root$200; ) { + for (var root$201 = firstScheduledRoot; null !== root$201; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$200.pendingLanes; + var pendingLanes = root$201.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$200.suspendedLanes, - pingedLanes = root$200.pingedLanes; + var suspendedLanes = root$201.suspendedLanes, + pingedLanes = root$201.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes); JSCompiler_inline_result = - JSCompiler_inline_result & 201326677 - ? (JSCompiler_inline_result & 201326677) | 1 + JSCompiler_inline_result & 201326741 + ? (JSCompiler_inline_result & 201326741) | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0; } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$200, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$201, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$200, - root$200 === workInProgressRoot ? JSCompiler_inline_result : 0, - null !== root$200.cancelPendingCommit || - -1 !== root$200.timeoutHandle + root$201, + root$201 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$201.cancelPendingCommit || + -1 !== root$201.timeoutHandle )), - 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$200, JSCompiler_inline_result) || + (0 === (JSCompiler_inline_result & 3) && + 64 !== JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$201, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$200, JSCompiler_inline_result)); - root$200 = root$200.next; + performSyncWorkOnRoot(root$201, JSCompiler_inline_result)); + root$201 = root$201.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -13950,7 +14045,8 @@ function processRootScheduleInMicrotask() { null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev); else if ( - ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3)) + ((prev = root), + 0 !== syncTransitionLanes || 0 !== (nextLanes & 3) || 64 === nextLanes) ) mightHavePendingSyncWork = !0; root = next; @@ -14169,20 +14265,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1720 = 0; - i$jscomp$inline_1720 < simpleEventPluginEvents.length; - i$jscomp$inline_1720++ + var i$jscomp$inline_1724 = 0; + i$jscomp$inline_1724 < simpleEventPluginEvents.length; + i$jscomp$inline_1724++ ) { - var eventName$jscomp$inline_1721 = - simpleEventPluginEvents[i$jscomp$inline_1720], - domEventName$jscomp$inline_1722 = - eventName$jscomp$inline_1721.toLowerCase(), - capitalizedEvent$jscomp$inline_1723 = - eventName$jscomp$inline_1721[0].toUpperCase() + - eventName$jscomp$inline_1721.slice(1); + var eventName$jscomp$inline_1725 = + simpleEventPluginEvents[i$jscomp$inline_1724], + domEventName$jscomp$inline_1726 = + eventName$jscomp$inline_1725.toLowerCase(), + capitalizedEvent$jscomp$inline_1727 = + eventName$jscomp$inline_1725[0].toUpperCase() + + eventName$jscomp$inline_1725.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1722, - "on" + capitalizedEvent$jscomp$inline_1723 + domEventName$jscomp$inline_1726, + "on" + capitalizedEvent$jscomp$inline_1727 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15363,34 +15459,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$214 = props[hasSrc]; - if (null != propValue$214) + var propValue$215 = props[hasSrc]; + if (null != propValue$215) switch (hasSrc) { case "name": - hasSrcSet = propValue$214; + hasSrcSet = propValue$215; break; case "type": - propValue = propValue$214; + propValue = propValue$215; break; case "checked": - checked = propValue$214; + checked = propValue$215; break; case "defaultChecked": - defaultChecked = propValue$214; + defaultChecked = propValue$215; break; case "value": - propKey = propValue$214; + propKey = propValue$215; break; case "defaultValue": - defaultValue = propValue$214; + defaultValue = propValue$215; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$214) + if (null != propValue$215) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$214, props, null); + setProp(domElement, tag, hasSrc, propValue$215, props, null); } } initInput( @@ -15527,14 +15623,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$214 in props) - props.hasOwnProperty(propValue$214) && - ((hasSrc = props[propValue$214]), + for (propValue$215 in props) + props.hasOwnProperty(propValue$215) && + ((hasSrc = props[propValue$215]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$214, + propValue$215, hasSrc, props, void 0 @@ -15582,14 +15678,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$231 in nextProps) { - var propKey = nextProps[propKey$231]; - lastProp = lastProps[propKey$231]; + for (var propKey$232 in nextProps) { + var propKey = nextProps[propKey$232]; + lastProp = lastProps[propKey$232]; if ( - nextProps.hasOwnProperty(propKey$231) && + nextProps.hasOwnProperty(propKey$232) && (null != propKey || null != lastProp) ) - switch (propKey$231) { + switch (propKey$232) { case "type": propKey !== lastProp && (viewTransitionMutationContext = !0); type = propKey; @@ -15624,7 +15720,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$231, + propKey$232, propKey, nextProps, lastProp @@ -15643,7 +15739,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$231 = null; + propKey = value = defaultValue = propKey$232 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15675,7 +15771,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (name) { case "value": type !== lastDefaultValue && (viewTransitionMutationContext = !0); - propKey$231 = type; + propKey$232 = type; break; case "defaultValue": type !== lastDefaultValue && (viewTransitionMutationContext = !0); @@ -15698,15 +15794,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$231 - ? updateOptions(domElement, !!lastProps, propKey$231, !1) + null != propKey$232 + ? updateOptions(domElement, !!lastProps, propKey$232, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$231 = null; + propKey = propKey$232 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15731,7 +15827,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (value) { case "value": name !== type && (viewTransitionMutationContext = !0); - propKey$231 = name; + propKey$232 = name; break; case "defaultValue": name !== type && (viewTransitionMutationContext = !0); @@ -15746,17 +15842,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$231, propKey); + updateTextarea(domElement, propKey$232, propKey); return; case "option": - for (var propKey$247 in lastProps) + for (var propKey$248 in lastProps) if ( - ((propKey$231 = lastProps[propKey$247]), - lastProps.hasOwnProperty(propKey$247) && - null != propKey$231 && - !nextProps.hasOwnProperty(propKey$247)) + ((propKey$232 = lastProps[propKey$248]), + lastProps.hasOwnProperty(propKey$248) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$248)) ) - switch (propKey$247) { + switch (propKey$248) { case "selected": domElement.selected = !1; break; @@ -15764,34 +15860,34 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$247, + propKey$248, null, nextProps, - propKey$231 + propKey$232 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$231 = nextProps[lastDefaultValue]), + ((propKey$232 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$231 !== propKey && - (null != propKey$231 || null != propKey)) + propKey$232 !== propKey && + (null != propKey$232 || null != propKey)) ) switch (lastDefaultValue) { case "selected": - propKey$231 !== propKey && (viewTransitionMutationContext = !0); + propKey$232 !== propKey && (viewTransitionMutationContext = !0); domElement.selected = - propKey$231 && - "function" !== typeof propKey$231 && - "symbol" !== typeof propKey$231; + propKey$232 && + "function" !== typeof propKey$232 && + "symbol" !== typeof propKey$232; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$231, + propKey$232, nextProps, propKey ); @@ -15812,24 +15908,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$252 in lastProps) - (propKey$231 = lastProps[propKey$252]), - lastProps.hasOwnProperty(propKey$252) && - null != propKey$231 && - !nextProps.hasOwnProperty(propKey$252) && - setProp(domElement, tag, propKey$252, null, nextProps, propKey$231); + for (var propKey$253 in lastProps) + (propKey$232 = lastProps[propKey$253]), + lastProps.hasOwnProperty(propKey$253) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$253) && + setProp(domElement, tag, propKey$253, null, nextProps, propKey$232); for (checked in nextProps) if ( - ((propKey$231 = nextProps[checked]), + ((propKey$232 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$231 !== propKey && - (null != propKey$231 || null != propKey)) + propKey$232 !== propKey && + (null != propKey$232 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$231) + if (null != propKey$232) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15837,7 +15933,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$231, + propKey$232, nextProps, propKey ); @@ -15845,49 +15941,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$257 in lastProps) - (propKey$231 = lastProps[propKey$257]), - lastProps.hasOwnProperty(propKey$257) && - void 0 !== propKey$231 && - !nextProps.hasOwnProperty(propKey$257) && + for (var propKey$258 in lastProps) + (propKey$232 = lastProps[propKey$258]), + lastProps.hasOwnProperty(propKey$258) && + void 0 !== propKey$232 && + !nextProps.hasOwnProperty(propKey$258) && setPropOnCustomElement( domElement, tag, - propKey$257, + propKey$258, void 0, nextProps, - propKey$231 + propKey$232 ); for (defaultChecked in nextProps) - (propKey$231 = nextProps[defaultChecked]), + (propKey$232 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$231 === propKey || - (void 0 === propKey$231 && void 0 === propKey) || + propKey$232 === propKey || + (void 0 === propKey$232 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$231, + propKey$232, nextProps, propKey ); return; } } - for (var propKey$262 in lastProps) - (propKey$231 = lastProps[propKey$262]), - lastProps.hasOwnProperty(propKey$262) && - null != propKey$231 && - !nextProps.hasOwnProperty(propKey$262) && - setProp(domElement, tag, propKey$262, null, nextProps, propKey$231); + for (var propKey$263 in lastProps) + (propKey$232 = lastProps[propKey$263]), + lastProps.hasOwnProperty(propKey$263) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$263) && + setProp(domElement, tag, propKey$263, null, nextProps, propKey$232); for (lastProp in nextProps) - (propKey$231 = nextProps[lastProp]), + (propKey$232 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$231 === propKey || - (null == propKey$231 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$231, nextProps, propKey); + propKey$232 === propKey || + (null == propKey$232 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$232, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -16648,26 +16744,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$270 = getResourcesFromRoot( + var styles$271 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$271 = styles$270.get(type); - resource$271 || + resource$272 = styles$271.get(type); + resource$272 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$271 = { + (resource$272 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$270.set(type, resource$271), - (styles$270 = JSCompiler_inline_result.querySelector( + styles$271.set(type, resource$272), + (styles$271 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$270._p && - ((resource$271.instance = styles$270), - (resource$271.state.loading = 5)), + !styles$271._p && + ((resource$272.instance = styles$271), + (resource$272.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16680,16 +16776,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$270 || + styles$271 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$271.state + resource$272.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$271; + return resource$272; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16786,37 +16882,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$276 = hoistableRoot.querySelector( + var instance$277 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$276) + if (instance$277) return ( (resource.state.loading |= 4), - (resource.instance = instance$276), - markNodeAsHoistable(instance$276), - instance$276 + (resource.instance = instance$277), + markNodeAsHoistable(instance$277), + instance$277 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$276 = ( + instance$277 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$276); - var linkInstance = instance$276; + markNodeAsHoistable(instance$277); + var linkInstance = instance$277; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$276, "link", instance); + setInitialProperties(instance$277, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$276, props.precedence, hoistableRoot); - return (resource.instance = instance$276); + insertStylesheet(instance$277, props.precedence, hoistableRoot); + return (resource.instance = instance$277); case "script": - instance$276 = getScriptKey(props.src); + instance$277 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$276) + getScriptSelectorFromKey(instance$277) )) ) return ( @@ -16825,7 +16921,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$276))) + if ((styleProps = preloadPropsMap.get(instance$277))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17157,6 +17253,7 @@ function FiberRootNode( this.pooledCache = null; this.pooledCacheLanes = 0; this.formState = formState; + this.gestures = null; this.incompleteTransitions = new Map(); this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); @@ -17861,16 +17958,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1972 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1976 = React.version; if ( - "19.1.0-experimental-cbbe8666-20250213" !== - isomorphicReactPackageVersion$jscomp$inline_1972 + "19.1.0-experimental-e670e72f-20250214" !== + isomorphicReactPackageVersion$jscomp$inline_1976 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1972, - "19.1.0-experimental-cbbe8666-20250213" + isomorphicReactPackageVersion$jscomp$inline_1976, + "19.1.0-experimental-e670e72f-20250214" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -17890,24 +17987,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2500 = { +var internals$jscomp$inline_2504 = { bundleType: 0, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-e670e72f-20250214" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2501 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2505 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2501.isDisabled && - hook$jscomp$inline_2501.supportsFiber + !hook$jscomp$inline_2505.isDisabled && + hook$jscomp$inline_2505.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2501.inject( - internals$jscomp$inline_2500 + (rendererID = hook$jscomp$inline_2505.inject( + internals$jscomp$inline_2504 )), - (injectedHook = hook$jscomp$inline_2501); + (injectedHook = hook$jscomp$inline_2505); } catch (err) {} } function noop() {} @@ -18160,7 +18257,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-e670e72f-20250214"; "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 6ccee63133cdb..34a44d48fdf6c 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 @@ -4088,6 +4088,9 @@ function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } + function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); + } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -9511,6 +9514,10 @@ }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -9591,5 +9598,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-e670e72f-20250214"; })(); 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 dd9f66a5cb28e..9b893bf976b80 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 @@ -3327,6 +3327,9 @@ function readPreviousThenableFromState() { function unsupportedRefresh() { throw Error(formatProdErrorMessage(393)); } +function unsupportedStartGesture() { + throw Error(formatProdErrorMessage(547)); +} function noop$1() {} var HooksDispatcher = { readContext: function (context) { @@ -3418,6 +3421,10 @@ var HooksDispatcher = { }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -6342,4 +6349,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-e670e72f-20250214"; 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 78e34684847a0..44ed5f8f66c1e 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 @@ -4088,6 +4088,9 @@ function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } + function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); + } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -9511,6 +9514,10 @@ }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -9591,5 +9598,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-e670e72f-20250214"; })(); 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 adcc7e7c8d2ef..6b96842062f17 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 @@ -3373,6 +3373,9 @@ function readPreviousThenableFromState() { function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } +function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); +} function noop$1() {} var HooksDispatcher = { readContext: function (context) { @@ -3469,6 +3472,10 @@ var HooksDispatcher = { }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -6436,4 +6443,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-e670e72f-20250214"; 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 1b5a3c8f7b4e9..d12b075ff7db7 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 @@ -4265,6 +4265,9 @@ function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } + function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); + } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -8499,11 +8502,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -9967,6 +9970,10 @@ }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -10285,5 +10292,5 @@ startWork(request); }); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-e670e72f-20250214"; })(); 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 8d5418873055b..41a2c24760b67 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 @@ -3729,6 +3729,9 @@ function readPreviousThenableFromState() { function unsupportedRefresh() { throw Error(formatProdErrorMessage(393)); } +function unsupportedStartGesture() { + throw Error(formatProdErrorMessage(547)); +} function noop$1() {} var HooksDispatcher = { readContext: function (context) { @@ -3819,6 +3822,10 @@ var HooksDispatcher = { }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -6883,12 +6890,12 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== isomorphicReactPackageVersion) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion, - "19.1.0-experimental-cbbe8666-20250213" + "19.1.0-experimental-e670e72f-20250214" ) ); } @@ -7143,4 +7150,4 @@ exports.resumeAndPrerender = function (children, postponedState, options) { startWork(request); }); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-e670e72f-20250214"; 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 96f837a2858de..80707a19d59e3 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 @@ -3362,6 +3362,9 @@ function readPreviousThenableFromState() { function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } +function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); +} function noop$1() {} var HooksDispatcher = { readContext: function (context) { @@ -3457,6 +3460,10 @@ var HooksDispatcher = { }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -6361,13 +6368,13 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) { } var isomorphicReactPackageVersion$jscomp$inline_810 = React.version; if ( - "19.1.0-experimental-cbbe8666-20250213" !== + "19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -6458,4 +6465,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-e670e72f-20250214"; 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 714aabe591ae1..815d4ccba3e56 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 @@ -4261,6 +4261,9 @@ function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } + function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); + } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -8522,11 +8525,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -9986,6 +9989,10 @@ }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -10315,5 +10322,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-e670e72f-20250214"; })(); 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 d90ff6e65cd00..1d4b10792e083 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 @@ -3767,6 +3767,9 @@ function readPreviousThenableFromState() { function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } +function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); +} function noop$1() {} var HooksDispatcher = { readContext: function (context) { @@ -3862,6 +3865,10 @@ var HooksDispatcher = { }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -6992,11 +6999,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -7261,4 +7268,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-e670e72f-20250214"; 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 f5fd1ba2461a9..a30cf00344ee3 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 @@ -4153,6 +4153,9 @@ function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } + function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); + } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -8386,11 +8389,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); } function createDrainHandler(destination, request) { @@ -9920,6 +9923,10 @@ }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -10165,5 +10172,5 @@ } }; }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-e670e72f-20250214"; })(); 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 69cd0d8dd0e9b..cad2f132494fd 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 @@ -3654,6 +3654,9 @@ function readPreviousThenableFromState() { function unsupportedRefresh() { throw Error("Cache cannot be refreshed during server rendering."); } +function unsupportedStartGesture() { + throw Error("startGesture cannot be called during server rendering."); +} function noop$1() {} var HooksDispatcher = { readContext: function (context) { @@ -3749,6 +3752,10 @@ var HooksDispatcher = { }, useEffectEvent: function () { return throwOnUseEffectEventCall; + }, + useSwipeTransition: function (previous, current) { + resolveCurrentlyRenderingComponent(); + return [current, unsupportedStartGesture]; } }, currentResumableState = null, @@ -6871,11 +6878,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -7126,4 +7133,4 @@ exports.resumeToPipeableStream = function (children, postponedState, options) { } }; }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-e670e72f-20250214"; 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 8ff4e2feb6202..190670aeedfd1 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 @@ -582,6 +582,7 @@ case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -596,7 +597,7 @@ case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -658,7 +659,7 @@ ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -676,10 +677,10 @@ case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -719,7 +720,7 @@ function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -795,7 +796,7 @@ root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -818,7 +819,6 @@ case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -837,7 +837,7 @@ case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -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": @@ -3811,6 +3814,11 @@ enqueueUpdate$1(fiber, null, null, lane); return getRootForUpdatedFiber(fiber); } + function enqueueGestureRender(fiber) { + fiber = markUpdateLaneFromFiberToRoot(fiber, null, 64); + null !== fiber && markRootUpdated$1(fiber, 64); + return fiber; + } function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { sourceFiber.lanes |= lane; var alternate = sourceFiber.alternate; @@ -3826,17 +3834,19 @@ (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (nestedUpdateCount > NESTED_UPDATE_LIMIT) @@ -4002,7 +4012,7 @@ (blockingEventTime = lane), (blockingEventType = JSCompiler_temp)); else if ( - 0 !== (lane & 4194176) && + 0 !== (lane & 4194048) && 0 > transitionUpdateTime && ((transitionUpdateTime = now()), 0 > transitionStartTime) ) { @@ -4095,9 +4105,9 @@ } function setCurrentTrackFromLanes(lanes) { reusableLaneDevToolDetails.track = - lanes & 63 + lanes & 127 ? "Blocking" - : lanes & 4194240 + : lanes & 4194176 ? "Transition" : lanes & 62914560 ? "Suspense" @@ -4214,13 +4224,13 @@ function logRenderPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure( (lanes & 536870912) === lanes ? "Prepared" - : (lanes & 201326677) === lanes + : (lanes & 201326741) === lanes ? "Hydrated" : "Render", reusableLaneOptions @@ -4229,7 +4239,7 @@ function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); @@ -4237,7 +4247,7 @@ function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -4657,7 +4667,7 @@ } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5252,6 +5262,28 @@ ? null : { parent: CacheContext._currentValue, pool: cacheFromPool }; } + function scheduleGesture(root, provider) { + for (var prev = root.gestures; null !== prev; ) { + if (prev.provider === provider) return prev.count++, prev; + var next = prev.next; + if (null === next) break; + prev = next; + } + provider = { provider: provider, count: 1, prev: prev, next: null }; + null === prev ? (root.gestures = provider) : (prev.next = provider); + ensureRootIsScheduled(root); + return provider; + } + function deleteScheduledGesture(root, gesture) { + null === gesture.prev + ? root.gestures === gesture && + ((root.gestures = gesture.next), + null === root.gestures && (root.pendingLanes &= -65)) + : ((gesture.prev.next = gesture.next), + null !== gesture.next && (gesture.next.prev = gesture.prev), + (gesture.prev = null), + (gesture.next = null)); + } function mountHookTypesDev() { var hookName = currentHookNameInDev; null === hookTypesDev @@ -5846,7 +5878,7 @@ throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } hook.memoizedState = nextSnapshot; @@ -5929,7 +5961,7 @@ "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -6903,7 +6935,7 @@ queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -6911,6 +6943,61 @@ markRootEntangled(root, lane); } } + function startGesture(fiber, queue, gestureProvider) { + var root = enqueueGestureRender(fiber); + if (null === root) return function () {}; + var update = { + gesture: scheduleGesture(root, gestureProvider), + prev: null, + next: queue.pending + }; + null !== queue.pending && (queue.pending.prev = update); + queue.pending = update; + return function () { + if (null === update.prev) + if (queue.pending === update) queue.pending = update.next; + else return; + else + (update.prev.next = update.next), + null !== update.next && (update.next.prev = update.prev), + (update.prev = null), + (update.next = null); + var gesture = update.gesture; + gesture.count--; + 0 === gesture.count && deleteScheduledGesture(root, gesture); + }; + } + function mountSwipeTransition(previous, current) { + previous = { pending: null, dispatch: null }; + var startGestureOnHook = (previous.dispatch = startGesture.bind( + null, + currentlyRenderingFiber, + previous + )); + mountWorkInProgressHook().queue = previous; + return [current, startGestureOnHook]; + } + function updateSwipeTransition(previous, current) { + var queue = updateWorkInProgressHook().queue, + startGestureOnHook = queue.dispatch; + if (64 === workInProgressRootRenderLanes) { + var root = workInProgressRoot; + if (null === root) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + root = root.gestures; + for (var update = queue.pending; null !== update; ) { + if (root === update.gesture) { + current = previous; + break; + } + update = update.next; + } + } + null !== queue.pending && (currentlyRenderingFiber.lanes |= 64); + return [current, startGestureOnHook]; + } function pushDebugInfo(debugInfo) { var previousDebugInfo = currentDebugInfo; null != debugInfo && @@ -8785,7 +8872,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -9101,7 +9188,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 +9268,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 +9301,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 +9323,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 +9342,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 +9356,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 +9385,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 +9398,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 +9416,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -9389,33 +9468,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_2615; + var JSCompiler_object_inline_stack_2614 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2613 = !1; + var JSCompiler_object_inline_message_2612 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2616 = didSuspend) || - (JSCompiler_object_inline_componentStack_2616 = + (JSCompiler_object_inline_componentStack_2615 = didSuspend) || + (JSCompiler_object_inline_componentStack_2615 = 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_2615 && + ((JSCompiler_object_inline_message_2612 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2616 = + JSCompiler_object_inline_componentStack_2615 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2613 + JSCompiler_object_inline_message_2612 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2614 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2613 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2614)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2613)) { c: { - var instance = JSCompiler_object_inline_digest_2614; + var instance = JSCompiler_object_inline_digest_2613; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -9457,87 +9536,87 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2614 + JSCompiler_object_inline_digest_2613 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2614 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2613 = 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_2613 && + ((JSCompiler_object_inline_digest_2613 = + JSCompiler_object_inline_digest_2613.dehydrated), + null !== JSCompiler_object_inline_digest_2613) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2614) + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2613) ? (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_2613 = + JSCompiler_object_inline_stack_2614.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2614.fallback; + if (JSCompiler_object_inline_message_2612) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2615 = + (JSCompiler_object_inline_stack_2614 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2614, + JSCompiler_object_inline_digest_2613, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2613 = workInProgress.child), - (JSCompiler_object_inline_message_2613.memoizedState = + (JSCompiler_object_inline_message_2612 = workInProgress.child), + (JSCompiler_object_inline_message_2612.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2613.childLanes = + (JSCompiler_object_inline_message_2612.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2615, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2614 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2615.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2614.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2615 = + (JSCompiler_object_inline_stack_2614 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2614, + JSCompiler_object_inline_digest_2613, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2613 = workInProgress.child), - (JSCompiler_object_inline_message_2613.memoizedState = + (JSCompiler_object_inline_message_2612 = workInProgress.child), + (JSCompiler_object_inline_message_2612.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2613.childLanes = + (JSCompiler_object_inline_message_2612.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2615, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2614 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2614 + JSCompiler_object_inline_digest_2613 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2614 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2614) + ((JSCompiler_object_inline_digest_2613 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2613) ) { if (didSuspend) workInProgress.flags & 256 @@ -9554,94 +9633,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_2612 = + JSCompiler_object_inline_stack_2614.fallback), + (JSCompiler_object_inline_digest_2613 = workInProgress.mode), + (JSCompiler_object_inline_stack_2614 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2615.children + children: JSCompiler_object_inline_stack_2614.children }, - JSCompiler_object_inline_digest_2614 + JSCompiler_object_inline_digest_2613 )), - (JSCompiler_object_inline_message_2613 = + (JSCompiler_object_inline_message_2612 = createFiberFromFragment( - JSCompiler_object_inline_message_2613, - JSCompiler_object_inline_digest_2614, + JSCompiler_object_inline_message_2612, + JSCompiler_object_inline_digest_2613, 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_2612.flags |= 2), + (JSCompiler_object_inline_stack_2614.return = workInProgress), + (JSCompiler_object_inline_message_2612.return = workInProgress), + (JSCompiler_object_inline_stack_2614.sibling = + JSCompiler_object_inline_message_2612), + (workInProgress.child = JSCompiler_object_inline_stack_2614), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2615 = workInProgress.child), - (JSCompiler_object_inline_stack_2615.memoizedState = + (JSCompiler_object_inline_stack_2614 = workInProgress.child), + (JSCompiler_object_inline_stack_2614.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2615.childLanes = + (JSCompiler_object_inline_stack_2614.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2615, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2613)); + (workInProgress = JSCompiler_object_inline_message_2612)); 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_2613)) ) { - 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_2615 = + JSCompiler_object_inline_digest_2613.nextSibling && + JSCompiler_object_inline_digest_2613.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2615) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2615.dgst; + var message = JSCompiler_object_inline_componentStack_2615.msg; + instance = JSCompiler_object_inline_componentStack_2615.stck; var componentStack = - JSCompiler_object_inline_componentStack_2616.cstck; + JSCompiler_object_inline_componentStack_2615.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_2612 = message; + JSCompiler_object_inline_digest_2613 = JSCompiler_temp; + JSCompiler_object_inline_stack_2614 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2615 = 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_2613 && + ((JSCompiler_object_inline_componentStack_2615 = + JSCompiler_object_inline_message_2612 + ? Error(JSCompiler_object_inline_message_2612) : 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_2615.stack = + JSCompiler_object_inline_stack_2614 || ""), + (JSCompiler_object_inline_componentStack_2615.digest = + JSCompiler_object_inline_digest_2613), + (JSCompiler_object_inline_stack_2614 = void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2613 = { - value: JSCompiler_object_inline_componentStack_2616, + (JSCompiler_object_inline_message_2612 = { + value: JSCompiler_object_inline_componentStack_2615, source: null, - stack: JSCompiler_object_inline_stack_2615 + stack: JSCompiler_object_inline_stack_2614 }), - "string" === typeof JSCompiler_object_inline_stack_2615 && + "string" === typeof JSCompiler_object_inline_stack_2614 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2616, - JSCompiler_object_inline_message_2613 + JSCompiler_object_inline_componentStack_2615, + JSCompiler_object_inline_message_2612 ), - queueHydrationError(JSCompiler_object_inline_message_2613)); + queueHydrationError(JSCompiler_object_inline_message_2612)); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9655,44 +9734,44 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2616 = + (JSCompiler_object_inline_componentStack_2615 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2616) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2615) ) { - JSCompiler_object_inline_componentStack_2616 = workInProgressRoot; + JSCompiler_object_inline_componentStack_2615 = 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_2615 && + ((JSCompiler_object_inline_stack_2614 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2614 = + 0 !== (JSCompiler_object_inline_stack_2614 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2614 )), - (JSCompiler_object_inline_stack_2615 = + (JSCompiler_object_inline_stack_2614 = 0 !== - (JSCompiler_object_inline_stack_2615 & - (JSCompiler_object_inline_componentStack_2616.suspendedLanes | + (JSCompiler_object_inline_stack_2614 & + (JSCompiler_object_inline_componentStack_2615.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_2614), + 0 !== JSCompiler_object_inline_stack_2614 && + JSCompiler_object_inline_stack_2614 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2615), + ((prevState.retryLane = JSCompiler_object_inline_stack_2614), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2614 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2615, current, - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2614 ), SelectiveHydrationException) ); - JSCompiler_object_inline_digest_2614.data === + JSCompiler_object_inline_digest_2613.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9700,14 +9779,14 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2614.data === + JSCompiler_object_inline_digest_2613.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_2613.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9725,54 +9804,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2615.children + JSCompiler_object_inline_stack_2614.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2613) + if (JSCompiler_object_inline_message_2612) 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_2612 = + JSCompiler_object_inline_stack_2614.fallback), + (JSCompiler_object_inline_digest_2613 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2615 = createWorkInProgress( + (JSCompiler_object_inline_stack_2614 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2615.children + children: JSCompiler_object_inline_stack_2614.children } )), - (JSCompiler_object_inline_stack_2615.subtreeFlags = + (JSCompiler_object_inline_stack_2614.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_message_2613 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2612 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2613 + JSCompiler_object_inline_message_2612 )) - : ((JSCompiler_object_inline_message_2613 = createFiberFromFragment( - JSCompiler_object_inline_message_2613, - JSCompiler_object_inline_digest_2614, + : ((JSCompiler_object_inline_message_2612 = createFiberFromFragment( + JSCompiler_object_inline_message_2612, + JSCompiler_object_inline_digest_2613, 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_2612.flags |= 2)), + (JSCompiler_object_inline_message_2612.return = workInProgress), + (JSCompiler_object_inline_stack_2614.return = workInProgress), + (JSCompiler_object_inline_stack_2614.sibling = + JSCompiler_object_inline_message_2612), + (workInProgress.child = JSCompiler_object_inline_stack_2614), + (JSCompiler_object_inline_stack_2614 = + JSCompiler_object_inline_message_2612), + (JSCompiler_object_inline_message_2612 = workInProgress.child), + (JSCompiler_object_inline_digest_2613 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2613 + ? (JSCompiler_object_inline_digest_2613 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2614.cachePool), + JSCompiler_object_inline_digest_2613.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9780,38 +9859,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2614 = { + (JSCompiler_object_inline_digest_2613 = { baseLanes: - JSCompiler_object_inline_digest_2614.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2613.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_2612.memoizedState = + JSCompiler_object_inline_digest_2613), + (JSCompiler_object_inline_message_2612.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2616, + JSCompiler_object_inline_componentStack_2615, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2615 + JSCompiler_object_inline_stack_2614 ); 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_2614.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2616 = + ((JSCompiler_object_inline_componentStack_2615 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2616 + null === JSCompiler_object_inline_componentStack_2615 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2616.push(current)); + : JSCompiler_object_inline_componentStack_2615.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11571,7 +11650,7 @@ selectionRange: JSCompiler_temp }; shouldStartViewTransition = _enabled = !1; - committedLanes = (committedLanes & 335544192) === committedLanes; + committedLanes = (committedLanes & 335544064) === committedLanes; nextEffect = firstChild; for (firstChild = committedLanes ? 9238 : 1028; null !== nextEffect; ) { root = nextEffect; @@ -13131,7 +13210,7 @@ viewTransitionMutationContext = !1; recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); - (lanes & 335544192) === lanes && + (lanes & 335544064) === lanes && null !== current && viewTransitionMutationContext && (finishedWork.flags |= 4); @@ -13594,7 +13673,7 @@ endTime ) { var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; if ( parentFiber.subtreeFlags & (isViewTransitionEligible ? 10262 : 10256) || (0 !== parentFiber.actualDuration && @@ -13635,7 +13714,7 @@ inHydratedSubtree ); var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; isViewTransitionEligible && null === finishedWork.alternate && null !== finishedWork.return && @@ -14996,7 +15075,7 @@ resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -16119,7 +16198,7 @@ } yieldDuration = (forceSync = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root.expiredLanes)) || checkIfRootIsPrerendering(root, lanes)) ? renderRootConcurrent(root, lanes) @@ -16226,15 +16305,15 @@ case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case RootSuspendedAtTheShell: setCurrentTrackFromLanes(lanes); logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); yieldEndTime = lanes; - 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60) + 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 124) ? (blockingSuspendedTime = startTime) - : 0 !== (yieldEndTime & 4194176) && + : 0 !== (yieldEndTime & 4194048) && (transitionSuspendedTime = startTime); markRootSuspended( forceSync, @@ -16347,7 +16426,7 @@ ) { root.timeoutHandle = noTimeout; var subtreeFlags = finishedWork.subtreeFlags, - isViewTransitionEligible = (lanes & 335544192) === lanes; + isViewTransitionEligible = (lanes & 335544064) === lanes; if ( isViewTransitionEligible || subtreeFlags & 8192 || @@ -16496,9 +16575,9 @@ } } function finalizeRender(lanes, finalizationTime) { - if (0 !== (lanes & 3) || 0 !== (lanes & 60)) + if (0 !== (lanes & 3) || 0 !== (lanes & 124)) blockingClampTime = finalizationTime; - 0 !== (lanes & 4194176) && (transitionClampTime = finalizationTime); + 0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime); } function prepareFreshStack(root, lanes) { supportsUserTiming && @@ -16523,13 +16602,13 @@ var endTime = renderStartTime; supportsUserTiming && ((reusableLaneDevToolDetails.color = - (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), performance.measure( (lanes & 536870912) === lanes ? "Prewarm" - : (lanes & 201326677) === lanes + : (lanes & 201326741) === lanes ? "Interrupted Hydration" : "Interrupted Render", reusableLaneOptions @@ -16537,7 +16616,7 @@ } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } - if (0 !== (lanes & 3) || 0 !== (lanes & 60)) { + if (0 !== (lanes & 3) || 0 !== (lanes & 124)) { previousRenderStartTime = 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime ? blockingClampTime @@ -16580,7 +16659,7 @@ 0 < previousRenderStartTime && ((reusableLaneDevToolDetails.color = isSpawnedUpdate ? "error" - : (lanes & 738197589) === lanes + : (lanes & 738197653) === lanes ? "tertiary-light" : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), @@ -16593,7 +16672,7 @@ blockingEventIsRepeat = !0; blockingSpawnedUpdate = !1; } - 0 !== (lanes & 4194176) && + 0 !== (lanes & 4194048) && ((previousRenderStartTime = 0 <= transitionStartTime && transitionStartTime < transitionClampTime ? transitionClampTime @@ -16742,7 +16821,7 @@ function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -17253,6 +17332,7 @@ didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes; didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + null === root.gestures && (didIncludeRenderPhaseUpdate &= -65); markRootFinished( root, lanes, @@ -17264,68 +17344,71 @@ root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - pendingFinishedWork = finishedWork; - pendingEffectsRoot = root; - pendingEffectsLanes = lanes; - pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; - pendingPassiveTransitions = transitions; - pendingRecoverableErrors = recoverableErrors; - pendingEffectsRenderEndTime = completedRenderEndTime; - pendingSuspendedCommitReason = suspendedCommitReason; - pendingViewTransitionEvents = null; - (lanes & 335544192) === lanes - ? ((pendingTransitionTypes = ReactSharedInternals.V), - (ReactSharedInternals.V = null), - (recoverableErrors = 10262)) - : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); - 0 !== finishedWork.actualDuration || - 0 !== (finishedWork.subtreeFlags & recoverableErrors) || - 0 !== (finishedWork.flags & recoverableErrors) - ? ((root.callbackNode = null), - (root.callbackPriority = 0), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), (root.callbackPriority = 0)); - commitErrors = null; - commitStartTime = now(); - suspendedCommitReason === SUSPENDED_COMMIT - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : suspendedCommitReason === THROTTLED_COMMIT && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - suspendedCommitReason = 0 !== (finishedWork.flags & 13878); - if ( - 0 !== (finishedWork.subtreeFlags & 13878) || - suspendedCommitReason - ) { - suspendedCommitReason = ReactSharedInternals.T; - ReactSharedInternals.T = null; - completedRenderEndTime = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = DiscreteEventPriority; - recoverableErrors = executionContext; - executionContext |= CommitContext; - try { - commitBeforeMutationEffects(root, finishedWork, lanes); - } finally { - (executionContext = recoverableErrors), - (ReactDOMSharedInternals.p = completedRenderEndTime), - (ReactSharedInternals.T = suspendedCommitReason); + if (64 === lanes) commitGestureOnRoot(root); + else { + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingEffectsRenderEndTime = completedRenderEndTime; + pendingSuspendedCommitReason = suspendedCommitReason; + pendingViewTransitionEvents = null; + (lanes & 335544064) === lanes + ? ((pendingTransitionTypes = ReactSharedInternals.V), + (ReactSharedInternals.V = null), + (recoverableErrors = 10262)) + : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & recoverableErrors) || + 0 !== (finishedWork.flags & recoverableErrors) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback$1(NormalPriority$1, function () { + schedulerEvent = window.event; + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitErrors = null; + commitStartTime = now(); + suspendedCommitReason === SUSPENDED_COMMIT + ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) + : suspendedCommitReason === THROTTLED_COMMIT && + logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); + suspendedCommitReason = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + suspendedCommitReason + ) { + suspendedCommitReason = ReactSharedInternals.T; + ReactSharedInternals.T = null; + completedRenderEndTime = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + recoverableErrors = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork, lanes); + } finally { + (executionContext = recoverableErrors), + (ReactDOMSharedInternals.p = completedRenderEndTime), + (ReactSharedInternals.T = suspendedCommitReason); + } } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + (shouldStartViewTransition && + startViewTransition( + root.containerInfo, + pendingTransitionTypes, + flushMutationEffects, + flushLayoutEffects, + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects + )) || + (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } - pendingEffectsStatus = PENDING_MUTATION_PHASE; - (shouldStartViewTransition && - startViewTransition( - root.containerInfo, - pendingTransitionTypes, - flushMutationEffects, - flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects - )) || - (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } } function flushAfterMutationEffects() { @@ -17534,7 +17617,7 @@ (reusableLaneOptions.start = completedRenderEndTime), (reusableLaneOptions.end = suspendedCommitReason), performance.measure("Commit", reusableLaneOptions)); - completedRenderEndTime = (lanes & 335544192) === lanes ? 10262 : 10256; + completedRenderEndTime = (lanes & 335544064) === lanes ? 10262 : 10256; (completedRenderEndTime = 0 !== finishedWork.actualDuration || 0 !== (finishedWork.subtreeFlags & completedRenderEndTime) || @@ -17630,7 +17713,7 @@ 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); suspendedCommitReason = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (suspendedCommitReason & 42) + 0 !== (lanes & 4194090) && 0 !== (suspendedCommitReason & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -17640,6 +17723,14 @@ flushSyncWorkAcrossRoots_impl(0, !1); } } + function commitGestureOnRoot(root) { + var finishedGesture = root.gestures; + if (null === finishedGesture) + throw Error( + "Finished rendering the gesture lane but there were no pending gestures. React should not have started a render in this case. This is a bug in React." + ); + deleteScheduledGesture(root, finishedGesture); + } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; Object.defineProperty(componentStack, "digest", { @@ -17849,10 +17940,10 @@ null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; root.warmLanes &= ~pingedLanes; - 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 60) + 0 !== (pingedLanes & 3) || 0 !== (pingedLanes & 124) ? 0 > blockingUpdateTime && (blockingClampTime = blockingUpdateTime = now()) - : 0 !== (pingedLanes & 4194176) && + : 0 !== (pingedLanes & 4194048) && 0 > transitionUpdateTime && (transitionClampTime = transitionUpdateTime = now()); isConcurrentActEnvironment() && @@ -18054,8 +18145,8 @@ (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); nextLanes = - nextLanes & 201326677 - ? (nextLanes & 201326677) | 1 + nextLanes & 201326741 + ? (nextLanes & 201326741) | 1 : nextLanes ? nextLanes | 2 : 0; @@ -18071,7 +18162,7 @@ null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout )), - 0 === (nextLanes & 3) || + (0 === (nextLanes & 3) && 64 !== nextLanes) || checkIfRootIsPrerendering(root, nextLanes) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); @@ -18107,7 +18198,10 @@ null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev); else if ( - ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3)) + ((prev = root), + 0 !== syncTransitionLanes || + 0 !== (nextLanes & 3) || + 64 === nextLanes) ) mightHavePendingSyncWork = !0; root = next; @@ -22702,6 +22796,7 @@ this.pooledCache = null; this.pooledCacheLanes = 0; this.formState = formState; + this.gestures = null; this.incompleteTransitions = new Map(); this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); @@ -23479,7 +23574,7 @@ clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log = Math.log, LN2 = Math.LN2, - nextTransitionLane = 128, + nextTransitionLane = 256, nextRetryLane = 4194304, DiscreteEventPriority = 2, ContinuousEventPriority = 8, @@ -25251,6 +25346,7 @@ useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; + ContextOnlyDispatcher.useSwipeTransition = throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -25396,6 +25492,11 @@ currentHookNameInDev = "useEffectEvent"; mountHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + mountHookTypesDev(); + return mountSwipeTransition(previous, current); } }; HooksDispatcherOnMountWithHookTypesInDEV = { @@ -25530,6 +25631,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; HooksDispatcherOnUpdateInDEV = { @@ -25664,6 +25770,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; HooksDispatcherOnRerenderInDEV = { @@ -25798,6 +25909,11 @@ currentHookNameInDev = "useEffectEvent"; updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnMountInDEV = { @@ -25957,6 +26073,12 @@ warnInvalidHookAccess(); mountHookTypesDev(); return mountEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnUpdateInDEV = { @@ -26116,6 +26238,12 @@ warnInvalidHookAccess(); updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; InvalidNestedHooksDispatcherOnRerenderInDEV = { @@ -26275,6 +26403,12 @@ warnInvalidHookAccess(); updateHookTypesDev(); return updateEvent(callback); + }, + useSwipeTransition: function (previous, current) { + currentHookNameInDev = "useSwipeTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSwipeTransition(previous, current); } }; var callComponent = { @@ -27221,11 +27355,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-experimental-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27262,10 +27396,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-e670e72f-20250214" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27573,5 +27707,5 @@ } }; }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-e670e72f-20250214"; })(); 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 830e57bbbaa9e..e02cbdeba5d66 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 @@ -340,7 +340,7 @@ function clz32Fallback(x) { x >>>= 0; return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } -var nextTransitionLane = 128, +var nextTransitionLane = 256, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { var pendingSyncLanes = lanes & 42; @@ -361,6 +361,7 @@ function getHighestPriorityLanes(lanes) { case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -375,7 +376,7 @@ function getHighestPriorityLanes(lanes) { case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -431,7 +432,7 @@ function getNextLanes(root, wipLanes, rootHasPendingCommit) { ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -449,10 +450,10 @@ function computeExpirationTime(lane, currentTime) { case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -487,7 +488,7 @@ function computeExpirationTime(lane, currentTime) { function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -561,7 +562,7 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -584,7 +585,6 @@ function getBumpedLaneForHydrationByLane(lane) { case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -603,7 +603,7 @@ function getBumpedLaneForHydrationByLane(lane) { case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -2107,19 +2107,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$288; + var JSCompiler_inline_result$jscomp$289; if (canUseDOM) { - var isSupported$jscomp$inline_430 = "oninput" in document; - if (!isSupported$jscomp$inline_430) { - var element$jscomp$inline_431 = document.createElement("div"); - element$jscomp$inline_431.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_430 = - "function" === typeof element$jscomp$inline_431.oninput; + var isSupported$jscomp$inline_431 = "oninput" in document; + if (!isSupported$jscomp$inline_431) { + var element$jscomp$inline_432 = document.createElement("div"); + element$jscomp$inline_432.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_431 = + "function" === typeof element$jscomp$inline_432.oninput; } - JSCompiler_inline_result$jscomp$288 = isSupported$jscomp$inline_430; - } else JSCompiler_inline_result$jscomp$288 = !1; + JSCompiler_inline_result$jscomp$289 = isSupported$jscomp$inline_431; + } else JSCompiler_inline_result$jscomp$289 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$288 && + JSCompiler_inline_result$jscomp$289 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2431,6 +2431,11 @@ function enqueueConcurrentRenderForLane(fiber, lane) { enqueueUpdate$1(fiber, null, null, lane); return getRootForUpdatedFiber(fiber); } +function enqueueGestureRender(fiber) { + fiber = markUpdateLaneFromFiberToRoot(fiber, null, 64); + null !== fiber && markRootUpdated$1(fiber, 64); + return fiber; +} function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { sourceFiber.lanes |= lane; var alternate = sourceFiber.alternate; @@ -2444,17 +2449,19 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (50 < nestedUpdateCount) @@ -2738,7 +2745,7 @@ function enqueueUpdate(fiber, update, lane) { } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -3269,6 +3276,28 @@ function getSuspendedCache() { ? null : { parent: CacheContext._currentValue, pool: cacheFromPool }; } +function scheduleGesture(root, provider) { + for (var prev = root.gestures; null !== prev; ) { + if (prev.provider === provider) return prev.count++, prev; + var next = prev.next; + if (null === next) break; + prev = next; + } + provider = { provider: provider, count: 1, prev: prev, next: null }; + null === prev ? (root.gestures = provider) : (prev.next = provider); + ensureRootIsScheduled(root); + return provider; +} +function deleteScheduledGesture(root, gesture) { + null === gesture.prev + ? root.gestures === gesture && + ((root.gestures = gesture.next), + null === root.gestures && (root.pendingLanes &= -65)) + : ((gesture.prev.next = gesture.next), + null !== gesture.next && (gesture.next.prev = gesture.prev), + (gesture.prev = null), + (gesture.next = null)); +} var renderLanes = 0, currentlyRenderingFiber = null, currentHook = null, @@ -3675,7 +3704,7 @@ function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { ); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -4391,7 +4420,7 @@ function enqueueRenderPhaseUpdate(queue, update) { queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -4399,6 +4428,49 @@ function entangleTransitionUpdate(root, queue, lane) { markRootEntangled(root, lane); } } +function startGesture(fiber, queue, gestureProvider) { + var root = enqueueGestureRender(fiber); + if (null === root) return function () {}; + var update = { + gesture: scheduleGesture(root, gestureProvider), + prev: null, + next: queue.pending + }; + null !== queue.pending && (queue.pending.prev = update); + queue.pending = update; + return function () { + if (null === update.prev) + if (queue.pending === update) queue.pending = update.next; + else return; + else + (update.prev.next = update.next), + null !== update.next && (update.next.prev = update.prev), + (update.prev = null), + (update.next = null); + var cancelledGestured = update.gesture; + cancelledGestured.count--; + 0 === cancelledGestured.count && + deleteScheduledGesture(root, cancelledGestured); + }; +} +function updateSwipeTransition(previous, current) { + var queue = updateWorkInProgressHook().queue, + startGestureOnHook = queue.dispatch; + if (64 === workInProgressRootRenderLanes) { + var root$46 = workInProgressRoot; + if (null === root$46) throw Error(formatProdErrorMessage(349)); + root$46 = root$46.gestures; + for (var update = queue.pending; null !== update; ) { + if (root$46 === update.gesture) { + current = previous; + break; + } + update = update.next; + } + } + null !== queue.pending && (currentlyRenderingFiber.lanes |= 64); + return [current, startGestureOnHook]; +} var ContextOnlyDispatcher = { readContext: readContext, use: use, @@ -4425,6 +4497,7 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; +ContextOnlyDispatcher.useSwipeTransition = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -4536,7 +4609,7 @@ var HooksDispatcherOnMount = { getServerSnapshot = getSnapshot(); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; @@ -4614,6 +4687,16 @@ var HooksDispatcherOnMount = { throw Error(formatProdErrorMessage(440)); return ref.impl.apply(void 0, arguments); }; + }, + useSwipeTransition: function (previous, current) { + previous = { pending: null, dispatch: null }; + var startGestureOnHook = (previous.dispatch = startGesture.bind( + null, + currentlyRenderingFiber, + previous + )); + mountWorkInProgressHook().queue = previous; + return [current, startGestureOnHook]; } }, HooksDispatcherOnUpdate = { @@ -4664,6 +4747,7 @@ var HooksDispatcherOnMount = { useCacheRefresh: updateRefresh }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; +HooksDispatcherOnUpdate.useSwipeTransition = updateSwipeTransition; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4717,6 +4801,7 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; +HooksDispatcherOnRerender.useSwipeTransition = updateSwipeTransition; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -5571,9 +5656,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$75) { + } catch (e$76) { setTimeout(function () { - throw e$75; + throw e$76; }); } } @@ -5584,9 +5669,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$76) { + } catch (e$77) { setTimeout(function () { - throw e$76; + throw e$77; }); } } @@ -7651,8 +7736,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$115) { - captureCommitPhaseError(current, nearestMountedAncestor, error$115); + } catch (error$116) { + captureCommitPhaseError(current, nearestMountedAncestor, error$116); } else ref.current = null; } @@ -7871,7 +7956,7 @@ function commitBeforeMutationEffects(root, firstChild, committedLanes) { } else JSCompiler_temp = null; selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; shouldStartViewTransition = _enabled = !1; - committedLanes = (committedLanes & 335544192) === committedLanes; + committedLanes = (committedLanes & 335544064) === committedLanes; nextEffect = firstChild; for (firstChild = committedLanes ? 9238 : 1028; null !== nextEffect; ) { root = nextEffect; @@ -8458,11 +8543,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$114) { + } catch (error$115) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$114 + error$115 ); } } @@ -9236,7 +9321,7 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { viewTransitionMutationContext = !1; recursivelyTraverseMutationEffects(root, finishedWork, lanes); commitReconciliationEffects(finishedWork); - (lanes & 335544192) === lanes && + (lanes & 335544064) === lanes && null !== current && viewTransitionMutationContext && (finishedWork.flags |= 4); @@ -9270,21 +9355,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$116 = JSCompiler_inline_result.stateNode; + var parent$117 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$116, ""), + (setTextContent(parent$117, ""), (JSCompiler_inline_result.flags &= -33)); - var before$117 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$117, parent$116); + var before$118 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$118, parent$117); break; case 3: case 4: - var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, - before$119 = getHostSibling(finishedWork); + var parent$119 = JSCompiler_inline_result.stateNode.containerInfo, + before$120 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$119, - parent$118 + before$120, + parent$119 ); break; default: @@ -9648,7 +9733,7 @@ function recursivelyTraversePassiveMountEffects( committedTransitions ) { var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; if (parentFiber.subtreeFlags & (isViewTransitionEligible ? 10262 : 10256)) for (parentFiber = parentFiber.child; null !== parentFiber; ) commitPassiveMountOnFiber( @@ -9667,7 +9752,7 @@ function commitPassiveMountOnFiber( committedTransitions ) { var isViewTransitionEligible = - (committedLanes & 335544192) === committedLanes; + (committedLanes & 335544064) === committedLanes; isViewTransitionEligible && null === finishedWork.alternate && null !== finishedWork.return && @@ -10613,7 +10698,7 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -10651,14 +10736,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$137 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$137 = lastTailNode), + for (var lastTailNode$138 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$138 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$137 + null === lastTailNode$138 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$137.sibling = null); + : (lastTailNode$138.sibling = null); } } function bubbleProperties(completedWork) { @@ -10668,19 +10753,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$138 = completedWork.child; null !== child$138; ) - (newChildLanes |= child$138.lanes | child$138.childLanes), - (subtreeFlags |= child$138.subtreeFlags & 65011712), - (subtreeFlags |= child$138.flags & 65011712), - (child$138.return = completedWork), - (child$138 = child$138.sibling); + for (var child$139 = completedWork.child; null !== child$139; ) + (newChildLanes |= child$139.lanes | child$139.childLanes), + (subtreeFlags |= child$139.subtreeFlags & 65011712), + (subtreeFlags |= child$139.flags & 65011712), + (child$139.return = completedWork), + (child$139 = child$139.sibling); else - for (child$138 = completedWork.child; null !== child$138; ) - (newChildLanes |= child$138.lanes | child$138.childLanes), - (subtreeFlags |= child$138.subtreeFlags), - (subtreeFlags |= child$138.flags), - (child$138.return = completedWork), - (child$138 = child$138.sibling); + for (child$139 = completedWork.child; null !== child$139; ) + (newChildLanes |= child$139.lanes | child$139.childLanes), + (subtreeFlags |= child$139.subtreeFlags), + (subtreeFlags |= child$139.flags), + (child$139.return = completedWork), + (child$139 = child$139.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10961,11 +11046,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$151 = null; + var cache$152 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$151 = newProps.memoizedState.cachePool.pool); - cache$151 !== type && (newProps.flags |= 2048); + (cache$152 = newProps.memoizedState.cachePool.pool); + cache$152 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10990,8 +11075,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$151 = type.rendering; - if (null === cache$151) + cache$152 = type.rendering; + if (null === cache$152) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10999,11 +11084,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$151 = findFirstSuspended(current); - if (null !== cache$151) { + cache$152 = findFirstSuspended(current); + if (null !== cache$152) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$151.updateQueue; + current = cache$152.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -11028,7 +11113,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$151)), null !== current)) { + if (((current = findFirstSuspended(cache$152)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -11038,7 +11123,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$151.alternate && + !cache$152.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -11051,13 +11136,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$151.sibling = workInProgress.child), - (workInProgress.child = cache$151)) + ? ((cache$152.sibling = workInProgress.child), + (workInProgress.child = cache$152)) : ((current = type.last), null !== current - ? (current.sibling = cache$151) - : (workInProgress.child = cache$151), - (type.last = cache$151)); + ? (current.sibling = cache$152) + : (workInProgress.child = cache$152), + (type.last = cache$152)); } if (null !== type.tail) return ( @@ -11514,7 +11599,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); var shouldTimeSlice = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root$jscomp$0.expiredLanes)) || checkIfRootIsPrerendering(root$jscomp$0, lanes), exitStatus = shouldTimeSlice @@ -11602,7 +11687,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { case 1: throw Error(formatProdErrorMessage(345)); case 4: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case 6: markRootSuspended( shouldTimeSlice, @@ -11694,7 +11779,7 @@ function commitRootWhenReady( ) { root.timeoutHandle = -1; suspendedCommitReason = finishedWork.subtreeFlags; - var isViewTransitionEligible = (lanes & 335544192) === lanes; + var isViewTransitionEligible = (lanes & 335544064) === lanes; if ( isViewTransitionEligible || suspendedCommitReason & 8192 || @@ -11914,7 +11999,7 @@ function pushAsyncDispatcher() { function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -11979,8 +12064,8 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$171) { - handleThrow(root, thrownValue$171); + } catch (thrownValue$172) { + handleThrow(root, thrownValue$172); } while (1); lanes && root.shellSuspendCounter++; @@ -12095,8 +12180,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrentByScheduler(); break; - } catch (thrownValue$173) { - handleThrow(root, thrownValue$173); + } catch (thrownValue$174) { + handleThrow(root, thrownValue$174); } while (1); lastContextDependency = currentlyRenderingFiber$1 = null; @@ -12285,6 +12370,7 @@ function commitRoot( if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes; didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + null === root.gestures && (didIncludeRenderPhaseUpdate &= -65); markRootFinished( root, lanes, @@ -12296,55 +12382,58 @@ function commitRoot( root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - pendingFinishedWork = finishedWork; - pendingEffectsRoot = root; - pendingEffectsLanes = lanes; - pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; - pendingPassiveTransitions = transitions; - pendingRecoverableErrors = recoverableErrors; - pendingViewTransitionEvents = null; - (lanes & 335544192) === lanes - ? ((pendingTransitionTypes = ReactSharedInternals.V), - (ReactSharedInternals.V = null), - (recoverableErrors = 10262)) - : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); - 0 !== (finishedWork.subtreeFlags & recoverableErrors) || - 0 !== (finishedWork.flags & recoverableErrors) - ? ((root.callbackNode = null), - (root.callbackPriority = 0), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), (root.callbackPriority = 0)); - recoverableErrors = 0 !== (finishedWork.flags & 13878); - if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) { - recoverableErrors = ReactSharedInternals.T; - ReactSharedInternals.T = null; - transitions = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = 2; - spawnedLane = executionContext; - executionContext |= 4; - try { - commitBeforeMutationEffects(root, finishedWork, lanes); - } finally { - (executionContext = spawnedLane), - (ReactDOMSharedInternals.p = transitions), - (ReactSharedInternals.T = recoverableErrors); + if (64 === lanes) commitGestureOnRoot(root); + else { + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingViewTransitionEvents = null; + (lanes & 335544064) === lanes + ? ((pendingTransitionTypes = ReactSharedInternals.V), + (ReactSharedInternals.V = null), + (recoverableErrors = 10262)) + : ((pendingTransitionTypes = null), (recoverableErrors = 10256)); + 0 !== (finishedWork.subtreeFlags & recoverableErrors) || + 0 !== (finishedWork.flags & recoverableErrors) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback$1(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + recoverableErrors = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) { + recoverableErrors = ReactSharedInternals.T; + ReactSharedInternals.T = null; + transitions = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + spawnedLane = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork, lanes); + } finally { + (executionContext = spawnedLane), + (ReactDOMSharedInternals.p = transitions), + (ReactSharedInternals.T = recoverableErrors); + } } + pendingEffectsStatus = 1; + (shouldStartViewTransition && + startViewTransition( + root.containerInfo, + pendingTransitionTypes, + flushMutationEffects, + flushLayoutEffects, + flushAfterMutationEffects, + flushSpawnedWork, + flushPassiveEffects + )) || + (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } - pendingEffectsStatus = 1; - (shouldStartViewTransition && - startViewTransition( - root.containerInfo, - pendingTransitionTypes, - flushMutationEffects, - flushLayoutEffects, - flushAfterMutationEffects, - flushSpawnedWork, - flushPassiveEffects - )) || - (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } } function flushAfterMutationEffects() { @@ -12508,7 +12597,7 @@ function flushSpawnedWork() { finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, recoverableErrors = pendingRecoverableErrors, - passiveSubtreeMask = (lanes & 335544192) === lanes ? 10262 : 10256; + passiveSubtreeMask = (lanes & 335544064) === lanes ? 10262 : 10256; 0 !== (finishedWork.subtreeFlags & passiveSubtreeMask) || 0 !== (finishedWork.flags & passiveSubtreeMask) ? (pendingEffectsStatus = 5) @@ -12564,7 +12653,7 @@ function flushSpawnedWork() { 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); passiveSubtreeMask = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (passiveSubtreeMask & 42) + 0 !== (lanes & 4194090) && 0 !== (passiveSubtreeMask & 42) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -12572,6 +12661,11 @@ function flushSpawnedWork() { flushSyncWorkAcrossRoots_impl(0, !1); } } +function commitGestureOnRoot(root) { + var finishedGesture = root.gestures; + if (null === finishedGesture) throw Error(formatProdErrorMessage(548)); + deleteScheduledGesture(root, finishedGesture); +} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -12765,41 +12859,42 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$179 = firstScheduledRoot; null !== root$179; ) { + for (var root$180 = firstScheduledRoot; null !== root$180; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$179.pendingLanes; + var pendingLanes = root$180.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$179.suspendedLanes, - pingedLanes = root$179.pingedLanes; + var suspendedLanes = root$180.suspendedLanes, + pingedLanes = root$180.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes); JSCompiler_inline_result = - JSCompiler_inline_result & 201326677 - ? (JSCompiler_inline_result & 201326677) | 1 + JSCompiler_inline_result & 201326741 + ? (JSCompiler_inline_result & 201326741) | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0; } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$179, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$180, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$179, - root$179 === workInProgressRoot ? JSCompiler_inline_result : 0, - null !== root$179.cancelPendingCommit || - -1 !== root$179.timeoutHandle + root$180, + root$180 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$180.cancelPendingCommit || + -1 !== root$180.timeoutHandle )), - 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$179, JSCompiler_inline_result) || + (0 === (JSCompiler_inline_result & 3) && + 64 !== JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$180, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$179, JSCompiler_inline_result)); - root$179 = root$179.next; + performSyncWorkOnRoot(root$180, JSCompiler_inline_result)); + root$180 = root$180.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -12827,7 +12922,8 @@ function processRootScheduleInMicrotask() { null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev); else if ( - ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3)) + ((prev = root), + 0 !== syncTransitionLanes || 0 !== (nextLanes & 3) || 64 === nextLanes) ) mightHavePendingSyncWork = !0; root = next; @@ -13039,20 +13135,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1601 = 0; - i$jscomp$inline_1601 < simpleEventPluginEvents.length; - i$jscomp$inline_1601++ + var i$jscomp$inline_1605 = 0; + i$jscomp$inline_1605 < simpleEventPluginEvents.length; + i$jscomp$inline_1605++ ) { - var eventName$jscomp$inline_1602 = - simpleEventPluginEvents[i$jscomp$inline_1601], - domEventName$jscomp$inline_1603 = - eventName$jscomp$inline_1602.toLowerCase(), - capitalizedEvent$jscomp$inline_1604 = - eventName$jscomp$inline_1602[0].toUpperCase() + - eventName$jscomp$inline_1602.slice(1); + var eventName$jscomp$inline_1606 = + simpleEventPluginEvents[i$jscomp$inline_1605], + domEventName$jscomp$inline_1607 = + eventName$jscomp$inline_1606.toLowerCase(), + capitalizedEvent$jscomp$inline_1608 = + eventName$jscomp$inline_1606[0].toUpperCase() + + eventName$jscomp$inline_1606.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1603, - "on" + capitalizedEvent$jscomp$inline_1604 + domEventName$jscomp$inline_1607, + "on" + capitalizedEvent$jscomp$inline_1608 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14233,34 +14329,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$193 = props[hasSrc]; - if (null != propValue$193) + var propValue$194 = props[hasSrc]; + if (null != propValue$194) switch (hasSrc) { case "name": - hasSrcSet = propValue$193; + hasSrcSet = propValue$194; break; case "type": - propValue = propValue$193; + propValue = propValue$194; break; case "checked": - checked = propValue$193; + checked = propValue$194; break; case "defaultChecked": - defaultChecked = propValue$193; + defaultChecked = propValue$194; break; case "value": - propKey = propValue$193; + propKey = propValue$194; break; case "defaultValue": - defaultValue = propValue$193; + defaultValue = propValue$194; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$193) + if (null != propValue$194) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$193, props, null); + setProp(domElement, tag, hasSrc, propValue$194, props, null); } } initInput( @@ -14397,14 +14493,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$193 in props) - props.hasOwnProperty(propValue$193) && - ((hasSrc = props[propValue$193]), + for (propValue$194 in props) + props.hasOwnProperty(propValue$194) && + ((hasSrc = props[propValue$194]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$193, + propValue$194, hasSrc, props, void 0 @@ -14452,14 +14548,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$210 in nextProps) { - var propKey = nextProps[propKey$210]; - lastProp = lastProps[propKey$210]; + for (var propKey$211 in nextProps) { + var propKey = nextProps[propKey$211]; + lastProp = lastProps[propKey$211]; if ( - nextProps.hasOwnProperty(propKey$210) && + nextProps.hasOwnProperty(propKey$211) && (null != propKey || null != lastProp) ) - switch (propKey$210) { + switch (propKey$211) { case "type": propKey !== lastProp && (viewTransitionMutationContext = !0); type = propKey; @@ -14494,7 +14590,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$210, + propKey$211, propKey, nextProps, lastProp @@ -14513,7 +14609,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$210 = null; + propKey = value = defaultValue = propKey$211 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14545,7 +14641,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (name) { case "value": type !== lastDefaultValue && (viewTransitionMutationContext = !0); - propKey$210 = type; + propKey$211 = type; break; case "defaultValue": type !== lastDefaultValue && (viewTransitionMutationContext = !0); @@ -14568,15 +14664,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$210 - ? updateOptions(domElement, !!lastProps, propKey$210, !1) + null != propKey$211 + ? updateOptions(domElement, !!lastProps, propKey$211, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$210 = null; + propKey = propKey$211 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14601,7 +14697,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (value) { case "value": name !== type && (viewTransitionMutationContext = !0); - propKey$210 = name; + propKey$211 = name; break; case "defaultValue": name !== type && (viewTransitionMutationContext = !0); @@ -14616,17 +14712,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$210, propKey); + updateTextarea(domElement, propKey$211, propKey); return; case "option": - for (var propKey$226 in lastProps) + for (var propKey$227 in lastProps) if ( - ((propKey$210 = lastProps[propKey$226]), - lastProps.hasOwnProperty(propKey$226) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$226)) + ((propKey$211 = lastProps[propKey$227]), + lastProps.hasOwnProperty(propKey$227) && + null != propKey$211 && + !nextProps.hasOwnProperty(propKey$227)) ) - switch (propKey$226) { + switch (propKey$227) { case "selected": domElement.selected = !1; break; @@ -14634,34 +14730,34 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$226, + propKey$227, null, nextProps, - propKey$210 + propKey$211 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$210 = nextProps[lastDefaultValue]), + ((propKey$211 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$210 !== propKey && - (null != propKey$210 || null != propKey)) + propKey$211 !== propKey && + (null != propKey$211 || null != propKey)) ) switch (lastDefaultValue) { case "selected": - propKey$210 !== propKey && (viewTransitionMutationContext = !0); + propKey$211 !== propKey && (viewTransitionMutationContext = !0); domElement.selected = - propKey$210 && - "function" !== typeof propKey$210 && - "symbol" !== typeof propKey$210; + propKey$211 && + "function" !== typeof propKey$211 && + "symbol" !== typeof propKey$211; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$210, + propKey$211, nextProps, propKey ); @@ -14682,24 +14778,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$231 in lastProps) - (propKey$210 = lastProps[propKey$231]), - lastProps.hasOwnProperty(propKey$231) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$231) && - setProp(domElement, tag, propKey$231, null, nextProps, propKey$210); + for (var propKey$232 in lastProps) + (propKey$211 = lastProps[propKey$232]), + lastProps.hasOwnProperty(propKey$232) && + null != propKey$211 && + !nextProps.hasOwnProperty(propKey$232) && + setProp(domElement, tag, propKey$232, null, nextProps, propKey$211); for (checked in nextProps) if ( - ((propKey$210 = nextProps[checked]), + ((propKey$211 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$210 !== propKey && - (null != propKey$210 || null != propKey)) + propKey$211 !== propKey && + (null != propKey$211 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$210) + if (null != propKey$211) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14707,7 +14803,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$210, + propKey$211, nextProps, propKey ); @@ -14715,49 +14811,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$236 in lastProps) - (propKey$210 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && - void 0 !== propKey$210 && - !nextProps.hasOwnProperty(propKey$236) && + for (var propKey$237 in lastProps) + (propKey$211 = lastProps[propKey$237]), + lastProps.hasOwnProperty(propKey$237) && + void 0 !== propKey$211 && + !nextProps.hasOwnProperty(propKey$237) && setPropOnCustomElement( domElement, tag, - propKey$236, + propKey$237, void 0, nextProps, - propKey$210 + propKey$211 ); for (defaultChecked in nextProps) - (propKey$210 = nextProps[defaultChecked]), + (propKey$211 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$210 === propKey || - (void 0 === propKey$210 && void 0 === propKey) || + propKey$211 === propKey || + (void 0 === propKey$211 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$210, + propKey$211, nextProps, propKey ); return; } } - for (var propKey$241 in lastProps) - (propKey$210 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$241) && - setProp(domElement, tag, propKey$241, null, nextProps, propKey$210); + for (var propKey$242 in lastProps) + (propKey$211 = lastProps[propKey$242]), + lastProps.hasOwnProperty(propKey$242) && + null != propKey$211 && + !nextProps.hasOwnProperty(propKey$242) && + setProp(domElement, tag, propKey$242, null, nextProps, propKey$211); for (lastProp in nextProps) - (propKey$210 = nextProps[lastProp]), + (propKey$211 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$210 === propKey || - (null == propKey$210 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$210, nextProps, propKey); + propKey$211 === propKey || + (null == propKey$211 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$211, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15566,26 +15662,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$249 = getResourcesFromRoot( + var styles$250 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$250 = styles$249.get(type); - resource$250 || + resource$251 = styles$250.get(type); + resource$251 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$250 = { + (resource$251 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$249.set(type, resource$250), - (styles$249 = JSCompiler_inline_result.querySelector( + styles$250.set(type, resource$251), + (styles$250 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$249._p && - ((resource$250.instance = styles$249), - (resource$250.state.loading = 5)), + !styles$250._p && + ((resource$251.instance = styles$250), + (resource$251.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15598,16 +15694,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$249 || + styles$250 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$250.state + resource$251.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$250; + return resource$251; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15704,37 +15800,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$255 = hoistableRoot.querySelector( + var instance$256 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$255) + if (instance$256) return ( (resource.state.loading |= 4), - (resource.instance = instance$255), - markNodeAsHoistable(instance$255), - instance$255 + (resource.instance = instance$256), + markNodeAsHoistable(instance$256), + instance$256 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$255 = ( + instance$256 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$255); - var linkInstance = instance$255; + markNodeAsHoistable(instance$256); + var linkInstance = instance$256; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$255, "link", instance); + setInitialProperties(instance$256, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$255, props.precedence, hoistableRoot); - return (resource.instance = instance$255); + insertStylesheet(instance$256, props.precedence, hoistableRoot); + return (resource.instance = instance$256); case "script": - instance$255 = getScriptKey(props.src); + instance$256 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$255) + getScriptSelectorFromKey(instance$256) )) ) return ( @@ -15743,7 +15839,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$255))) + if ((styleProps = preloadPropsMap.get(instance$256))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16075,6 +16171,7 @@ function FiberRootNode( this.pooledCache = null; this.pooledCacheLanes = 0; this.formState = formState; + this.gestures = null; this.incompleteTransitions = new Map(); } function createFiberRoot( @@ -16762,16 +16859,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1853 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1857 = React.version; if ( - "19.1.0-experimental-cbbe8666-20250213" !== - isomorphicReactPackageVersion$jscomp$inline_1853 + "19.1.0-experimental-e670e72f-20250214" !== + isomorphicReactPackageVersion$jscomp$inline_1857 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1853, - "19.1.0-experimental-cbbe8666-20250213" + isomorphicReactPackageVersion$jscomp$inline_1857, + "19.1.0-experimental-e670e72f-20250214" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16791,24 +16888,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2393 = { +var internals$jscomp$inline_2397 = { bundleType: 0, - version: "19.1.0-experimental-cbbe8666-20250213", + version: "19.1.0-experimental-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213" + reconcilerVersion: "19.1.0-experimental-e670e72f-20250214" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2394 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2398 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2394.isDisabled && - hook$jscomp$inline_2394.supportsFiber + !hook$jscomp$inline_2398.isDisabled && + hook$jscomp$inline_2398.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2394.inject( - internals$jscomp$inline_2393 + (rendererID = hook$jscomp$inline_2398.inject( + internals$jscomp$inline_2397 )), - (injectedHook = hook$jscomp$inline_2394); + (injectedHook = hook$jscomp$inline_2398); } catch (err) {} } exports.createComponentSelector = function (component) { @@ -17051,4 +17148,4 @@ exports.observeVisibleRects = function ( } }; }; -exports.version = "19.1.0-experimental-cbbe8666-20250213"; +exports.version = "19.1.0-experimental-e670e72f-20250214"; 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 e0c0a366d76e4..30202ae9446a5 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-e670e72f-20250214"; "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 a314de83b3fc2..45c0cdde9a5f9 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-e670e72f-20250214"; 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 e9c3f1e251647..aa568c5c3b72f 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-e670e72f-20250214"; })(); 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 c348f1e587ad3..4b4b631a80941 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-e670e72f-20250214"; diff --git a/packages/next/src/compiled/react-dom-experimental/package.json b/packages/next/src/compiled/react-dom-experimental/package.json index 91464223eb963..4593b4e9fd472 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-e670e72f-20250214" }, "peerDependencies": { - "react": "0.0.0-experimental-cbbe8666-20250213" + "react": "0.0.0-experimental-e670e72f-20250214" }, "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 a239cd51457c6..6eace93ac59a4 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 @@ -601,8 +601,8 @@ if (lane & 8) return "InputContinuous"; if (lane & 16) return "DefaultHydration"; if (lane & 32) return "Default"; - if (lane & 64) return "TransitionHydration"; - if (lane & 4194176) return "Transition"; + if (lane & 128) return "TransitionHydration"; + if (lane & 4194048) return "Transition"; if (lane & 62914560) return "Retry"; if (lane & 67108864) return "SelectiveHydration"; if (lane & 134217728) return "IdleHydration"; @@ -629,6 +629,7 @@ case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -643,7 +644,7 @@ case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -705,7 +706,7 @@ ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -723,10 +724,10 @@ case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -766,7 +767,7 @@ function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -842,7 +843,7 @@ root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -865,7 +866,6 @@ case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -884,7 +884,7 @@ case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -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) { @@ -3728,17 +3829,19 @@ (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (nestedUpdateCount > NESTED_UPDATE_LIMIT) @@ -4261,7 +4364,7 @@ } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5441,7 +5544,7 @@ throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } hook.memoizedState = nextSnapshot; @@ -5524,7 +5627,7 @@ "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -6467,7 +6570,7 @@ queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -6631,6 +6734,7 @@ )), (current.return = returnFiber), (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6705,6 +6809,7 @@ )), (current.return = returnFiber), (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6727,6 +6832,7 @@ )), (newChild.return = returnFiber), (newChild._debugOwner = returnFiber), + (newChild._debugTask = returnFiber._debugTask), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -6774,6 +6880,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -7311,6 +7418,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), validateFragmentProps(newChild, lanes, returnFiber), (returnFiber = lanes)) @@ -7477,6 +7585,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), (returnFiber = lanes)), placeSingleChild(returnFiber) @@ -7506,10 +7615,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 +7701,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 +8375,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -8581,7 +8691,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 +8771,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 +8804,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 +8826,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 +8845,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 +8859,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 +8890,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 +8903,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 +8921,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -8871,32 +8973,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 +9040,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 +9127,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 +9228,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 +9273,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 +9298,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 +9356,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 +9799,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 +12926,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 +12954,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 +13175,8 @@ lanes ); mode._debugOwner = element._owner; + mode._debugStack = element._debugStack; + mode._debugTask = element._debugTask; return mode; } function createFiberFromFragment(elements, mode, lanes, key) { @@ -13402,7 +13514,7 @@ resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -14283,7 +14395,7 @@ throw Error("Should not already be working."); var shouldTimeSlice = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root.expiredLanes)) || checkIfRootIsPrerendering(root, lanes), exitStatus = shouldTimeSlice @@ -14376,7 +14488,7 @@ case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( shouldTimeSlice, @@ -14728,7 +14840,7 @@ function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -15536,7 +15648,7 @@ 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + 0 !== (lanes & 4194090) && 0 !== (remainingLanes & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -15924,8 +16036,8 @@ (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); nextLanes = - nextLanes & 201326677 - ? (nextLanes & 201326677) | 1 + nextLanes & 201326741 + ? (nextLanes & 201326741) | 1 : nextLanes ? nextLanes | 2 : 0; @@ -16230,6 +16342,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 +16371,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 +16394,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 +20414,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, @@ -21153,7 +21244,7 @@ clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log = Math.log, LN2 = Math.LN2, - nextTransitionLane = 128, + nextTransitionLane = 256, nextRetryLane = 4194304, DiscreteEventPriority = 2, ContinuousEventPriority = 8, @@ -24665,11 +24756,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24706,10 +24797,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213" + reconcilerVersion: "19.1.0-canary-e670e72f-20250214" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24853,7 +24944,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-e670e72f-20250214"; "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 c066445793dd2..23025a7d48a69 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 @@ -336,7 +336,7 @@ function clz32Fallback(x) { x >>>= 0; return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } -var nextTransitionLane = 128, +var nextTransitionLane = 256, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { var pendingSyncLanes = lanes & 42; @@ -357,6 +357,7 @@ function getHighestPriorityLanes(lanes) { case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -371,7 +372,7 @@ function getHighestPriorityLanes(lanes) { case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -427,7 +428,7 @@ function getNextLanes(root, wipLanes, rootHasPendingCommit) { ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -445,10 +446,10 @@ function computeExpirationTime(lane, currentTime) { case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -483,7 +484,7 @@ function computeExpirationTime(lane, currentTime) { function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -557,7 +558,7 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -580,7 +581,6 @@ function getBumpedLaneForHydrationByLane(lane) { case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -599,7 +599,7 @@ function getBumpedLaneForHydrationByLane(lane) { case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -2349,17 +2349,19 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (50 < nestedUpdateCount) @@ -2643,7 +2645,7 @@ function enqueueUpdate(fiber, update, lane) { } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -3571,7 +3573,7 @@ function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { ); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -4261,7 +4263,7 @@ function enqueueRenderPhaseUpdate(queue, update) { queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -4405,7 +4407,7 @@ var ContextOnlyDispatcher = { getServerSnapshot = getSnapshot(); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; @@ -9583,7 +9585,7 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -10275,7 +10277,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); var shouldTimeSlice = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root$jscomp$0.expiredLanes)) || checkIfRootIsPrerendering(root$jscomp$0, lanes), exitStatus = shouldTimeSlice @@ -10363,7 +10365,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { case 1: throw Error(formatProdErrorMessage(345)); case 4: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case 6: markRootSuspended( shouldTimeSlice, @@ -10656,7 +10658,7 @@ function pushAsyncDispatcher() { function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -11267,7 +11269,7 @@ function flushSpawnedWork() { 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + 0 !== (lanes & 4194090) && 0 !== (remainingLanes & 42) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -11481,8 +11483,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes); JSCompiler_inline_result = - JSCompiler_inline_result & 201326677 - ? (JSCompiler_inline_result & 201326677) | 1 + JSCompiler_inline_result & 201326741 + ? (JSCompiler_inline_result & 201326741) | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0; @@ -15250,14 +15252,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-e670e72f-20250214" !== isomorphicReactPackageVersion$jscomp$inline_1762 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1762, - "19.1.0-canary-cbbe8666-20250213" + "19.1.0-canary-e670e72f-20250214" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15279,10 +15281,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2243 = { bundleType: 0, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213" + reconcilerVersion: "19.1.0-canary-e670e72f-20250214" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2244 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -15386,4 +15388,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-e670e72f-20250214"; 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 29446aea4aad4..9f32549af09f8 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 @@ -609,8 +609,8 @@ if (lane & 8) return "InputContinuous"; if (lane & 16) return "DefaultHydration"; if (lane & 32) return "Default"; - if (lane & 64) return "TransitionHydration"; - if (lane & 4194176) return "Transition"; + if (lane & 128) return "TransitionHydration"; + if (lane & 4194048) return "Transition"; if (lane & 62914560) return "Retry"; if (lane & 67108864) return "SelectiveHydration"; if (lane & 134217728) return "IdleHydration"; @@ -637,6 +637,7 @@ case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -651,7 +652,7 @@ case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -713,7 +714,7 @@ ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -731,10 +732,10 @@ case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -774,7 +775,7 @@ function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -850,7 +851,7 @@ root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -873,7 +874,6 @@ case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -892,7 +892,7 @@ case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -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) { @@ -3736,17 +3837,19 @@ (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (nestedUpdateCount > NESTED_UPDATE_LIMIT) @@ -4269,7 +4372,7 @@ } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5449,7 +5552,7 @@ throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } hook.memoizedState = nextSnapshot; @@ -5532,7 +5635,7 @@ "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -6475,7 +6578,7 @@ queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -6639,6 +6742,7 @@ )), (current.return = returnFiber), (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6713,6 +6817,7 @@ )), (current.return = returnFiber), (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6735,6 +6840,7 @@ )), (newChild.return = returnFiber), (newChild._debugOwner = returnFiber), + (newChild._debugTask = returnFiber._debugTask), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -6782,6 +6888,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -7319,6 +7426,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), validateFragmentProps(newChild, lanes, returnFiber), (returnFiber = lanes)) @@ -7485,6 +7593,7 @@ )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), (returnFiber = lanes)), placeSingleChild(returnFiber) @@ -7514,10 +7623,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 +7709,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 +8383,7 @@ return workInProgress.child; } function updateClassComponent( - current$jscomp$0, + current, workInProgress, Component, nextProps, @@ -8589,7 +8699,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 +8779,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 +8812,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 +8834,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 +8853,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 +8867,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 +8898,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 +8911,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 +8929,7 @@ getComponentNameFromFiber(workInProgress) || "a component" ), (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + return current; } function mountHostRootWithoutHydrating( current, @@ -8879,32 +8981,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 +9048,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 +9135,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 +9236,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 +9281,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 +9306,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 +9364,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 +9807,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 +12934,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 +12962,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 +13183,8 @@ lanes ); mode._debugOwner = element._owner; + mode._debugStack = element._debugStack; + mode._debugTask = element._debugTask; return mode; } function createFiberFromFragment(elements, mode, lanes, key) { @@ -13410,7 +13522,7 @@ resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -14291,7 +14403,7 @@ throw Error("Should not already be working."); var shouldTimeSlice = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root.expiredLanes)) || checkIfRootIsPrerendering(root, lanes), exitStatus = shouldTimeSlice @@ -14384,7 +14496,7 @@ case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( shouldTimeSlice, @@ -14740,7 +14852,7 @@ function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -15548,7 +15660,7 @@ 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + 0 !== (lanes & 4194090) && 0 !== (remainingLanes & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -15936,8 +16048,8 @@ (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); nextLanes = - nextLanes & 201326677 - ? (nextLanes & 201326677) | 1 + nextLanes & 201326741 + ? (nextLanes & 201326741) | 1 : nextLanes ? nextLanes | 2 : 0; @@ -16242,6 +16354,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 +16383,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 +16406,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 +20426,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, @@ -21210,7 +21301,7 @@ clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log = Math.log, LN2 = Math.LN2, - nextTransitionLane = 128, + nextTransitionLane = 256, nextRetryLane = 4194304, DiscreteEventPriority = 2, ContinuousEventPriority = 8, @@ -24722,11 +24813,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-canary-cbbe8666-20250213" !== isomorphicReactPackageVersion) + if ("19.1.0-canary-e670e72f-20250214" !== 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-e670e72f-20250214\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24763,10 +24854,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213" + reconcilerVersion: "19.1.0-canary-e670e72f-20250214" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25240,7 +25331,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-canary-cbbe8666-20250213"; + exports.version = "19.1.0-canary-e670e72f-20250214"; "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 937a88fe88ada..e147cac6ca03c 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 @@ -379,8 +379,8 @@ function getLabelForLane(lane) { if (lane & 8) return "InputContinuous"; if (lane & 16) return "DefaultHydration"; if (lane & 32) return "Default"; - if (lane & 64) return "TransitionHydration"; - if (lane & 4194176) return "Transition"; + if (lane & 128) return "TransitionHydration"; + if (lane & 4194048) return "Transition"; if (lane & 62914560) return "Retry"; if (lane & 67108864) return "SelectiveHydration"; if (lane & 134217728) return "IdleHydration"; @@ -388,7 +388,7 @@ function getLabelForLane(lane) { if (lane & 536870912) return "Offscreen"; if (lane & 1073741824) return "Deferred"; } -var nextTransitionLane = 128, +var nextTransitionLane = 256, nextRetryLane = 4194304; function getHighestPriorityLanes(lanes) { var pendingSyncLanes = lanes & 42; @@ -409,6 +409,7 @@ function getHighestPriorityLanes(lanes) { case 64: return 64; case 128: + return 128; case 256: case 512: case 1024: @@ -423,7 +424,7 @@ function getHighestPriorityLanes(lanes) { case 524288: case 1048576: case 2097152: - return lanes & 4194176; + return lanes & 4194048; case 4194304: case 8388608: case 16777216: @@ -479,7 +480,7 @@ function getNextLanes(root, wipLanes, rootHasPendingCommit) { ((suspendedLanes = nextLanes & -nextLanes), (rootHasPendingCommit = wipLanes & -wipLanes), suspendedLanes >= rootHasPendingCommit || - (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) ? wipLanes : nextLanes; } @@ -497,10 +498,10 @@ function computeExpirationTime(lane, currentTime) { case 2: case 4: case 8: + case 64: return currentTime + 250; case 16: case 32: - case 64: case 128: case 256: case 512: @@ -535,7 +536,7 @@ function computeExpirationTime(lane, currentTime) { function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); return lane; } function claimNextRetryLane() { @@ -609,7 +610,7 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | 1073741824 | - (entangledLanes & 4194218); + (entangledLanes & 4194090); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -632,7 +633,6 @@ function getBumpedLaneForHydrationByLane(lane) { case 32: lane = 16; break; - case 128: case 256: case 512: case 1024: @@ -651,7 +651,7 @@ function getBumpedLaneForHydrationByLane(lane) { case 8388608: case 16777216: case 33554432: - lane = 64; + lane = 128; break; case 268435456: lane = 134217728; @@ -2431,17 +2431,19 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)), (sourceFiber = parent), (parent = parent.return); - isHidden && - null !== update && - 3 === sourceFiber.tag && - ((parent = sourceFiber.stateNode), - (isHidden = 31 - clz32(lane)), - (parent = parent.hiddenUpdates), - (sourceFiber = parent[isHidden]), - null === sourceFiber - ? (parent[isHidden] = [update]) - : sourceFiber.push(update), - (update.lane = lane | 536870912)); + return 3 === sourceFiber.tag + ? ((parent = sourceFiber.stateNode), + isHidden && + null !== update && + ((isHidden = 31 - clz32(lane)), + (sourceFiber = parent.hiddenUpdates), + (alternate = sourceFiber[isHidden]), + null === alternate + ? (sourceFiber[isHidden] = [update]) + : alternate.push(update), + (update.lane = lane | 536870912)), + parent) + : null; } function getRootForUpdatedFiber(sourceFiber) { if (50 < nestedUpdateCount) @@ -2779,7 +2781,7 @@ function enqueueUpdate(fiber, update, lane) { } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -3712,7 +3714,7 @@ function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { ); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || + 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -4405,7 +4407,7 @@ function enqueueRenderPhaseUpdate(queue, update) { queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { + if (0 !== (lane & 4194048)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -4549,7 +4551,7 @@ var ContextOnlyDispatcher = { getServerSnapshot = getSnapshot(); if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || + 0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; @@ -10011,7 +10013,7 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { resource = suspenseHandlerStackCursor.current; if ( null !== resource && - ((workInProgressRootRenderLanes & 4194176) === + ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : ((workInProgressRootRenderLanes & 62914560) !== @@ -10770,7 +10772,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); var shouldTimeSlice = (!forceSync && - 0 === (lanes & 60) && + 0 === (lanes & 124) && 0 === (lanes & root$jscomp$0.expiredLanes)) || checkIfRootIsPrerendering(root$jscomp$0, lanes), exitStatus = shouldTimeSlice @@ -10858,7 +10860,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { case 1: throw Error(formatProdErrorMessage(345)); case 4: - if ((lanes & 4194176) !== lanes) break; + if ((lanes & 4194048) !== lanes) break; case 6: markRootSuspended( shouldTimeSlice, @@ -11181,7 +11183,7 @@ function pushAsyncDispatcher() { function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; workInProgressRootDidSkipSuspendedSiblings || - ((workInProgressRootRenderLanes & 4194176) !== + ((workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current) || (workInProgressRootIsPrerendering = !0); @@ -11875,7 +11877,7 @@ function flushSpawnedWork() { 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); ensureRootIsScheduled(root); remainingLanes = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + 0 !== (lanes & 4194090) && 0 !== (remainingLanes & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -12107,8 +12109,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes); JSCompiler_inline_result = - JSCompiler_inline_result & 201326677 - ? (JSCompiler_inline_result & 201326677) | 1 + JSCompiler_inline_result & 201326741 + ? (JSCompiler_inline_result & 201326741) | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0; @@ -15898,14 +15900,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-e670e72f-20250214" !== isomorphicReactPackageVersion$jscomp$inline_1858 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1858, - "19.1.0-canary-cbbe8666-20250213" + "19.1.0-canary-e670e72f-20250214" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15927,10 +15929,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_1865 = { bundleType: 0, - version: "19.1.0-canary-cbbe8666-20250213", + version: "19.1.0-canary-e670e72f-20250214", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213", + reconcilerVersion: "19.1.0-canary-e670e72f-20250214", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$281 = 0; @@ -16210,7 +16212,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-e670e72f-20250214"; "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 feb435649e3cc..45076cafc6756 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-e670e72f-20250214"; })(); 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 e2858d83acd12..43194f9bdd877 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-e670e72f-20250214"; 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 bff25a3707216..1f1d4870dd122 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-e670e72f-20250214"; })(); 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 acc8d62989bbe..b5a4e956aa8f7 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-e670e72f-20250214"; 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 da85692ad30cb..b2929f2dfa829 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-e670e72f-20250214" !== 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-e670e72f-20250214\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-e670e72f-20250214"; })(); 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 269df36f19d7e..8c030d0d351ed 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-e670e72f-20250214" !== isomorphicReactPackageVersion) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion, - "19.1.0-canary-cbbe8666-20250213" + "19.1.0-canary-e670e72f-20250214" ) ); } @@ -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-e670e72f-20250214"; 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 5660f0f9712a2..54ece2fc97e3d 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-e670e72f-20250214" !== 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-e670e72f-20250214\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-e670e72f-20250214"; 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 72f7e79e3beca..a1575ac1f4cbd 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-e670e72f-20250214" !== 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-e670e72f-20250214\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-e670e72f-20250214"; })(); 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 256fb94c3dab1..bac2b0581bedb 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-e670e72f-20250214" !== 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-e670e72f-20250214\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-e670e72f-20250214"; 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 624535bd13358..fc003cf4f4007 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-e670e72f-20250214" !== 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-e670e72f-20250214\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-e670e72f-20250214"; })(); 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 f2b7d871182e7..48001c4f96e20 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-e670e72f-20250214" !== 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-e670e72f-20250214\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-e670e72f-20250214"; 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 12e51c977fdfd..888f4ce24afe0 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-e670e72f-20250214"; "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 42588415b8e26..c73fda0be2b70 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-e670e72f-20250214"; 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 c928527a48ed3..b6da0af9f2576 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-e670e72f-20250214"; })(); 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 60f4db1f1f2b2..da9ea00712c22 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-e670e72f-20250214"; diff --git a/packages/next/src/compiled/react-dom/package.json b/packages/next/src/compiled/react-dom/package.json index bd44ddc486935..0f7e7e55ae035 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-e670e72f-20250214" }, "peerDependencies": { - "react": "19.1.0-canary-cbbe8666-20250213" + "react": "19.1.0-canary-e670e72f-20250214" }, "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 c836c6dd39a16..3d59333ae80d8 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.development.js @@ -1188,6 +1188,9 @@ exports.unstable_useCacheRefresh = function () { return resolveDispatcher().useCacheRefresh(); }; + exports.unstable_useSwipeTransition = function (previous, current, next) { + return resolveDispatcher().useSwipeTransition(previous, current, next); + }; exports.use = function (usable) { return resolveDispatcher().use(usable); }; @@ -1274,7 +1277,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-experimental-cbbe8666-20250213"; + exports.version = "19.1.0-experimental-e670e72f-20250214"; "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 6839f91b3746d..12814fc228e39 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( @@ -516,6 +510,9 @@ exports.unstable_postpone = function (reason) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; +exports.unstable_useSwipeTransition = function (previous, current, next) { + return ReactSharedInternals.H.useSwipeTransition(previous, current, next); +}; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); }; @@ -579,4 +576,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-e670e72f-20250214"; 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 bd3d71e08ba25..a577412e8e250 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-e670e72f-20250214"; })(); 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 6cc046457e5f0..3cdb027618d7b 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-e670e72f-20250214"; diff --git a/packages/next/src/compiled/react-is/package.json b/packages/next/src/compiled/react-is/package.json index 6ef0c148eefa2..84a07b12539b9 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-e670e72f-20250214", "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 ad152b8154103..ede24aaa6c1da 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-e670e72f-20250214", rendererPackageName: "react-server-dom-turbopack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213", + reconcilerVersion: "19.1.0-experimental-e670e72f-20250214", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.development.js index dcae4b3eccf4f..a42248eb2e2fd 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.development.js @@ -3790,24 +3790,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3821,47 +3849,21 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } - }, - currentOwner = null, + }; + HooksDispatcher.useEffectEvent = unsupportedHook; + HooksDispatcher.useSwipeTransition = unsupportedHook; + var currentOwner = null, DefaultAsyncDispatcher = { getCacheForType: function (resourceType) { var cache = (cache = currentRequest ? currentRequest : null) diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.production.js index 47abd609a5c17..03a3bcc879600 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.production.js @@ -508,40 +508,42 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; +HooksDispatcher.useEffectEvent = unsupportedHook; +HooksDispatcher.useSwipeTransition = unsupportedHook; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); } diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.development.js index a70dfb3d5ca19..2ec2eb6b90e00 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.development.js @@ -3887,24 +3887,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3918,47 +3946,21 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } - }, - currentOwner = null, + }; + HooksDispatcher.useEffectEvent = unsupportedHook; + HooksDispatcher.useSwipeTransition = unsupportedHook; + var currentOwner = null, DefaultAsyncDispatcher = { getCacheForType: function (resourceType) { var cache = (cache = resolveRequest()) ? cache.cache : new Map(); diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.production.js index 38ca1e59ee99a..0d52d61b20ad3 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.production.js @@ -506,40 +506,42 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; +HooksDispatcher.useEffectEvent = unsupportedHook; +HooksDispatcher.useSwipeTransition = unsupportedHook; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); } diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.development.js index 4226e13330872..bce690259c614 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.development.js @@ -3875,24 +3875,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3906,47 +3934,21 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } - }, - currentOwner = null, + }; + HooksDispatcher.useEffectEvent = unsupportedHook; + HooksDispatcher.useSwipeTransition = unsupportedHook; + var currentOwner = null, DefaultAsyncDispatcher = { getCacheForType: function (resourceType) { var cache = (cache = resolveRequest()) ? cache.cache : new Map(); diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.production.js index 6c9502db3987b..70431cb2bcdc6 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.production.js @@ -526,40 +526,42 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; +HooksDispatcher.useEffectEvent = unsupportedHook; +HooksDispatcher.useSwipeTransition = unsupportedHook; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); } 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 e4d69bed76c62..5d972ceb09112 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-e670e72f-20250214", + "react-dom": "0.0.0-experimental-e670e72f-20250214" } } \ 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 e6545b7d7e7af..a80df061f6032 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-e670e72f-20250214", rendererPackageName: "react-server-dom-turbopack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213", + reconcilerVersion: "19.1.0-canary-e670e72f-20250214", 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 76f7b8c740a6a..9668dd47994d9 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 23de4540b346d..c4319fce5dcd3 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 1e3b5ba97466d..22e2e4b21f915 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) { @@ -3434,24 +3618,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3465,44 +3677,16 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } }, currentOwner = null, @@ -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.browser.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js index dc9ea9497586e..f834213cd1c30 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js @@ -507,39 +507,39 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); 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 5d06b712b347a..b65102cd2aa67 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) { @@ -3478,24 +3702,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3509,44 +3761,16 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } }, currentOwner = null, @@ -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.edge.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js index 30a7cbecc9182..bcccec6b7f904 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js @@ -505,39 +505,39 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); 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 11f83524bd52d..a6d9c75e90d41 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) { @@ -3495,24 +3699,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3526,44 +3758,16 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } }, currentOwner = null, @@ -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 3e6e6874d2176..e34438b46f4ed 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 @@ -525,39 +525,39 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); @@ -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 4508082874472..2ec67ab2005fe 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-e670e72f-20250214", + "react-dom": "19.1.0-canary-e670e72f-20250214" } } \ 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 2a941746bf15e..f1f210db643ba 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-e670e72f-20250214", rendererPackageName: "react-server-dom-webpack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-experimental-cbbe8666-20250213", + reconcilerVersion: "19.1.0-experimental-e670e72f-20250214", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js index 7277bdaccdb0e..9143d6a2f7f69 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js @@ -3797,24 +3797,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3828,47 +3856,21 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } - }, - currentOwner = null, + }; + HooksDispatcher.useEffectEvent = unsupportedHook; + HooksDispatcher.useSwipeTransition = unsupportedHook; + var currentOwner = null, DefaultAsyncDispatcher = { getCacheForType: function (resourceType) { var cache = (cache = currentRequest ? currentRequest : null) diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.js index 3e02446fb4746..8e874e7ef5b05 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.js @@ -508,40 +508,42 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; +HooksDispatcher.useEffectEvent = unsupportedHook; +HooksDispatcher.useSwipeTransition = unsupportedHook; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js index bdf3ae11cd5eb..ac8e917dda864 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js @@ -3890,24 +3890,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3921,47 +3949,21 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } - }, - currentOwner = null, + }; + HooksDispatcher.useEffectEvent = unsupportedHook; + HooksDispatcher.useSwipeTransition = unsupportedHook; + var currentOwner = null, DefaultAsyncDispatcher = { getCacheForType: function (resourceType) { var cache = (cache = resolveRequest()) ? cache.cache : new Map(); diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js index 838ffb9b64c08..020517669ddd5 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js @@ -506,40 +506,42 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; +HooksDispatcher.useEffectEvent = unsupportedHook; +HooksDispatcher.useSwipeTransition = unsupportedHook; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js index df7fb038df8f7..cf4595bf23e8c 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js @@ -3878,24 +3878,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3909,47 +3937,21 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } - }, - currentOwner = null, + }; + HooksDispatcher.useEffectEvent = unsupportedHook; + HooksDispatcher.useSwipeTransition = unsupportedHook; + var currentOwner = null, DefaultAsyncDispatcher = { getCacheForType: function (resourceType) { var cache = (cache = resolveRequest()) ? cache.cache : new Map(); diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js index 226203d5838a4..c0375963fdd07 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js @@ -526,40 +526,42 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; +HooksDispatcher.useEffectEvent = unsupportedHook; +HooksDispatcher.useSwipeTransition = unsupportedHook; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js index c8e48c6186887..dcb13de86196a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js @@ -3841,24 +3841,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3872,47 +3900,21 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } - }, - currentOwner = null, + }; + HooksDispatcher.useEffectEvent = unsupportedHook; + HooksDispatcher.useSwipeTransition = unsupportedHook; + var currentOwner = null, DefaultAsyncDispatcher = { getCacheForType: function (resourceType) { var cache = (cache = resolveRequest()) ? cache.cache : new Map(); diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.js index 4edc835feecdb..70bc063b4fcba 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.js @@ -526,40 +526,42 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; +HooksDispatcher.useEffectEvent = unsupportedHook; +HooksDispatcher.useSwipeTransition = unsupportedHook; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); } 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 cc97605868c4a..8c2a876891e9e 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-e670e72f-20250214", + "react-dom": "0.0.0-experimental-e670e72f-20250214", "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 c605295a622e0..9b905044ca6fc 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-e670e72f-20250214", rendererPackageName: "react-server-dom-webpack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-canary-cbbe8666-20250213", + reconcilerVersion: "19.1.0-canary-e670e72f-20250214", 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 392c9302d68d4..67f8550a17bbd 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 c24897fa972c0..ff1fda9de6b84 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 95c7832e6b618..38d3baa24ab4d 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 0bc5c2f8becb9..725dffce90112 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) { @@ -3441,24 +3625,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3472,44 +3684,16 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } }, currentOwner = null, @@ -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.browser.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js index 2d37902e4cff8..99590ca3da5aa 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js @@ -507,39 +507,39 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); 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 af07d05872f6d..c6b844e399d4a 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) { @@ -3481,24 +3705,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3512,44 +3764,16 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } }, currentOwner = null, @@ -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.edge.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js index 591f7514fec5b..043f04f5cd13e 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js @@ -505,39 +505,39 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); 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 c36ffb94c97cb..7d3cb891455a7 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) { @@ -3498,24 +3702,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3529,44 +3761,16 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } }, currentOwner = null, @@ -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 55aecba15b25a..27eb26e0f2f02 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 @@ -525,39 +525,39 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); @@ -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 d05cceacd06bd..aa2d94dd1a5c2 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) { @@ -3461,24 +3665,52 @@ thenableState = null, currentComponentDebugInfo = null, HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); + readContext: unsupportedContext, + use: function (usable) { + if ( + (null !== usable && "object" === typeof usable) || + "function" === typeof usable + ) { + if ("function" === typeof usable.then) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, usable, index); + } + usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); + } + if (isClientReference(usable)) { + if ( + null != usable.value && + usable.value.$$typeof === REACT_CONTEXT_TYPE + ) + throw Error( + "Cannot read a Client Context from a Server Component." + ); + throw Error("Cannot use() an already resolved Client Reference."); + } + throw Error( + "An unsupported type was passed to use(): " + String(usable) + ); }, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: function () { if (null === currentRequest$1) throw Error("useId can only be used while React is rendering"); @@ -3492,44 +3724,16 @@ ); }, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: function (usable) { - if ( - (null !== usable && "object" === typeof usable) || - "function" === typeof usable - ) { - if ("function" === typeof usable.then) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, usable, index); - } - usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext(); - } - if (isClientReference(usable)) { - if ( - null != usable.value && - usable.value.$$typeof === REACT_CONTEXT_TYPE - ) - throw Error( - "Cannot read a Client Context from a Server Component." - ); - throw Error("Cannot use() an already resolved Client Reference."); - } - throw Error( - "An unsupported type was passed to use(): " + String(usable) - ); + useCacheRefresh: function () { + return unsupportedRefresh; } }, currentOwner = null, @@ -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 9dd98c525f7e2..f4cba231bb84f 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 @@ -525,39 +525,39 @@ function getThenableStateAfterSuspending() { return state; } var HooksDispatcher = { - useMemo: function (nextCreate) { - return nextCreate(); - }, + readContext: unsupportedContext, + use: use, useCallback: function (callback) { return callback; }, - useDebugValue: function () {}, - useDeferredValue: unsupportedHook, - useTransition: unsupportedHook, - readContext: unsupportedContext, useContext: unsupportedContext, + useEffect: unsupportedHook, + useImperativeHandle: unsupportedHook, + useLayoutEffect: unsupportedHook, + useInsertionEffect: unsupportedHook, + useMemo: function (nextCreate) { + return nextCreate(); + }, useReducer: unsupportedHook, useRef: unsupportedHook, useState: unsupportedHook, - useInsertionEffect: unsupportedHook, - useLayoutEffect: unsupportedHook, - useImperativeHandle: unsupportedHook, - useEffect: unsupportedHook, + useDebugValue: function () {}, + useDeferredValue: unsupportedHook, + useTransition: unsupportedHook, + useSyncExternalStore: unsupportedHook, useId: useId, useHostTransitionStatus: unsupportedHook, - useOptimistic: unsupportedHook, useFormState: unsupportedHook, useActionState: unsupportedHook, - useSyncExternalStore: unsupportedHook, - useCacheRefresh: function () { - return unsupportedRefresh; - }, + useOptimistic: unsupportedHook, useMemoCache: function (size) { for (var data = Array(size), i = 0; i < size; i++) data[i] = REACT_MEMO_CACHE_SENTINEL; return data; }, - use: use + useCacheRefresh: function () { + return unsupportedRefresh; + } }; function unsupportedHook() { throw Error("This Hook is not supported in Server Components."); @@ -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 f49aa339085c2..47ed23597962b 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-e670e72f-20250214", + "react-dom": "19.1.0-canary-e670e72f-20250214", "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 cf66094f0cadd..051b6b0757009 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 1ee98d74d1741..c865e638ed3c4 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 06522b5c8b968..780a9f47b7c05 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 bff2f080f0e7b..2da866928d995 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 0f86bb2bfc55b..c2f86fe74349e 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-e670e72f-20250214"; "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 9bfd45fce843c..bb64de4cd528d 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-e670e72f-20250214"; 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 f0a1f3fd8d5c1..38488c394bd6f 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-e670e72f-20250214"; })(); 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 35532471d461f..ec6f48f369315 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-e670e72f-20250214"; diff --git a/packages/next/src/compiled/unistore/unistore.js b/packages/next/src/compiled/unistore/unistore.js index be3deb584b62c..338f2d7034d3b 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={81: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=14.0.0'} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 - react-dom: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 '@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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214: + resolution: {integrity: sha512-Fnmq+ydS4KmfDh+wiP3A5J2vLCgh0CEDAh49D9VyEZiZxMiWeUOxTHutsP5II5dEjFGL0IcO66GDdqLysxx61g==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 - react-dom@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-pslvPz3DmBQlDzIB5Nrh9XAJaWKN2ootEO1DTF7WN0XzFOfEYaEhNnuM9rBP1GhizAdybB3Uw4+RoWmb0AJ5aA==} + react-dom@19.1.0-canary-e670e72f-20250214: + resolution: {integrity: sha512-/wTpyN0oxytFrqCctrwuOVT2OqHzuOh2TQwc9LHaNCHihQlL0YAFJiXLgQofDjx+0l7AhmQCgFDqIZxBugH11w==} peerDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 - react-is@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-exkCIfnr9J9Kf6CnpqjUxA3cd7t7JQvZ3tHqELhxqTlNTFDCgQ7uQz2JFZWB+ozMkrUzVGz4I6+lKrwJypjfHA==} + react-is@19.1.0-canary-e670e72f-20250214: + resolution: {integrity: sha512-WWKdKI7diFQA4jz+Rt4sQdcdTv8zkSoTjxH9y+vVOX6TgXHHOUFcTlmxUHn3I6ZBuJqtd3rHqR1sYXu4W03HlQ==} 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214: + resolution: {integrity: sha512-iRmQqVuTCk4zOsHz1gDuNrTim0ASNbNrQW6DSjQQiQwakRQl01b6l2WZ7D7oWnJbGJNEg6zWHhyxfocNOzURLw==} 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 - react-server-dom-turbopack@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-jbBVeCuQ5lvpPkuLZIqzukxC4Wx2DzxEsxxVuZH1XtPUJtNr1WwmyXO9uNQC1cMmHGEhI1QjDdOX64J+X11eaw==} + react-server-dom-turbopack@19.1.0-canary-e670e72f-20250214: + resolution: {integrity: sha512-GvS2H5QCyZTdgOXyFdB2qyj78dqS/knsalnil03ocNC5YwocobcQa3PtTKRyQPOjiptJZBgpP2Ska2uqHXqq7A==} 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 - 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-e670e72f-20250214: + resolution: {integrity: sha512-OL1VVr6fAodG4k51zEFIZVmZl+SHSsGCky2pfUXS8Prol9dW3pDeqPybum1L6OGnnn58fkfeftdUX4k+HmvaQQ==} 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214: + resolution: {integrity: sha512-ZQhy5+wgF120garJNCtN/mIzasqKCblLxp6BHWODXEnKB/vLuDAuT2gDyD8om64/GbNxiw41I4v6tjEaXYAHmw==} 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 + react-is: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 - react@0.0.0-experimental-cbbe8666-20250213: - resolution: {integrity: sha512-ODlwQg48Z/JS9AUli5BtiGeA0QjWL7zNXrODXNa6L0BBwG9+3sgr0mpVNbxgRHOorQLYQ6O00JfBbxxecBLIZg==} + react@0.0.0-experimental-e670e72f-20250214: + resolution: {integrity: sha512-sKlJ5aiUTjF89Gri96tuDBE81RdEGaAvOdKGZYhFDbOLk6aOoHGndoeR9YNTZYZIcksaQsLzrWgT8Pn+gMgVog==} engines: {node: '>=0.10.0'} - react@19.1.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-Bpp/DlY/LSKmC41f24nBfsYRISASvSDwJ4L2kn+aftqX3TKpUGWWUxDQoQYq0OC27zmEjQiUvwaDmTzYgb6wgA==} + react@19.1.0-canary-e670e72f-20250214: + resolution: {integrity: sha512-iOFfltAVqiYf2RpQgzxF6ol6XvONpl+0BO0Zu3ecanP1oAeIZDT1+Vci32EOIev99f9kvgMe8MEMJzyXxaeCkg==} 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-e670e72f-20250214: + resolution: {integrity: sha512-gCHPvgTY/E5ovAf6biyqWjavHWoNr8nIm5J4/Q0Iq6ZwD09NxGJEwApHEx1zsxtWA/oHBvtQu8KCI7Wm8ZSlug==} - scheduler@0.26.0-canary-cbbe8666-20250213: - resolution: {integrity: sha512-+qFz4ccaqDv7uKM4QX+KDldGlYaGsnn+tsQf1nTjn45IoP6BaOO/lcFOVeqp4Mi4Iv/9zZExhYBg0775tTIiww==} + scheduler@0.26.0-canary-e670e72f-20250214: + resolution: {integrity: sha512-dXK77VYvOLjES8trq6m1h8EOYnwXWJz8MTzk3HkK3WqTkg2wGSqGWvv2sGbebOqRrjAxDGx3qZJJMTTwIYlYEw==} 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214)': 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-e670e72f-20250214) '@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-e670e72f-20250214 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-e670e72f-20250214)': dependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 '@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-e670e72f-20250214)': dependencies: '@types/mdx': 2.0.3 '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 '@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-e670e72f-20250214)': dependencies: '@types/mdx': 2.0.3 '@types/react': 19.0.8 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 '@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-e670e72f-20250214) + '@storybook/blocks': 8.5.2(react-dom@19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(storybook@8.5.2(prettier@3.3.3)) + react: 19.1.0-canary-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) '@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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)': 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) '@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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(storybook@8.5.2(prettier@3.3.3))(typescript@5.7.2) + react: 19.1.0-canary-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)': 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214): dependencies: - react: 19.1.0-canary-cbbe8666-20250213 - scheduler: 0.26.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 + scheduler: 0.26.0-canary-e670e72f-20250214 - react-dom@19.1.0-canary-cbbe8666-20250213(react@19.1.0-canary-cbbe8666-20250213): + react-dom@19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214): dependencies: - react: 19.1.0-canary-cbbe8666-20250213 - scheduler: 0.26.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 + scheduler: 0.26.0-canary-e670e72f-20250214 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-e670e72f-20250214 - react-is@19.1.0-canary-cbbe8666-20250213: {} + react-is@19.1.0-canary-e670e72f-20250214: {} 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-e670e72f-20250214(react-dom@19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214): 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) - 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-e670e72f-20250214(react-dom@19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214): 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) - 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-e670e72f-20250214(react-dom@19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214(react-dom@19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214)(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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214): 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-e670e72f-20250214 + react-is: 19.1.0-canary-e670e72f-20250214 - 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-e670e72f-20250214): dependencies: object-is: 1.0.2 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214): 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-e670e72f-20250214 + react-is: 19.1.0-canary-e670e72f-20250214 + react-shallow-renderer: 16.15.0(react@19.1.0-canary-e670e72f-20250214) + scheduler: 0.26.0-canary-e670e72f-20250214 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214): 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) react-lifecycles-compat: 3.0.4 - react@0.0.0-experimental-cbbe8666-20250213: {} + react@0.0.0-experimental-e670e72f-20250214: {} - react@19.1.0-canary-cbbe8666-20250213: {} + react@19.1.0-canary-e670e72f-20250214: {} 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-e670e72f-20250214: {} - scheduler@0.26.0-canary-cbbe8666-20250213: {} + scheduler@0.26.0-canary-e670e72f-20250214: {} 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-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214))(react@19.1.0-canary-e670e72f-20250214): 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-e670e72f-20250214 + react-dom: 19.1.0-canary-e670e72f-20250214(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214): dependencies: client-only: 0.0.1 - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214): 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-e670e72f-20250214 + use-sync-external-store: 1.2.0(react@19.1.0-canary-e670e72f-20250214) 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-e670e72f-20250214): optionalDependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 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-e670e72f-20250214): dependencies: - react: 19.1.0-canary-cbbe8666-20250213 + react: 19.1.0-canary-e670e72f-20250214 util-deprecate@1.0.2: {}