diff --git a/examples/reproduction-template/package.json b/examples/reproduction-template/package.json index 282b16c34a860..5cb957f196733 100644 --- a/examples/reproduction-template/package.json +++ b/examples/reproduction-template/package.json @@ -7,8 +7,8 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-778e1ed2-20240926", - "react-dom": "19.0.0-rc-778e1ed2-20240926" + "react": "19.0.0-rc-3edc000d-20240926", + "react-dom": "19.0.0-rc-3edc000d-20240926" }, "devDependencies": { "@types/node": "20.12.12", diff --git a/package.json b/package.json index 9584fbec3f815..fafaa93176037 100644 --- a/package.json +++ b/package.json @@ -208,19 +208,19 @@ "pretty-bytes": "5.3.0", "pretty-ms": "7.0.0", "random-seed": "0.3.0", - "react": "19.0.0-rc-778e1ed2-20240926", + "react": "19.0.0-rc-3edc000d-20240926", "react-17": "npm:react@17.0.2", - "react-builtin": "npm:react@19.0.0-rc-778e1ed2-20240926", - "react-dom": "19.0.0-rc-778e1ed2-20240926", + "react-builtin": "npm:react@19.0.0-rc-3edc000d-20240926", + "react-dom": "19.0.0-rc-3edc000d-20240926", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@19.0.0-rc-778e1ed2-20240926", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-778e1ed2-20240926", - "react-experimental-builtin": "npm:react@0.0.0-experimental-778e1ed2-20240926", - "react-is-builtin": "npm:react-is@19.0.0-rc-778e1ed2-20240926", - "react-server-dom-turbopack": "19.0.0-rc-778e1ed2-20240926", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-778e1ed2-20240926", - "react-server-dom-webpack": "19.0.0-rc-778e1ed2-20240926", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-778e1ed2-20240926", + "react-dom-builtin": "npm:react-dom@19.0.0-rc-3edc000d-20240926", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-3edc000d-20240926", + "react-experimental-builtin": "npm:react@0.0.0-experimental-3edc000d-20240926", + "react-is-builtin": "npm:react-is@19.0.0-rc-3edc000d-20240926", + "react-server-dom-turbopack": "19.0.0-rc-3edc000d-20240926", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-3edc000d-20240926", + "react-server-dom-webpack": "19.0.0-rc-3edc000d-20240926", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-3edc000d-20240926", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -230,8 +230,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.9", - "scheduler-builtin": "npm:scheduler@0.25.0-rc-778e1ed2-20240926", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-778e1ed2-20240926", + "scheduler-builtin": "npm:scheduler@0.25.0-rc-3edc000d-20240926", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-3edc000d-20240926", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", @@ -271,10 +271,10 @@ "@babel/traverse": "7.22.5", "@types/react": "npm:types-react@19.0.0-rc.0", "@types/react-dom": "npm:types-react-dom@19.0.0-rc.0", - "react": "19.0.0-rc-778e1ed2-20240926", - "react-dom": "19.0.0-rc-778e1ed2-20240926", - "react-is": "19.0.0-rc-778e1ed2-20240926", - "scheduler": "0.25.0-rc-778e1ed2-20240926" + "react": "19.0.0-rc-3edc000d-20240926", + "react-dom": "19.0.0-rc-3edc000d-20240926", + "react-is": "19.0.0-rc-3edc000d-20240926", + "scheduler": "0.25.0-rc-3edc000d-20240926" }, "patchedDependencies": { "webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch" diff --git a/packages/create-next-app/templates/index.ts b/packages/create-next-app/templates/index.ts index e5fe2f2e84181..6ddaba79c0dff 100644 --- a/packages/create-next-app/templates/index.ts +++ b/packages/create-next-app/templates/index.ts @@ -13,7 +13,7 @@ import { GetTemplateFileArgs, InstallTemplateArgs } from "./types"; // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-778e1ed2-20240926"; +const nextjsReactPeerVersion = "19.0.0-rc-3edc000d-20240926"; /** * Get the file path for a given file in a template, e.g. "next.config.js". diff --git a/packages/next/package.json b/packages/next/package.json index 0817c87167976..d3e38ec39a090 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -107,8 +107,8 @@ "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "babel-plugin-react-compiler": "*", - "react": "^18.2.0 || 19.0.0-rc-778e1ed2-20240926", - "react-dom": "^18.2.0 || 19.0.0-rc-778e1ed2-20240926", + "react": "^18.2.0 || 19.0.0-rc-3edc000d-20240926", + "react-dom": "^18.2.0 || 19.0.0-rc-3edc000d-20240926", "sass": "^1.3.0" }, "peerDependenciesMeta": { 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 96c37316b3197..985c14f9052a1 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 @@ -1031,39 +1031,43 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } - function checkIfRootIsPrerendering(root, renderLanes) { - return ( - 0 === - (root.pendingLanes & - ~(root.suspendedLanes & ~root.pingedLanes) & - renderLanes) - ); - } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1130,7 +1134,9 @@ root, finishedLanes, remainingLanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; @@ -1141,17 +1147,17 @@ root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - finishedLanes = root.entanglements; - var expirationTimes = root.expirationTimes, + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index = 31 - clz32(remainingLanes); - previouslyPendingLanes = 1 << index; - finishedLanes[index] = 0; + var index = 31 - clz32(remainingLanes), + lane = 1 << index; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1163,9 +1169,14 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~previouslyPendingLanes; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -8872,33 +8883,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2281; - var JSCompiler_object_inline_stack_2280 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2283; + var JSCompiler_object_inline_stack_2282 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2278 = !1; + var JSCompiler_object_inline_message_2280 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2281 = didSuspend) || - (JSCompiler_object_inline_componentStack_2281 = + (JSCompiler_object_inline_componentStack_2283 = didSuspend) || + (JSCompiler_object_inline_componentStack_2283 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2281 && - ((JSCompiler_object_inline_message_2278 = !0), + JSCompiler_object_inline_componentStack_2283 && + ((JSCompiler_object_inline_message_2280 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2281 = + JSCompiler_object_inline_componentStack_2283 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2278 + JSCompiler_object_inline_message_2280 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2279 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2281 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2279)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2281)) { c: { - var instance = JSCompiler_object_inline_digest_2279; + var instance = JSCompiler_object_inline_digest_2281; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8939,19 +8950,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2279 + JSCompiler_object_inline_digest_2281 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2279 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2281 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2279 && - ((JSCompiler_object_inline_digest_2279 = - JSCompiler_object_inline_digest_2279.dehydrated), - null !== JSCompiler_object_inline_digest_2279) + null !== JSCompiler_object_inline_digest_2281 && + ((JSCompiler_object_inline_digest_2281 = + JSCompiler_object_inline_digest_2281.dehydrated), + null !== JSCompiler_object_inline_digest_2281) ) return ( - JSCompiler_object_inline_digest_2279.data === + JSCompiler_object_inline_digest_2281.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8959,68 +8970,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2279 = - JSCompiler_object_inline_stack_2280.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2280.fallback; - if (JSCompiler_object_inline_message_2278) + JSCompiler_object_inline_digest_2281 = + JSCompiler_object_inline_stack_2282.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2282.fallback; + if (JSCompiler_object_inline_message_2280) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2280 = + (JSCompiler_object_inline_stack_2282 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2279, + JSCompiler_object_inline_digest_2281, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2278 = workInProgress.child), - (JSCompiler_object_inline_message_2278.memoizedState = + (JSCompiler_object_inline_message_2280 = workInProgress.child), + (JSCompiler_object_inline_message_2280.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2278.childLanes = + (JSCompiler_object_inline_message_2280.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2281, + JSCompiler_object_inline_componentStack_2283, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2280 + JSCompiler_object_inline_stack_2282 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2280.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2282.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2280 = + (JSCompiler_object_inline_stack_2282 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2279, + JSCompiler_object_inline_digest_2281, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2278 = workInProgress.child), - (JSCompiler_object_inline_message_2278.memoizedState = + (JSCompiler_object_inline_message_2280 = workInProgress.child), + (JSCompiler_object_inline_message_2280.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2278.childLanes = + (JSCompiler_object_inline_message_2280.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2281, + JSCompiler_object_inline_componentStack_2283, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2280 + JSCompiler_object_inline_stack_2282 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2279 + JSCompiler_object_inline_digest_2281 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2279 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2279) + ((JSCompiler_object_inline_digest_2281 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2281) ) { if (didSuspend) workInProgress.flags & 256 @@ -9037,94 +9048,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2278 = - JSCompiler_object_inline_stack_2280.fallback), - (JSCompiler_object_inline_digest_2279 = workInProgress.mode), - (JSCompiler_object_inline_stack_2280 = + (JSCompiler_object_inline_message_2280 = + JSCompiler_object_inline_stack_2282.fallback), + (JSCompiler_object_inline_digest_2281 = workInProgress.mode), + (JSCompiler_object_inline_stack_2282 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2280.children + children: JSCompiler_object_inline_stack_2282.children }, - JSCompiler_object_inline_digest_2279 + JSCompiler_object_inline_digest_2281 )), - (JSCompiler_object_inline_message_2278 = + (JSCompiler_object_inline_message_2280 = createFiberFromFragment( - JSCompiler_object_inline_message_2278, - JSCompiler_object_inline_digest_2279, + JSCompiler_object_inline_message_2280, + JSCompiler_object_inline_digest_2281, renderLanes, null )), - (JSCompiler_object_inline_message_2278.flags |= 2), - (JSCompiler_object_inline_stack_2280.return = workInProgress), - (JSCompiler_object_inline_message_2278.return = workInProgress), - (JSCompiler_object_inline_stack_2280.sibling = - JSCompiler_object_inline_message_2278), - (workInProgress.child = JSCompiler_object_inline_stack_2280), + (JSCompiler_object_inline_message_2280.flags |= 2), + (JSCompiler_object_inline_stack_2282.return = workInProgress), + (JSCompiler_object_inline_message_2280.return = workInProgress), + (JSCompiler_object_inline_stack_2282.sibling = + JSCompiler_object_inline_message_2280), + (workInProgress.child = JSCompiler_object_inline_stack_2282), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2280 = workInProgress.child), - (JSCompiler_object_inline_stack_2280.memoizedState = + (JSCompiler_object_inline_stack_2282 = workInProgress.child), + (JSCompiler_object_inline_stack_2282.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2280.childLanes = + (JSCompiler_object_inline_stack_2282.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2281, + JSCompiler_object_inline_componentStack_2283, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2278)); + (workInProgress = JSCompiler_object_inline_message_2280)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2279.data === + JSCompiler_object_inline_digest_2281.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2281 = - JSCompiler_object_inline_digest_2279.nextSibling && - JSCompiler_object_inline_digest_2279.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2281) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2281.dgst; - var message = JSCompiler_object_inline_componentStack_2281.msg; - instance = JSCompiler_object_inline_componentStack_2281.stck; + JSCompiler_object_inline_componentStack_2283 = + JSCompiler_object_inline_digest_2281.nextSibling && + JSCompiler_object_inline_digest_2281.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2283) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2283.dgst; + var message = JSCompiler_object_inline_componentStack_2283.msg; + instance = JSCompiler_object_inline_componentStack_2283.stck; var componentStack = - JSCompiler_object_inline_componentStack_2281.cstck; + JSCompiler_object_inline_componentStack_2283.cstck; } - JSCompiler_object_inline_message_2278 = message; - JSCompiler_object_inline_digest_2279 = JSCompiler_temp; - JSCompiler_object_inline_stack_2280 = instance; - JSCompiler_object_inline_componentStack_2281 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2279 && - ((JSCompiler_object_inline_message_2278 = - JSCompiler_object_inline_message_2278 - ? Error(JSCompiler_object_inline_message_2278) + JSCompiler_object_inline_message_2280 = message; + JSCompiler_object_inline_digest_2281 = JSCompiler_temp; + JSCompiler_object_inline_stack_2282 = instance; + JSCompiler_object_inline_componentStack_2283 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2281 && + ((JSCompiler_object_inline_message_2280 = + JSCompiler_object_inline_message_2280 + ? Error(JSCompiler_object_inline_message_2280) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_message_2278.stack = - JSCompiler_object_inline_stack_2280 || ""), - (JSCompiler_object_inline_message_2278.digest = - JSCompiler_object_inline_digest_2279), - (JSCompiler_object_inline_componentStack_2281 = - void 0 === JSCompiler_object_inline_componentStack_2281 + (JSCompiler_object_inline_message_2280.stack = + JSCompiler_object_inline_stack_2282 || ""), + (JSCompiler_object_inline_message_2280.digest = + JSCompiler_object_inline_digest_2281), + (JSCompiler_object_inline_componentStack_2283 = + void 0 === JSCompiler_object_inline_componentStack_2283 ? null - : JSCompiler_object_inline_componentStack_2281), - "string" === typeof JSCompiler_object_inline_componentStack_2281 && + : JSCompiler_object_inline_componentStack_2283), + "string" === typeof JSCompiler_object_inline_componentStack_2283 && CapturedStacks.set( - JSCompiler_object_inline_message_2278, - JSCompiler_object_inline_componentStack_2281 + JSCompiler_object_inline_message_2280, + JSCompiler_object_inline_componentStack_2283 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2278, + value: JSCompiler_object_inline_message_2280, source: null, - stack: JSCompiler_object_inline_componentStack_2281 + stack: JSCompiler_object_inline_componentStack_2283 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9139,25 +9150,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2281 = + (JSCompiler_object_inline_componentStack_2283 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2281) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2283) ) { - JSCompiler_object_inline_componentStack_2281 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2281) { - JSCompiler_object_inline_stack_2280 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2280 & 42)) - JSCompiler_object_inline_stack_2280 = 1; + JSCompiler_object_inline_componentStack_2283 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2283) { + JSCompiler_object_inline_stack_2282 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2282 & 42)) + JSCompiler_object_inline_stack_2282 = 1; else - switch (JSCompiler_object_inline_stack_2280) { + switch (JSCompiler_object_inline_stack_2282) { case 2: - JSCompiler_object_inline_stack_2280 = 1; + JSCompiler_object_inline_stack_2282 = 1; break; case 8: - JSCompiler_object_inline_stack_2280 = 4; + JSCompiler_object_inline_stack_2282 = 4; break; case 32: - JSCompiler_object_inline_stack_2280 = 16; + JSCompiler_object_inline_stack_2282 = 16; break; case 128: case 256: @@ -9178,40 +9189,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2280 = 64; + JSCompiler_object_inline_stack_2282 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2280 = 134217728; + JSCompiler_object_inline_stack_2282 = 134217728; break; default: - JSCompiler_object_inline_stack_2280 = 0; + JSCompiler_object_inline_stack_2282 = 0; } - JSCompiler_object_inline_stack_2280 = + JSCompiler_object_inline_stack_2282 = 0 !== - (JSCompiler_object_inline_stack_2280 & - (JSCompiler_object_inline_componentStack_2281.suspendedLanes | + (JSCompiler_object_inline_stack_2282 & + (JSCompiler_object_inline_componentStack_2283.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2280; + : JSCompiler_object_inline_stack_2282; if ( - 0 !== JSCompiler_object_inline_stack_2280 && - JSCompiler_object_inline_stack_2280 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2282 && + JSCompiler_object_inline_stack_2282 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2280), + ((prevState.retryLane = JSCompiler_object_inline_stack_2282), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2280 + JSCompiler_object_inline_stack_2282 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2281, + JSCompiler_object_inline_componentStack_2283, current, - JSCompiler_object_inline_stack_2280 + JSCompiler_object_inline_stack_2282 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2279.data === + JSCompiler_object_inline_digest_2281.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9219,7 +9230,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2279.data === + JSCompiler_object_inline_digest_2281.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9227,12 +9238,12 @@ null, current )), - (JSCompiler_object_inline_digest_2279._reactRetry = + (JSCompiler_object_inline_digest_2281._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2279.nextSibling + JSCompiler_object_inline_digest_2281.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9250,54 +9261,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2280.children + JSCompiler_object_inline_stack_2282.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2278) + if (JSCompiler_object_inline_message_2280) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2278 = - JSCompiler_object_inline_stack_2280.fallback), - (JSCompiler_object_inline_digest_2279 = workInProgress.mode), + (JSCompiler_object_inline_message_2280 = + JSCompiler_object_inline_stack_2282.fallback), + (JSCompiler_object_inline_digest_2281 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2280 = createWorkInProgress( + (JSCompiler_object_inline_stack_2282 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2280.children + children: JSCompiler_object_inline_stack_2282.children } )), - (JSCompiler_object_inline_stack_2280.subtreeFlags = + (JSCompiler_object_inline_stack_2282.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2278 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2280 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2278 + JSCompiler_object_inline_message_2280 )) - : ((JSCompiler_object_inline_message_2278 = createFiberFromFragment( - JSCompiler_object_inline_message_2278, - JSCompiler_object_inline_digest_2279, + : ((JSCompiler_object_inline_message_2280 = createFiberFromFragment( + JSCompiler_object_inline_message_2280, + JSCompiler_object_inline_digest_2281, renderLanes, null )), - (JSCompiler_object_inline_message_2278.flags |= 2)), - (JSCompiler_object_inline_message_2278.return = workInProgress), - (JSCompiler_object_inline_stack_2280.return = workInProgress), - (JSCompiler_object_inline_stack_2280.sibling = - JSCompiler_object_inline_message_2278), - (workInProgress.child = JSCompiler_object_inline_stack_2280), - (JSCompiler_object_inline_stack_2280 = - JSCompiler_object_inline_message_2278), - (JSCompiler_object_inline_message_2278 = workInProgress.child), - (JSCompiler_object_inline_digest_2279 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2279 - ? (JSCompiler_object_inline_digest_2279 = + (JSCompiler_object_inline_message_2280.flags |= 2)), + (JSCompiler_object_inline_message_2280.return = workInProgress), + (JSCompiler_object_inline_stack_2282.return = workInProgress), + (JSCompiler_object_inline_stack_2282.sibling = + JSCompiler_object_inline_message_2280), + (workInProgress.child = JSCompiler_object_inline_stack_2282), + (JSCompiler_object_inline_stack_2282 = + JSCompiler_object_inline_message_2280), + (JSCompiler_object_inline_message_2280 = workInProgress.child), + (JSCompiler_object_inline_digest_2281 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2281 + ? (JSCompiler_object_inline_digest_2281 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2279.cachePool), + JSCompiler_object_inline_digest_2281.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9305,38 +9316,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2279 = { + (JSCompiler_object_inline_digest_2281 = { baseLanes: - JSCompiler_object_inline_digest_2279.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2281.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2278.memoizedState = - JSCompiler_object_inline_digest_2279), - (JSCompiler_object_inline_message_2278.childLanes = + (JSCompiler_object_inline_message_2280.memoizedState = + JSCompiler_object_inline_digest_2281), + (JSCompiler_object_inline_message_2280.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2281, + JSCompiler_object_inline_componentStack_2283, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2280 + JSCompiler_object_inline_stack_2282 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2280.children + children: JSCompiler_object_inline_stack_2282.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2281 = + ((JSCompiler_object_inline_componentStack_2283 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2281 + null === JSCompiler_object_inline_componentStack_2283 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2281.push(current)); + : JSCompiler_object_inline_componentStack_2283.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -13759,7 +13770,8 @@ workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14556,7 +14568,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14598,188 +14611,199 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var shouldTimeSlice = - (!forceSync && - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes)) || - !1, - exitStatus = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes, !0); - do { - var renderWasConcurrent = shouldTimeSlice; - if (exitStatus === RootInProgress) break; - else if (exitStatus === RootDidNotComplete) - markRootSuspended(root, lanes, 0); - else { - forceSync = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(forceSync) - ) { - exitStatus = renderRootSync(root, lanes, !1); - continue; - } - if (exitStatus === RootErrored) { - renderWasConcurrent = lanes; - if (root.errorRecoveryDisabledLanes & renderWasConcurrent) - var errorRetryLanes = 0; - else - (errorRetryLanes = root.pendingLanes & -536870913), - (errorRetryLanes = - 0 !== errorRetryLanes - ? errorRetryLanes - : errorRetryLanes & 536870912 - ? 536870912 - : 0); - if (0 !== errorRetryLanes) { - lanes = errorRetryLanes; - a: { - exitStatus = root; - var errorRetryLanes$jscomp$0 = errorRetryLanes; - errorRetryLanes = workInProgressRootConcurrentErrors; - var wasRootDehydrated = - exitStatus.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack( + var exitStatus = (forceSync = + !forceSync && 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes)) + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes); + if (exitStatus !== RootInProgress) { + var renderWasConcurrent = forceSync; + do { + if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes); + renderWasConcurrent = !1; + continue; + } + if (exitStatus === RootErrored) { + renderWasConcurrent = lanes; + if (root.errorRecoveryDisabledLanes & renderWasConcurrent) + var errorRetryLanes = 0; + else + (errorRetryLanes = root.pendingLanes & -536870913), + (errorRetryLanes = + 0 !== errorRetryLanes + ? errorRetryLanes + : errorRetryLanes & 536870912 + ? 536870912 + : 0); + if (0 !== errorRetryLanes) { + lanes = errorRetryLanes; + a: { + exitStatus = root; + var errorRetryLanes$jscomp$0 = errorRetryLanes; + errorRetryLanes = workInProgressRootConcurrentErrors; + var wasRootDehydrated = + exitStatus.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack( + exitStatus, + errorRetryLanes$jscomp$0 + ).flags |= 256); + errorRetryLanes$jscomp$0 = renderRootSync( exitStatus, errorRetryLanes$jscomp$0 - ).flags |= 256); - errorRetryLanes$jscomp$0 = renderRootSync( - exitStatus, - errorRetryLanes$jscomp$0, - !1 - ); - if (errorRetryLanes$jscomp$0 !== RootErrored) { - if ( - workInProgressRootDidAttachPingListener && - !wasRootDehydrated - ) { - exitStatus.errorRecoveryDisabledLanes |= - renderWasConcurrent; - workInProgressRootInterleavedUpdatedLanes |= - renderWasConcurrent; - exitStatus = RootSuspendedWithDelay; - break a; + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; + break a; + } + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); } - exitStatus = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorRetryLanes; - null !== exitStatus && queueRecoverableErrors(exitStatus); + exitStatus = errorRetryLanes$jscomp$0; } - exitStatus = errorRetryLanes$jscomp$0; + renderWasConcurrent = !1; + if (exitStatus !== RootErrored) continue; } - if (exitStatus !== RootErrored) continue; } - } - if (exitStatus === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - a: { - shouldTimeSlice = root; - renderWasConcurrent = now$1(); - switch (exitStatus) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); + break; + } + a: { + renderWasConcurrent = root; + errorRetryLanes = now$1(); + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + renderWasConcurrent, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + renderWasConcurrent, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + errorRetryLanes + ); + else { + if ( + (lanes & 62914560) === lanes && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { markRootSuspended( - shouldTimeSlice, + renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; + renderWasConcurrent.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + renderWasConcurrent, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + errorRetryLanes + ), + exitStatus ); break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); - } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) - commitRoot( - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - IMMEDIATE_COMMIT, - renderStartTime, - renderWasConcurrent - ); - else { - if ( - (lanes & 62914560) === lanes && - ((exitStatus = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < exitStatus) - ) { - markRootSuspended( - shouldTimeSlice, + commitRootWhenReady( + renderWasConcurrent, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; - shouldTimeSlice.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - shouldTimeSlice, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - THROTTLED_COMMIT, - renderStartTime, - renderWasConcurrent - ), - exitStatus + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + errorRetryLanes ); - break a; } - commitRootWhenReady( - shouldTimeSlice, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - IMMEDIATE_COMMIT, - renderStartTime, - renderWasConcurrent - ); } } - } - break; - } while (1); + break; + } while (1); + } ensureRootIsScheduled(root); } function queueRecoverableErrors(errors) { @@ -14805,11 +14829,8 @@ completedRenderStartTime, completedRenderEndTime ) { - didSkipSuspendedSiblings = finishedWork.subtreeFlags; - if ( - didSkipSuspendedSiblings & 8192 || - 16785408 === (didSkipSuspendedSiblings & 16785408) - ) + var subtreeFlags = finishedWork.subtreeFlags; + if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -14831,7 +14852,7 @@ completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14893,19 +14914,22 @@ (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didSkipSuspendedSiblings[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -15024,9 +15048,8 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidSkipSuspendedSiblings = !1; - checkIfRootIsPrerendering(root, lanes); - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = @@ -15119,7 +15142,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -15147,38 +15171,37 @@ prepareFreshStack(root, lanes); } lanes = !1; - memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - var unitOfWork = workInProgress, - thrownValue = workInProgressThrownValue; + memoizedUpdaters = workInProgress; + var thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - memoizedUpdaters = RootDidNotComplete; + workInProgressRootExitStatus = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - case SuspendedOnDeprecatedThrowPromise: - null === suspenseHandlerStackCursor.current && (lanes = !0); + lanes || + null !== suspenseHandlerStackCursor.current || + (lanes = !0); + default: var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); - break; - default: - (reason = workInProgressSuspendedReason), - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); - memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$8) { handleThrow(root, thrownValue$8); @@ -15189,11 +15212,14 @@ executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - null === workInProgress && - ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - finishQueueingConcurrentUpdates()); - return memoizedUpdaters; + if (null !== workInProgress) + throw Error( + "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." + ); + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -15217,7 +15243,7 @@ workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } else checkIfRootIsPrerendering(root, lanes); + } a: do try { if ( @@ -15581,41 +15607,42 @@ ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - suspendedRetryLanes = root.finishedWork; - updatedLanes = root.finishedLanes; + var finishedWork = root.finishedWork, + lanes = root.finishedLanes; reusableComponentDevToolDetails.track = - getGroupNameOfHighestPriorityLane(updatedLanes); + getGroupNameOfHighestPriorityLane(lanes); logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === suspendedRetryLanes) return null; - 0 === updatedLanes && + if (null === finishedWork) return null; + 0 === lanes && console.error( "root.finishedLanes should not be empty during a commit. This is a bug in React." ); root.finishedWork = null; root.finishedLanes = 0; - if (suspendedRetryLanes === root.current) + if (finishedWork === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - completedRenderStartTime = - suspendedRetryLanes.lanes | suspendedRetryLanes.childLanes; + completedRenderStartTime = finishedWork.lanes | finishedWork.childLanes; completedRenderStartTime |= concurrentlyUpdatedLanes; markRootFinished( root, - updatedLanes, + lanes, completedRenderStartTime, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === suspendedRetryLanes.actualDuration && - 0 === (suspendedRetryLanes.subtreeFlags & 10256) && - 0 === (suspendedRetryLanes.flags & 10256)) || + (0 === finishedWork.actualDuration && + 0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), (pendingPassiveEffectsRemainingLanes = completedRenderStartTime), @@ -15630,32 +15657,32 @@ ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) : suspendedCommitReason === THROTTLED_COMMIT && logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (suspendedRetryLanes.flags & 15990); - 0 !== (suspendedRetryLanes.subtreeFlags & 15990) || transitions + transitions = 0 !== (finishedWork.flags & 15990); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), (spawnedLane = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = DiscreteEventPriority), - (suspendedCommitReason = executionContext), + (updatedLanes = executionContext), (executionContext |= CommitContext), - commitBeforeMutationEffects(root, suspendedRetryLanes), - commitMutationEffects(root, suspendedRetryLanes, updatedLanes), + commitBeforeMutationEffects(root, finishedWork), + commitMutationEffects(root, finishedWork, lanes), restoreSelection(selectionInformation, root.containerInfo), (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), - (root.current = suspendedRetryLanes), - commitLayoutEffects(suspendedRetryLanes, root, updatedLanes), + (root.current = finishedWork), + commitLayoutEffects(finishedWork, root, lanes), requestPaint(), - (executionContext = suspendedCommitReason), + (executionContext = updatedLanes), (ReactDOMSharedInternals.p = spawnedLane), (ReactSharedInternals.T = transitions)) - : (root.current = suspendedRetryLanes); + : (root.current = finishedWork); commitEndTime = now(); logCommitPhase(commitStartTime, commitEndTime); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = updatedLanes)) + (pendingPassiveEffectsLanes = lanes)) : (releaseRootPooledCache(root, completedRenderStartTime), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); @@ -15663,18 +15690,17 @@ 0 === completedRenderStartTime && (legacyErrorBoundariesThatAlreadyFailed = null); transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(suspendedRetryLanes.stateNode, renderPriorityLevel); + onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, - suspendedRetryLanes = 0; - suspendedRetryLanes < recoverableErrors.length; - suspendedRetryLanes++ + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ ) - (completedRenderStartTime = recoverableErrors[suspendedRetryLanes]), + (completedRenderStartTime = recoverableErrors[finishedWork]), (spawnedLane = makeErrorInfo(completedRenderStartTime.stack)), runWithFiberInDEV( completedRenderStartTime.source, @@ -15686,13 +15712,13 @@ completedRenderStartTime = root.pendingLanes; didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate || - (0 !== (updatedLanes & 4194218) && 0 !== (completedRenderStartTime & 42)) + (0 !== (lanes & 4194218) && 0 !== (completedRenderStartTime & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - transitions || finalizeRender(updatedLanes, now$1()); + transitions || finalizeRender(lanes, now$1()); flushSyncWorkAcrossRoots_impl(0, !1); return null; } @@ -16143,8 +16169,7 @@ root, root === workInProgressRoot ? nextLanes : 0 )), - 0 === (nextLanes & 3) || - checkIfRootIsPrerendering(root, nextLanes) || + 0 !== (nextLanes & 3) && ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); root = root.next; @@ -16235,6 +16260,8 @@ else return currentTime; switch (lanesToEventPriority(suspendedLanes)) { case DiscreteEventPriority: + suspendedLanes = ImmediatePriority; + break; case ContinuousEventPriority: suspendedLanes = UserBlockingPriority; break; @@ -24906,11 +24933,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-3edc000d-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-3edc000d-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24947,11 +24974,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-778e1ed2-20240926", + version: "19.0.0-experimental-3edc000d-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" + reconcilerVersion: "19.0.0-experimental-3edc000d-20240926" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25093,7 +25120,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-experimental-778e1ed2-20240926"; + exports.version = "19.0.0-experimental-3edc000d-20240926"; "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 b6bcccb91f4fc..b2f3705fd9b1f 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 @@ -597,39 +597,43 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } -function checkIfRootIsPrerendering(root, renderLanes) { - return ( - 0 === - (root.pendingLanes & - ~(root.suspendedLanes & ~root.pingedLanes) & - renderLanes) - ); -} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -687,7 +691,14 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; @@ -697,31 +708,36 @@ function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - finishedLanes = root.entanglements; - var expirationTimes = root.expirationTimes, + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index$6 = 31 - clz32(remainingLanes); - previouslyPendingLanes = 1 << index$6; - finishedLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(remainingLanes), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~previouslyPendingLanes; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -736,10 +752,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -889,8 +905,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$9 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$9 && "aria-" !== prefix$9) { + var prefix$10 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$10 && "aria-" !== prefix$10) { node.removeAttribute(name); return; } @@ -1223,15 +1239,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$15 in styles) - (styleName = styles[styleName$15]), - styles.hasOwnProperty(styleName$15) && - prevStyles[styleName$15] !== styleName && - setValueForStyle(node, styleName$15, styleName); - } else for (var styleName$16 in styles) - styles.hasOwnProperty(styleName$16) && - setValueForStyle(node, styleName$16, styles[styleName$16]); + (styleName = styles[styleName$16]), + styles.hasOwnProperty(styleName$16) && + prevStyles[styleName$16] !== styleName && + setValueForStyle(node, styleName$16, styleName); + } else + for (var styleName$17 in styles) + styles.hasOwnProperty(styleName$17) && + setValueForStyle(node, styleName$17, styles[styleName$17]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -3912,7 +3928,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$54 = !1; + didReadFromEntangledAsyncAction$55 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3933,11 +3949,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$54 = !0); + (didReadFromEntangledAsyncAction$55 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$54 = !0); + (didReadFromEntangledAsyncAction$55 = !0); continue; } else (updateLane = { @@ -3983,7 +3999,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$54 && + didReadFromEntangledAsyncAction$55 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4181,8 +4197,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$60) { - onActionError(actionQueue, node, error$60); + } catch (error$61) { + onActionError(actionQueue, node, error$61); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4631,14 +4647,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$63 = enqueueUpdate(provider, fiber, lane); - null !== root$63 && - (scheduleUpdateOnFiber(root$63, provider, lane), - entangleTransitions(root$63, provider, lane)); + var root$64 = enqueueUpdate(provider, fiber, lane); + null !== root$64 && + (scheduleUpdateOnFiber(root$64, provider, lane), + entangleTransitions(root$64, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$63 && + null !== root$64 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5169,9 +5185,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$67 in Component) - void 0 === newProps[propName$67] && - (newProps[propName$67] = Component[propName$67]); + for (var propName$68 in Component) + void 0 === newProps[propName$68] && + (newProps[propName$68] = Component[propName$68]); } return newProps; } @@ -5217,9 +5233,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$68) { + } catch (e$69) { setTimeout(function () { - throw e$68; + throw e$69; }); } } @@ -5230,9 +5246,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$69) { + } catch (e$70) { setTimeout(function () { - throw e$69; + throw e$70; }); } } @@ -7698,8 +7714,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$114) { - captureCommitPhaseError(current, nearestMountedAncestor, error$114); + } catch (error$115) { + captureCommitPhaseError(current, nearestMountedAncestor, error$115); } else ref.current = null; } @@ -7833,7 +7849,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$19) { + } catch (e$20) { JSCompiler_temp = null; break a; } @@ -8008,11 +8024,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$113) { + } catch (error$114) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$113 + error$114 ); } } @@ -8166,7 +8182,7 @@ function commitDeletionEffectsOnFiber( safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: prevHostParentIsContainer = hostParent; - var prevHostParentIsContainer$121 = hostParentIsContainer; + var prevHostParentIsContainer$122 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, @@ -8174,7 +8190,7 @@ function commitDeletionEffectsOnFiber( deletedFiber ); hostParent = prevHostParentIsContainer; - hostParentIsContainer = prevHostParentIsContainer$121; + hostParentIsContainer = prevHostParentIsContainer$122; if (null !== hostParent) if (hostParentIsContainer) try { @@ -8802,21 +8818,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$115 = JSCompiler_inline_result.stateNode; + var parent$116 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$115, ""), + (setTextContent(parent$116, ""), (JSCompiler_inline_result.flags &= -33)); - var before$116 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$116, parent$115); + var before$117 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$117, parent$116); break; case 3: case 4: - var parent$117 = JSCompiler_inline_result.stateNode.containerInfo, - before$118 = getHostSibling(finishedWork); + var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, + before$119 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$118, - parent$117 + before$119, + parent$118 ); break; default: @@ -9713,7 +9729,8 @@ function scheduleRetryEffect(workInProgress, retryQueue) { workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -9730,14 +9747,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$133 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$133 = lastTailNode), + for (var lastTailNode$134 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$134 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$133 + null === lastTailNode$134 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$133.sibling = null); + : (lastTailNode$134.sibling = null); } } function bubbleProperties(completedWork) { @@ -9747,19 +9764,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$134 = completedWork.child; null !== child$134; ) - (newChildLanes |= child$134.lanes | child$134.childLanes), - (subtreeFlags |= child$134.subtreeFlags & 31457280), - (subtreeFlags |= child$134.flags & 31457280), - (child$134.return = completedWork), - (child$134 = child$134.sibling); + for (var child$135 = completedWork.child; null !== child$135; ) + (newChildLanes |= child$135.lanes | child$135.childLanes), + (subtreeFlags |= child$135.subtreeFlags & 31457280), + (subtreeFlags |= child$135.flags & 31457280), + (child$135.return = completedWork), + (child$135 = child$135.sibling); else - for (child$134 = completedWork.child; null !== child$134; ) - (newChildLanes |= child$134.lanes | child$134.childLanes), - (subtreeFlags |= child$134.subtreeFlags), - (subtreeFlags |= child$134.flags), - (child$134.return = completedWork), - (child$134 = child$134.sibling); + for (child$135 = completedWork.child; null !== child$135; ) + (newChildLanes |= child$135.lanes | child$135.childLanes), + (subtreeFlags |= child$135.subtreeFlags), + (subtreeFlags |= child$135.flags), + (child$135.return = completedWork), + (child$135 = child$135.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10036,11 +10053,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$146 = null; + var cache$147 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$146 = newProps.memoizedState.cachePool.pool); - cache$146 !== type && (newProps.flags |= 2048); + (cache$147 = newProps.memoizedState.cachePool.pool); + cache$147 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10065,8 +10082,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$146 = type.rendering; - if (null === cache$146) + cache$147 = type.rendering; + if (null === cache$147) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10074,11 +10091,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$146 = findFirstSuspended(current); - if (null !== cache$146) { + cache$147 = findFirstSuspended(current); + if (null !== cache$147) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$146.updateQueue; + current = cache$147.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10103,7 +10120,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$146)), null !== current)) { + if (((current = findFirstSuspended(cache$147)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10113,7 +10130,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$146.alternate && + !cache$147.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10126,13 +10143,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$146.sibling = workInProgress.child), - (workInProgress.child = cache$146)) + ? ((cache$147.sibling = workInProgress.child), + (workInProgress.child = cache$147)) : ((current = type.last), null !== current - ? (current.sibling = cache$146) - : (workInProgress.child = cache$146), - (type.last = cache$146)); + ? (current.sibling = cache$147) + : (workInProgress.child = cache$147), + (type.last = cache$147)); } if (null !== type.tail) return ( @@ -10357,7 +10374,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10368,158 +10386,178 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var shouldTimeSlice = - (!forceSync && - 0 === (lanes & 60) && - 0 === (lanes & root$jscomp$0.expiredLanes)) || - !1, - exitStatus = shouldTimeSlice - ? renderRootConcurrent(root$jscomp$0, lanes) - : renderRootSync(root$jscomp$0, lanes, !0); - do { - var renderWasConcurrent = shouldTimeSlice; - if (0 === exitStatus) break; - else if (6 === exitStatus) markRootSuspended(root$jscomp$0, lanes, 0); - else { - forceSync = root$jscomp$0.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(forceSync) - ) { - exitStatus = renderRootSync(root$jscomp$0, lanes, !1); - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) - var JSCompiler_inline_result = 0; - else - (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), + var exitStatus = (forceSync = + !forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes); + if (0 !== exitStatus) { + var renderWasConcurrent = forceSync; + do { + if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes); + renderWasConcurrent = !1; + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else (JSCompiler_inline_result = - 0 !== JSCompiler_inline_result - ? JSCompiler_inline_result - : JSCompiler_inline_result & 536870912 - ? 536870912 - : 0); - if (0 !== JSCompiler_inline_result) { - lanes = JSCompiler_inline_result; - a: { - var root = root$jscomp$0; - exitStatus = workInProgressRootConcurrentErrors; - var wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); - JSCompiler_inline_result = renderRootSync( - root, - JSCompiler_inline_result, - !1 - ); - if (2 !== JSCompiler_inline_result) { - if ( - workInProgressRootDidAttachPingListener && - !wasRootDehydrated - ) { - root.errorRecoveryDisabledLanes |= renderWasConcurrent; - workInProgressRootInterleavedUpdatedLanes |= - renderWasConcurrent; - exitStatus = 4; - break a; + root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= + 256); + JSCompiler_inline_result = renderRootSync( + root, + JSCompiler_inline_result + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; + break a; + } + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); } - renderWasConcurrent = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = exitStatus; - null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + exitStatus = JSCompiler_inline_result; } - exitStatus = JSCompiler_inline_result; + renderWasConcurrent = !1; + if (2 !== exitStatus) continue; } - if (2 !== exitStatus) continue; } - } - if (1 === exitStatus) { - prepareFreshStack(root$jscomp$0, 0); - markRootSuspended(root$jscomp$0, lanes, 0); - break; - } - a: { - shouldTimeSlice = root$jscomp$0; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - shouldTimeSlice, - lanes, - workInProgressDeferredLane - ); - break a; - } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended( + root$jscomp$0, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); + break; } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; - if ( - (lanes & 62914560) === lanes && - ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now()), - 10 < renderWasConcurrent) - ) { - markRootSuspended(shouldTimeSlice, lanes, workInProgressDeferredLane); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; - shouldTimeSlice.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - shouldTimeSlice, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + a: { + renderWasConcurrent = root$jscomp$0; + switch (exitStatus) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + renderWasConcurrent, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + ((exitStatus = globalMostRecentFallbackTime + 300 - now()), + 10 < exitStatus) + ) { + markRootSuspended( + renderWasConcurrent, lanes, workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - 2, - -0, - 0 - ), - renderWasConcurrent + workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; + renderWasConcurrent.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + renderWasConcurrent, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + exitStatus + ); + break a; + } + commitRootWhenReady( + renderWasConcurrent, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 ); - break a; } - commitRootWhenReady( - shouldTimeSlice, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - 0, - -0, - 0 - ); } - } - break; - } while (1); + break; + } while (1); + } ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { @@ -10545,11 +10583,8 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - didSkipSuspendedSiblings = finishedWork.subtreeFlags; - if ( - didSkipSuspendedSiblings & 8192 || - 16785408 === (didSkipSuspendedSiblings & 16785408) - ) + var subtreeFlags = finishedWork.subtreeFlags; + if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -10571,7 +10606,7 @@ function commitRootWhenReady( completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10630,19 +10665,22 @@ function markRootUpdated(root, updatedLanes) { : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended(root, suspendedLanes, spawnedLane) { +function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -10685,9 +10723,8 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidSkipSuspendedSiblings = !1; - checkIfRootIsPrerendering(root, lanes); - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -10706,9 +10743,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$4 = 31 - clz32(allEntangledLanes), + lane = 1 << index$4; + lanes |= root[index$4]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -10778,7 +10815,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -10794,7 +10832,6 @@ function renderRootSync(root, lanes) { if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) (workInProgressTransitions = null), prepareFreshStack(root, lanes); lanes = !1; - var exitStatus = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -10803,26 +10840,21 @@ function renderRootSync(root, lanes) { switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - exitStatus = 6; + workInProgressRootExitStatus = 6; break a; case 3: case 2: - case 6: - null === suspenseHandlerStackCursor.current && (lanes = !0); + lanes || + null !== suspenseHandlerStackCursor.current || + (lanes = !0); + default: var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); - break; - default: - (reason = workInProgressSuspendedReason), - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); - exitStatus = workInProgressRootExitStatus; break; } catch (thrownValue$162) { handleThrow(root, thrownValue$162); @@ -10833,11 +10865,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - null === workInProgress && - ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - finishQueueingConcurrentUpdates()); - return exitStatus; + if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -10847,11 +10879,10 @@ function renderRootConcurrent(root, lanes) { executionContext |= 2; var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher(); - workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes - ? ((workInProgressTransitions = null), + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) + (workInProgressTransitions = null), (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes)) - : checkIfRootIsPrerendering(root, lanes); + prepareFreshStack(root, lanes); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -11125,7 +11156,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11141,7 +11174,14 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, lanes, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11157,25 +11197,25 @@ function commitRootImpl( return null; })); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - commitBeforeMutationEffects(root, finishedWork); - commitMutationEffectsOnFiber(finishedWork, root); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = prevExecutionContext; - ReactDOMSharedInternals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = ReactDOMSharedInternals.p), + (ReactDOMSharedInternals.p = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + commitBeforeMutationEffects(root, finishedWork), + commitMutationEffectsOnFiber(finishedWork, root), + restoreSelection(selectionInformation, root.containerInfo), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), + requestPaint(), + (executionContext = updatedLanes), + (ReactDOMSharedInternals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : (root.current = finishedWork); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11441,8 +11481,7 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { root$170, root$170 === workInProgressRoot ? JSCompiler_inline_result : 0 )), - 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$170, JSCompiler_inline_result) || + 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), performSyncWorkOnRoot(root$170, JSCompiler_inline_result)); root$170 = root$170.next; @@ -11486,12 +11525,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -11528,6 +11567,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { null !== pingedLanes && cancelCallback$1(pingedLanes); switch (lanesToEventPriority(suspendedLanes)) { case 2: + suspendedLanes = ImmediatePriority; + break; case 8: suspendedLanes = UserBlockingPriority; break; @@ -11673,20 +11714,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1410 = 0; - i$jscomp$inline_1410 < simpleEventPluginEvents.length; - i$jscomp$inline_1410++ + var i$jscomp$inline_1412 = 0; + i$jscomp$inline_1412 < simpleEventPluginEvents.length; + i$jscomp$inline_1412++ ) { - var eventName$jscomp$inline_1411 = - simpleEventPluginEvents[i$jscomp$inline_1410], - domEventName$jscomp$inline_1412 = - eventName$jscomp$inline_1411.toLowerCase(), - capitalizedEvent$jscomp$inline_1413 = - eventName$jscomp$inline_1411[0].toUpperCase() + - eventName$jscomp$inline_1411.slice(1); + var eventName$jscomp$inline_1413 = + simpleEventPluginEvents[i$jscomp$inline_1412], + domEventName$jscomp$inline_1414 = + eventName$jscomp$inline_1413.toLowerCase(), + capitalizedEvent$jscomp$inline_1415 = + eventName$jscomp$inline_1413[0].toUpperCase() + + eventName$jscomp$inline_1413.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1412, - "on" + capitalizedEvent$jscomp$inline_1413 + domEventName$jscomp$inline_1414, + "on" + capitalizedEvent$jscomp$inline_1415 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15127,16 +15168,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1657 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1659 = React.version; if ( - "19.0.0-experimental-778e1ed2-20240926" !== - isomorphicReactPackageVersion$jscomp$inline_1657 + "19.0.0-experimental-3edc000d-20240926" !== + isomorphicReactPackageVersion$jscomp$inline_1659 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1657, - "19.0.0-experimental-778e1ed2-20240926" + isomorphicReactPackageVersion$jscomp$inline_1659, + "19.0.0-experimental-3edc000d-20240926" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15156,25 +15197,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2122 = { +var internals$jscomp$inline_2124 = { bundleType: 0, - version: "19.0.0-experimental-778e1ed2-20240926", + version: "19.0.0-experimental-3edc000d-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" + reconcilerVersion: "19.0.0-experimental-3edc000d-20240926" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2123 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2125 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2123.isDisabled && - hook$jscomp$inline_2123.supportsFiber + !hook$jscomp$inline_2125.isDisabled && + hook$jscomp$inline_2125.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2123.inject( - internals$jscomp$inline_2122 + (rendererID = hook$jscomp$inline_2125.inject( + internals$jscomp$inline_2124 )), - (injectedHook = hook$jscomp$inline_2123); + (injectedHook = hook$jscomp$inline_2125); } catch (err) {} } exports.createRoot = function (container, options) { @@ -15266,4 +15307,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-experimental-778e1ed2-20240926"; +exports.version = "19.0.0-experimental-3edc000d-20240926"; 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 677c43f85bab1..1fd91cc16ae5a 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 @@ -1039,39 +1039,43 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } - function checkIfRootIsPrerendering(root, renderLanes) { - return ( - 0 === - (root.pendingLanes & - ~(root.suspendedLanes & ~root.pingedLanes) & - renderLanes) - ); - } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1138,7 +1142,9 @@ root, finishedLanes, remainingLanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; @@ -1149,17 +1155,17 @@ root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - finishedLanes = root.entanglements; - var expirationTimes = root.expirationTimes, + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index = 31 - clz32(remainingLanes); - previouslyPendingLanes = 1 << index; - finishedLanes[index] = 0; + var index = 31 - clz32(remainingLanes), + lane = 1 << index; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1171,9 +1177,14 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~previouslyPendingLanes; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -8880,33 +8891,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2286; - var JSCompiler_object_inline_stack_2285 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2288; + var JSCompiler_object_inline_stack_2287 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2283 = !1; + var JSCompiler_object_inline_message_2285 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2286 = didSuspend) || - (JSCompiler_object_inline_componentStack_2286 = + (JSCompiler_object_inline_componentStack_2288 = didSuspend) || + (JSCompiler_object_inline_componentStack_2288 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2286 && - ((JSCompiler_object_inline_message_2283 = !0), + JSCompiler_object_inline_componentStack_2288 && + ((JSCompiler_object_inline_message_2285 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2286 = + JSCompiler_object_inline_componentStack_2288 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2283 + JSCompiler_object_inline_message_2285 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2284 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2286 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2284)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2286)) { c: { - var instance = JSCompiler_object_inline_digest_2284; + var instance = JSCompiler_object_inline_digest_2286; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8947,19 +8958,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2284 + JSCompiler_object_inline_digest_2286 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2284 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2286 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2284 && - ((JSCompiler_object_inline_digest_2284 = - JSCompiler_object_inline_digest_2284.dehydrated), - null !== JSCompiler_object_inline_digest_2284) + null !== JSCompiler_object_inline_digest_2286 && + ((JSCompiler_object_inline_digest_2286 = + JSCompiler_object_inline_digest_2286.dehydrated), + null !== JSCompiler_object_inline_digest_2286) ) return ( - JSCompiler_object_inline_digest_2284.data === + JSCompiler_object_inline_digest_2286.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8967,68 +8978,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2284 = - JSCompiler_object_inline_stack_2285.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2285.fallback; - if (JSCompiler_object_inline_message_2283) + JSCompiler_object_inline_digest_2286 = + JSCompiler_object_inline_stack_2287.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2287.fallback; + if (JSCompiler_object_inline_message_2285) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2285 = + (JSCompiler_object_inline_stack_2287 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2284, + JSCompiler_object_inline_digest_2286, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2283 = workInProgress.child), - (JSCompiler_object_inline_message_2283.memoizedState = + (JSCompiler_object_inline_message_2285 = workInProgress.child), + (JSCompiler_object_inline_message_2285.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2283.childLanes = + (JSCompiler_object_inline_message_2285.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2286, + JSCompiler_object_inline_componentStack_2288, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2285 + JSCompiler_object_inline_stack_2287 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2285.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2287.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2285 = + (JSCompiler_object_inline_stack_2287 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2284, + JSCompiler_object_inline_digest_2286, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2283 = workInProgress.child), - (JSCompiler_object_inline_message_2283.memoizedState = + (JSCompiler_object_inline_message_2285 = workInProgress.child), + (JSCompiler_object_inline_message_2285.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2283.childLanes = + (JSCompiler_object_inline_message_2285.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2286, + JSCompiler_object_inline_componentStack_2288, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2285 + JSCompiler_object_inline_stack_2287 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2284 + JSCompiler_object_inline_digest_2286 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2284 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2284) + ((JSCompiler_object_inline_digest_2286 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2286) ) { if (didSuspend) workInProgress.flags & 256 @@ -9045,94 +9056,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2283 = - JSCompiler_object_inline_stack_2285.fallback), - (JSCompiler_object_inline_digest_2284 = workInProgress.mode), - (JSCompiler_object_inline_stack_2285 = + (JSCompiler_object_inline_message_2285 = + JSCompiler_object_inline_stack_2287.fallback), + (JSCompiler_object_inline_digest_2286 = workInProgress.mode), + (JSCompiler_object_inline_stack_2287 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2285.children + children: JSCompiler_object_inline_stack_2287.children }, - JSCompiler_object_inline_digest_2284 + JSCompiler_object_inline_digest_2286 )), - (JSCompiler_object_inline_message_2283 = + (JSCompiler_object_inline_message_2285 = createFiberFromFragment( - JSCompiler_object_inline_message_2283, - JSCompiler_object_inline_digest_2284, + JSCompiler_object_inline_message_2285, + JSCompiler_object_inline_digest_2286, renderLanes, null )), - (JSCompiler_object_inline_message_2283.flags |= 2), - (JSCompiler_object_inline_stack_2285.return = workInProgress), - (JSCompiler_object_inline_message_2283.return = workInProgress), - (JSCompiler_object_inline_stack_2285.sibling = - JSCompiler_object_inline_message_2283), - (workInProgress.child = JSCompiler_object_inline_stack_2285), + (JSCompiler_object_inline_message_2285.flags |= 2), + (JSCompiler_object_inline_stack_2287.return = workInProgress), + (JSCompiler_object_inline_message_2285.return = workInProgress), + (JSCompiler_object_inline_stack_2287.sibling = + JSCompiler_object_inline_message_2285), + (workInProgress.child = JSCompiler_object_inline_stack_2287), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2285 = workInProgress.child), - (JSCompiler_object_inline_stack_2285.memoizedState = + (JSCompiler_object_inline_stack_2287 = workInProgress.child), + (JSCompiler_object_inline_stack_2287.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2285.childLanes = + (JSCompiler_object_inline_stack_2287.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2286, + JSCompiler_object_inline_componentStack_2288, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2283)); + (workInProgress = JSCompiler_object_inline_message_2285)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2284.data === + JSCompiler_object_inline_digest_2286.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2286 = - JSCompiler_object_inline_digest_2284.nextSibling && - JSCompiler_object_inline_digest_2284.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2286) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2286.dgst; - var message = JSCompiler_object_inline_componentStack_2286.msg; - instance = JSCompiler_object_inline_componentStack_2286.stck; + JSCompiler_object_inline_componentStack_2288 = + JSCompiler_object_inline_digest_2286.nextSibling && + JSCompiler_object_inline_digest_2286.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2288) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2288.dgst; + var message = JSCompiler_object_inline_componentStack_2288.msg; + instance = JSCompiler_object_inline_componentStack_2288.stck; var componentStack = - JSCompiler_object_inline_componentStack_2286.cstck; + JSCompiler_object_inline_componentStack_2288.cstck; } - JSCompiler_object_inline_message_2283 = message; - JSCompiler_object_inline_digest_2284 = JSCompiler_temp; - JSCompiler_object_inline_stack_2285 = instance; - JSCompiler_object_inline_componentStack_2286 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2284 && - ((JSCompiler_object_inline_message_2283 = - JSCompiler_object_inline_message_2283 - ? Error(JSCompiler_object_inline_message_2283) + JSCompiler_object_inline_message_2285 = message; + JSCompiler_object_inline_digest_2286 = JSCompiler_temp; + JSCompiler_object_inline_stack_2287 = instance; + JSCompiler_object_inline_componentStack_2288 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2286 && + ((JSCompiler_object_inline_message_2285 = + JSCompiler_object_inline_message_2285 + ? Error(JSCompiler_object_inline_message_2285) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_message_2283.stack = - JSCompiler_object_inline_stack_2285 || ""), - (JSCompiler_object_inline_message_2283.digest = - JSCompiler_object_inline_digest_2284), - (JSCompiler_object_inline_componentStack_2286 = - void 0 === JSCompiler_object_inline_componentStack_2286 + (JSCompiler_object_inline_message_2285.stack = + JSCompiler_object_inline_stack_2287 || ""), + (JSCompiler_object_inline_message_2285.digest = + JSCompiler_object_inline_digest_2286), + (JSCompiler_object_inline_componentStack_2288 = + void 0 === JSCompiler_object_inline_componentStack_2288 ? null - : JSCompiler_object_inline_componentStack_2286), - "string" === typeof JSCompiler_object_inline_componentStack_2286 && + : JSCompiler_object_inline_componentStack_2288), + "string" === typeof JSCompiler_object_inline_componentStack_2288 && CapturedStacks.set( - JSCompiler_object_inline_message_2283, - JSCompiler_object_inline_componentStack_2286 + JSCompiler_object_inline_message_2285, + JSCompiler_object_inline_componentStack_2288 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2283, + value: JSCompiler_object_inline_message_2285, source: null, - stack: JSCompiler_object_inline_componentStack_2286 + stack: JSCompiler_object_inline_componentStack_2288 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9147,25 +9158,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2286 = + (JSCompiler_object_inline_componentStack_2288 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2286) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2288) ) { - JSCompiler_object_inline_componentStack_2286 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2286) { - JSCompiler_object_inline_stack_2285 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2285 & 42)) - JSCompiler_object_inline_stack_2285 = 1; + JSCompiler_object_inline_componentStack_2288 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2288) { + JSCompiler_object_inline_stack_2287 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2287 & 42)) + JSCompiler_object_inline_stack_2287 = 1; else - switch (JSCompiler_object_inline_stack_2285) { + switch (JSCompiler_object_inline_stack_2287) { case 2: - JSCompiler_object_inline_stack_2285 = 1; + JSCompiler_object_inline_stack_2287 = 1; break; case 8: - JSCompiler_object_inline_stack_2285 = 4; + JSCompiler_object_inline_stack_2287 = 4; break; case 32: - JSCompiler_object_inline_stack_2285 = 16; + JSCompiler_object_inline_stack_2287 = 16; break; case 128: case 256: @@ -9186,40 +9197,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2285 = 64; + JSCompiler_object_inline_stack_2287 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2285 = 134217728; + JSCompiler_object_inline_stack_2287 = 134217728; break; default: - JSCompiler_object_inline_stack_2285 = 0; + JSCompiler_object_inline_stack_2287 = 0; } - JSCompiler_object_inline_stack_2285 = + JSCompiler_object_inline_stack_2287 = 0 !== - (JSCompiler_object_inline_stack_2285 & - (JSCompiler_object_inline_componentStack_2286.suspendedLanes | + (JSCompiler_object_inline_stack_2287 & + (JSCompiler_object_inline_componentStack_2288.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2285; + : JSCompiler_object_inline_stack_2287; if ( - 0 !== JSCompiler_object_inline_stack_2285 && - JSCompiler_object_inline_stack_2285 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2287 && + JSCompiler_object_inline_stack_2287 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2285), + ((prevState.retryLane = JSCompiler_object_inline_stack_2287), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2285 + JSCompiler_object_inline_stack_2287 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2286, + JSCompiler_object_inline_componentStack_2288, current, - JSCompiler_object_inline_stack_2285 + JSCompiler_object_inline_stack_2287 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2284.data === + JSCompiler_object_inline_digest_2286.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9227,7 +9238,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2284.data === + JSCompiler_object_inline_digest_2286.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9235,12 +9246,12 @@ null, current )), - (JSCompiler_object_inline_digest_2284._reactRetry = + (JSCompiler_object_inline_digest_2286._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2284.nextSibling + JSCompiler_object_inline_digest_2286.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9258,54 +9269,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2285.children + JSCompiler_object_inline_stack_2287.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2283) + if (JSCompiler_object_inline_message_2285) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2283 = - JSCompiler_object_inline_stack_2285.fallback), - (JSCompiler_object_inline_digest_2284 = workInProgress.mode), + (JSCompiler_object_inline_message_2285 = + JSCompiler_object_inline_stack_2287.fallback), + (JSCompiler_object_inline_digest_2286 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2285 = createWorkInProgress( + (JSCompiler_object_inline_stack_2287 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2285.children + children: JSCompiler_object_inline_stack_2287.children } )), - (JSCompiler_object_inline_stack_2285.subtreeFlags = + (JSCompiler_object_inline_stack_2287.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2283 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2285 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2283 + JSCompiler_object_inline_message_2285 )) - : ((JSCompiler_object_inline_message_2283 = createFiberFromFragment( - JSCompiler_object_inline_message_2283, - JSCompiler_object_inline_digest_2284, + : ((JSCompiler_object_inline_message_2285 = createFiberFromFragment( + JSCompiler_object_inline_message_2285, + JSCompiler_object_inline_digest_2286, renderLanes, null )), - (JSCompiler_object_inline_message_2283.flags |= 2)), - (JSCompiler_object_inline_message_2283.return = workInProgress), - (JSCompiler_object_inline_stack_2285.return = workInProgress), - (JSCompiler_object_inline_stack_2285.sibling = - JSCompiler_object_inline_message_2283), - (workInProgress.child = JSCompiler_object_inline_stack_2285), - (JSCompiler_object_inline_stack_2285 = - JSCompiler_object_inline_message_2283), - (JSCompiler_object_inline_message_2283 = workInProgress.child), - (JSCompiler_object_inline_digest_2284 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2284 - ? (JSCompiler_object_inline_digest_2284 = + (JSCompiler_object_inline_message_2285.flags |= 2)), + (JSCompiler_object_inline_message_2285.return = workInProgress), + (JSCompiler_object_inline_stack_2287.return = workInProgress), + (JSCompiler_object_inline_stack_2287.sibling = + JSCompiler_object_inline_message_2285), + (workInProgress.child = JSCompiler_object_inline_stack_2287), + (JSCompiler_object_inline_stack_2287 = + JSCompiler_object_inline_message_2285), + (JSCompiler_object_inline_message_2285 = workInProgress.child), + (JSCompiler_object_inline_digest_2286 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2286 + ? (JSCompiler_object_inline_digest_2286 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2284.cachePool), + JSCompiler_object_inline_digest_2286.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9313,38 +9324,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2284 = { + (JSCompiler_object_inline_digest_2286 = { baseLanes: - JSCompiler_object_inline_digest_2284.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2286.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2283.memoizedState = - JSCompiler_object_inline_digest_2284), - (JSCompiler_object_inline_message_2283.childLanes = + (JSCompiler_object_inline_message_2285.memoizedState = + JSCompiler_object_inline_digest_2286), + (JSCompiler_object_inline_message_2285.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2286, + JSCompiler_object_inline_componentStack_2288, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2285 + JSCompiler_object_inline_stack_2287 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2285.children + children: JSCompiler_object_inline_stack_2287.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2286 = + ((JSCompiler_object_inline_componentStack_2288 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2286 + null === JSCompiler_object_inline_componentStack_2288 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2286.push(current)); + : JSCompiler_object_inline_componentStack_2288.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -13767,7 +13778,8 @@ workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14564,7 +14576,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14606,188 +14619,199 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var shouldTimeSlice = - (!forceSync && - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes)) || - !1, - exitStatus = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes, !0); - do { - var renderWasConcurrent = shouldTimeSlice; - if (exitStatus === RootInProgress) break; - else if (exitStatus === RootDidNotComplete) - markRootSuspended(root, lanes, 0); - else { - forceSync = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(forceSync) - ) { - exitStatus = renderRootSync(root, lanes, !1); - continue; - } - if (exitStatus === RootErrored) { - renderWasConcurrent = lanes; - if (root.errorRecoveryDisabledLanes & renderWasConcurrent) - var errorRetryLanes = 0; - else - (errorRetryLanes = root.pendingLanes & -536870913), - (errorRetryLanes = - 0 !== errorRetryLanes - ? errorRetryLanes - : errorRetryLanes & 536870912 - ? 536870912 - : 0); - if (0 !== errorRetryLanes) { - lanes = errorRetryLanes; - a: { - exitStatus = root; - var errorRetryLanes$jscomp$0 = errorRetryLanes; - errorRetryLanes = workInProgressRootConcurrentErrors; - var wasRootDehydrated = - exitStatus.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack( + var exitStatus = (forceSync = + !forceSync && 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes)) + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes); + if (exitStatus !== RootInProgress) { + var renderWasConcurrent = forceSync; + do { + if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes); + renderWasConcurrent = !1; + continue; + } + if (exitStatus === RootErrored) { + renderWasConcurrent = lanes; + if (root.errorRecoveryDisabledLanes & renderWasConcurrent) + var errorRetryLanes = 0; + else + (errorRetryLanes = root.pendingLanes & -536870913), + (errorRetryLanes = + 0 !== errorRetryLanes + ? errorRetryLanes + : errorRetryLanes & 536870912 + ? 536870912 + : 0); + if (0 !== errorRetryLanes) { + lanes = errorRetryLanes; + a: { + exitStatus = root; + var errorRetryLanes$jscomp$0 = errorRetryLanes; + errorRetryLanes = workInProgressRootConcurrentErrors; + var wasRootDehydrated = + exitStatus.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack( + exitStatus, + errorRetryLanes$jscomp$0 + ).flags |= 256); + errorRetryLanes$jscomp$0 = renderRootSync( exitStatus, errorRetryLanes$jscomp$0 - ).flags |= 256); - errorRetryLanes$jscomp$0 = renderRootSync( - exitStatus, - errorRetryLanes$jscomp$0, - !1 - ); - if (errorRetryLanes$jscomp$0 !== RootErrored) { - if ( - workInProgressRootDidAttachPingListener && - !wasRootDehydrated - ) { - exitStatus.errorRecoveryDisabledLanes |= - renderWasConcurrent; - workInProgressRootInterleavedUpdatedLanes |= - renderWasConcurrent; - exitStatus = RootSuspendedWithDelay; - break a; + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; + break a; + } + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); } - exitStatus = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorRetryLanes; - null !== exitStatus && queueRecoverableErrors(exitStatus); + exitStatus = errorRetryLanes$jscomp$0; } - exitStatus = errorRetryLanes$jscomp$0; + renderWasConcurrent = !1; + if (exitStatus !== RootErrored) continue; } - if (exitStatus !== RootErrored) continue; } - } - if (exitStatus === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - a: { - shouldTimeSlice = root; - renderWasConcurrent = now$1(); - switch (exitStatus) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); + break; + } + a: { + renderWasConcurrent = root; + errorRetryLanes = now$1(); + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + renderWasConcurrent, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + renderWasConcurrent, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + errorRetryLanes + ); + else { + if ( + (lanes & 62914560) === lanes && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { markRootSuspended( - shouldTimeSlice, + renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; + renderWasConcurrent.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + renderWasConcurrent, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + errorRetryLanes + ), + exitStatus ); break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); - } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) - commitRoot( - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - IMMEDIATE_COMMIT, - renderStartTime, - renderWasConcurrent - ); - else { - if ( - (lanes & 62914560) === lanes && - ((exitStatus = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < exitStatus) - ) { - markRootSuspended( - shouldTimeSlice, + commitRootWhenReady( + renderWasConcurrent, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; - shouldTimeSlice.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - shouldTimeSlice, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - THROTTLED_COMMIT, - renderStartTime, - renderWasConcurrent - ), - exitStatus + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + errorRetryLanes ); - break a; } - commitRootWhenReady( - shouldTimeSlice, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - IMMEDIATE_COMMIT, - renderStartTime, - renderWasConcurrent - ); } } - } - break; - } while (1); + break; + } while (1); + } ensureRootIsScheduled(root); } function queueRecoverableErrors(errors) { @@ -14813,11 +14837,8 @@ completedRenderStartTime, completedRenderEndTime ) { - didSkipSuspendedSiblings = finishedWork.subtreeFlags; - if ( - didSkipSuspendedSiblings & 8192 || - 16785408 === (didSkipSuspendedSiblings & 16785408) - ) + var subtreeFlags = finishedWork.subtreeFlags; + if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) if ( ((suspendedState = { stylesheets: null, @@ -14843,7 +14864,7 @@ completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14905,19 +14926,22 @@ (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didSkipSuspendedSiblings[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -15036,9 +15060,8 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidSkipSuspendedSiblings = !1; - checkIfRootIsPrerendering(root, lanes); - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = @@ -15131,7 +15154,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -15159,38 +15183,37 @@ prepareFreshStack(root, lanes); } lanes = !1; - memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - var unitOfWork = workInProgress, - thrownValue = workInProgressThrownValue; + memoizedUpdaters = workInProgress; + var thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - memoizedUpdaters = RootDidNotComplete; + workInProgressRootExitStatus = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - case SuspendedOnDeprecatedThrowPromise: - null === suspenseHandlerStackCursor.current && (lanes = !0); + lanes || + null !== suspenseHandlerStackCursor.current || + (lanes = !0); + default: var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); - break; - default: - (reason = workInProgressSuspendedReason), - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); - memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$8) { handleThrow(root, thrownValue$8); @@ -15201,11 +15224,14 @@ executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - null === workInProgress && - ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - finishQueueingConcurrentUpdates()); - return memoizedUpdaters; + if (null !== workInProgress) + throw Error( + "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." + ); + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -15229,7 +15255,7 @@ workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } else checkIfRootIsPrerendering(root, lanes); + } a: do try { if ( @@ -15593,41 +15619,42 @@ ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - suspendedRetryLanes = root.finishedWork; - updatedLanes = root.finishedLanes; + var finishedWork = root.finishedWork, + lanes = root.finishedLanes; reusableComponentDevToolDetails.track = - getGroupNameOfHighestPriorityLane(updatedLanes); + getGroupNameOfHighestPriorityLane(lanes); logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === suspendedRetryLanes) return null; - 0 === updatedLanes && + if (null === finishedWork) return null; + 0 === lanes && console.error( "root.finishedLanes should not be empty during a commit. This is a bug in React." ); root.finishedWork = null; root.finishedLanes = 0; - if (suspendedRetryLanes === root.current) + if (finishedWork === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - completedRenderStartTime = - suspendedRetryLanes.lanes | suspendedRetryLanes.childLanes; + completedRenderStartTime = finishedWork.lanes | finishedWork.childLanes; completedRenderStartTime |= concurrentlyUpdatedLanes; markRootFinished( root, - updatedLanes, + lanes, completedRenderStartTime, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === suspendedRetryLanes.actualDuration && - 0 === (suspendedRetryLanes.subtreeFlags & 10256) && - 0 === (suspendedRetryLanes.flags & 10256)) || + (0 === finishedWork.actualDuration && + 0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), (pendingPassiveEffectsRemainingLanes = completedRenderStartTime), @@ -15642,32 +15669,32 @@ ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) : suspendedCommitReason === THROTTLED_COMMIT && logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (suspendedRetryLanes.flags & 15990); - 0 !== (suspendedRetryLanes.subtreeFlags & 15990) || transitions + transitions = 0 !== (finishedWork.flags & 15990); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), (spawnedLane = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = DiscreteEventPriority), - (suspendedCommitReason = executionContext), + (updatedLanes = executionContext), (executionContext |= CommitContext), - commitBeforeMutationEffects(root, suspendedRetryLanes), - commitMutationEffects(root, suspendedRetryLanes, updatedLanes), + commitBeforeMutationEffects(root, finishedWork), + commitMutationEffects(root, finishedWork, lanes), restoreSelection(selectionInformation, root.containerInfo), (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), - (root.current = suspendedRetryLanes), - commitLayoutEffects(suspendedRetryLanes, root, updatedLanes), + (root.current = finishedWork), + commitLayoutEffects(finishedWork, root, lanes), requestPaint(), - (executionContext = suspendedCommitReason), + (executionContext = updatedLanes), (ReactDOMSharedInternals.p = spawnedLane), (ReactSharedInternals.T = transitions)) - : (root.current = suspendedRetryLanes); + : (root.current = finishedWork); commitEndTime = now(); logCommitPhase(commitStartTime, commitEndTime); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = updatedLanes)) + (pendingPassiveEffectsLanes = lanes)) : (releaseRootPooledCache(root, completedRenderStartTime), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); @@ -15675,18 +15702,17 @@ 0 === completedRenderStartTime && (legacyErrorBoundariesThatAlreadyFailed = null); transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(suspendedRetryLanes.stateNode, renderPriorityLevel); + onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, - suspendedRetryLanes = 0; - suspendedRetryLanes < recoverableErrors.length; - suspendedRetryLanes++ + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ ) - (completedRenderStartTime = recoverableErrors[suspendedRetryLanes]), + (completedRenderStartTime = recoverableErrors[finishedWork]), (spawnedLane = makeErrorInfo(completedRenderStartTime.stack)), runWithFiberInDEV( completedRenderStartTime.source, @@ -15698,13 +15724,13 @@ completedRenderStartTime = root.pendingLanes; didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate || - (0 !== (updatedLanes & 4194218) && 0 !== (completedRenderStartTime & 42)) + (0 !== (lanes & 4194218) && 0 !== (completedRenderStartTime & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - transitions || finalizeRender(updatedLanes, now$1()); + transitions || finalizeRender(lanes, now$1()); flushSyncWorkAcrossRoots_impl(0, !1); return null; } @@ -16155,8 +16181,7 @@ root, root === workInProgressRoot ? nextLanes : 0 )), - 0 === (nextLanes & 3) || - checkIfRootIsPrerendering(root, nextLanes) || + 0 !== (nextLanes & 3) && ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); root = root.next; @@ -16247,6 +16272,8 @@ else return currentTime; switch (lanesToEventPriority(suspendedLanes)) { case DiscreteEventPriority: + suspendedLanes = ImmediatePriority; + break; case ContinuousEventPriority: suspendedLanes = UserBlockingPriority; break; @@ -24963,11 +24990,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-3edc000d-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-3edc000d-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25004,11 +25031,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-778e1ed2-20240926", + version: "19.0.0-experimental-3edc000d-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" + reconcilerVersion: "19.0.0-experimental-3edc000d-20240926" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25480,7 +25507,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-778e1ed2-20240926"; + exports.version = "19.0.0-experimental-3edc000d-20240926"; "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 0593b1c74be54..97c9fb415ca9a 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 @@ -675,39 +675,43 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } -function checkIfRootIsPrerendering(root, renderLanes) { - return ( - 0 === - (root.pendingLanes & - ~(root.suspendedLanes & ~root.pingedLanes) & - renderLanes) - ); -} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -765,7 +769,14 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; @@ -775,31 +786,36 @@ function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - finishedLanes = root.entanglements; - var expirationTimes = root.expirationTimes, + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index$6 = 31 - clz32(remainingLanes); - previouslyPendingLanes = 1 << index$6; - finishedLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(remainingLanes), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~previouslyPendingLanes; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -814,19 +830,19 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$9 = 31 - clz32(lanes), - lane = 1 << index$9; - root[index$9].add(fiber); + var index$10 = 31 - clz32(lanes), + lane = 1 << index$10; + root[index$10].add(fiber); lanes &= ~lane; } } @@ -838,16 +854,16 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$10 = 31 - clz32(lanes); - root = 1 << index$10; - index$10 = pendingUpdatersLaneMap[index$10]; - 0 < index$10.size && - (index$10.forEach(function (fiber) { + var index$11 = 31 - clz32(lanes); + root = 1 << index$11; + index$11 = pendingUpdatersLaneMap[index$11]; + 0 < index$11.size && + (index$11.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$10.clear()); + index$11.clear()); lanes &= ~root; } } @@ -1008,8 +1024,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$11 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$11 && "aria-" !== prefix$11) { + var prefix$12 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$12 && "aria-" !== prefix$12) { node.removeAttribute(name); return; } @@ -1342,15 +1358,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$17 in styles) - (styleName = styles[styleName$17]), - styles.hasOwnProperty(styleName$17) && - prevStyles[styleName$17] !== styleName && - setValueForStyle(node, styleName$17, styleName); - } else for (var styleName$18 in styles) - styles.hasOwnProperty(styleName$18) && - setValueForStyle(node, styleName$18, styles[styleName$18]); + (styleName = styles[styleName$18]), + styles.hasOwnProperty(styleName$18) && + prevStyles[styleName$18] !== styleName && + setValueForStyle(node, styleName$18, styleName); + } else + for (var styleName$19 in styles) + styles.hasOwnProperty(styleName$19) && + setValueForStyle(node, styleName$19, styles[styleName$19]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -4194,7 +4210,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$56 = !1; + didReadFromEntangledAsyncAction$57 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -4215,11 +4231,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$56 = !0); + (didReadFromEntangledAsyncAction$57 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$56 = !0); + (didReadFromEntangledAsyncAction$57 = !0); continue; } else (updateLane = { @@ -4265,7 +4281,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$56 && + didReadFromEntangledAsyncAction$57 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4463,8 +4479,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$62) { - onActionError(actionQueue, node, error$62); + } catch (error$63) { + onActionError(actionQueue, node, error$63); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4913,15 +4929,15 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$65 = enqueueUpdate(provider, fiber, lane); - null !== root$65 && + var root$66 = enqueueUpdate(provider, fiber, lane); + null !== root$66 && (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root$65, provider, lane), - entangleTransitions(root$65, provider, lane)); + scheduleUpdateOnFiber(root$66, provider, lane), + entangleTransitions(root$66, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$65 && + null !== root$66 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5458,9 +5474,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$69 in Component) - void 0 === newProps[propName$69] && - (newProps[propName$69] = Component[propName$69]); + for (var propName$70 in Component) + void 0 === newProps[propName$70] && + (newProps[propName$70] = Component[propName$70]); } return newProps; } @@ -5506,9 +5522,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$70) { + } catch (e$71) { setTimeout(function () { - throw e$70; + throw e$71; }); } } @@ -5519,9 +5535,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$71) { + } catch (e$72) { setTimeout(function () { - throw e$71; + throw e$72; }); } } @@ -8022,8 +8038,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$119) { - captureCommitPhaseError(current, nearestMountedAncestor, error$119); + } catch (error$120) { + captureCommitPhaseError(current, nearestMountedAncestor, error$120); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -8083,8 +8099,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordEffectDuration(current); } else ref(null); - } catch (error$120) { - captureCommitPhaseError(current, nearestMountedAncestor, error$120); + } catch (error$121) { + captureCommitPhaseError(current, nearestMountedAncestor, error$121); } else ref.current = null; } @@ -8253,7 +8269,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$21) { + } catch (e$22) { JSCompiler_temp = null; break a; } @@ -8423,11 +8439,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$116) { + } catch (error$117) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$116 + error$117 ); } else { @@ -8444,11 +8460,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$117) { + } catch (error$118) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$117 + error$118 ); } recordEffectDuration(); @@ -8459,11 +8475,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$118) { + } catch (error$119) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$118 + error$119 ); } } @@ -8640,7 +8656,7 @@ function commitDeletionEffectsOnFiber( safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: prevHostParentIsContainer = hostParent; - var prevHostParentIsContainer$128 = hostParentIsContainer; + var prevHostParentIsContainer$129 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, @@ -8648,7 +8664,7 @@ function commitDeletionEffectsOnFiber( deletedFiber ); hostParent = prevHostParentIsContainer; - hostParentIsContainer = prevHostParentIsContainer$128; + hostParentIsContainer = prevHostParentIsContainer$129; if (null !== hostParent) if (hostParentIsContainer) try { @@ -9303,21 +9319,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$121 = JSCompiler_inline_result.stateNode; + var parent$122 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$121, ""), + (setTextContent(parent$122, ""), (JSCompiler_inline_result.flags &= -33)); - var before$122 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$122, parent$121); + var before$123 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$123, parent$122); break; case 3: case 4: - var parent$123 = JSCompiler_inline_result.stateNode.containerInfo, - before$124 = getHostSibling(finishedWork); + var parent$124 = JSCompiler_inline_result.stateNode.containerInfo, + before$125 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$124, - parent$123 + before$125, + parent$124 ); break; default: @@ -10330,7 +10346,8 @@ function scheduleRetryEffect(workInProgress, retryQueue) { workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -10347,14 +10364,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$143 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$143 = lastTailNode), + for (var lastTailNode$144 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$144 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$143 + null === lastTailNode$144 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$143.sibling = null); + : (lastTailNode$144.sibling = null); } } function bubbleProperties(completedWork) { @@ -10366,53 +10383,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$145 = completedWork.selfBaseDuration, - child$146 = completedWork.child; - null !== child$146; + var treeBaseDuration$146 = completedWork.selfBaseDuration, + child$147 = completedWork.child; + null !== child$147; ) - (newChildLanes |= child$146.lanes | child$146.childLanes), - (subtreeFlags |= child$146.subtreeFlags & 31457280), - (subtreeFlags |= child$146.flags & 31457280), - (treeBaseDuration$145 += child$146.treeBaseDuration), - (child$146 = child$146.sibling); - completedWork.treeBaseDuration = treeBaseDuration$145; + (newChildLanes |= child$147.lanes | child$147.childLanes), + (subtreeFlags |= child$147.subtreeFlags & 31457280), + (subtreeFlags |= child$147.flags & 31457280), + (treeBaseDuration$146 += child$147.treeBaseDuration), + (child$147 = child$147.sibling); + completedWork.treeBaseDuration = treeBaseDuration$146; } else for ( - treeBaseDuration$145 = completedWork.child; - null !== treeBaseDuration$145; + treeBaseDuration$146 = completedWork.child; + null !== treeBaseDuration$146; ) (newChildLanes |= - treeBaseDuration$145.lanes | treeBaseDuration$145.childLanes), - (subtreeFlags |= treeBaseDuration$145.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$145.flags & 31457280), - (treeBaseDuration$145.return = completedWork), - (treeBaseDuration$145 = treeBaseDuration$145.sibling); + treeBaseDuration$146.lanes | treeBaseDuration$146.childLanes), + (subtreeFlags |= treeBaseDuration$146.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$146.flags & 31457280), + (treeBaseDuration$146.return = completedWork), + (treeBaseDuration$146 = treeBaseDuration$146.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$145 = completedWork.actualDuration; - child$146 = completedWork.selfBaseDuration; + treeBaseDuration$146 = completedWork.actualDuration; + child$147 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$145 += child.actualDuration), - (child$146 += child.treeBaseDuration), + (treeBaseDuration$146 += child.actualDuration), + (child$147 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$145; - completedWork.treeBaseDuration = child$146; + completedWork.actualDuration = treeBaseDuration$146; + completedWork.treeBaseDuration = child$147; } else for ( - treeBaseDuration$145 = completedWork.child; - null !== treeBaseDuration$145; + treeBaseDuration$146 = completedWork.child; + null !== treeBaseDuration$146; ) (newChildLanes |= - treeBaseDuration$145.lanes | treeBaseDuration$145.childLanes), - (subtreeFlags |= treeBaseDuration$145.subtreeFlags), - (subtreeFlags |= treeBaseDuration$145.flags), - (treeBaseDuration$145.return = completedWork), - (treeBaseDuration$145 = treeBaseDuration$145.sibling); + treeBaseDuration$146.lanes | treeBaseDuration$146.childLanes), + (subtreeFlags |= treeBaseDuration$146.subtreeFlags), + (subtreeFlags |= treeBaseDuration$146.flags), + (treeBaseDuration$146.return = completedWork), + (treeBaseDuration$146 = treeBaseDuration$146.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10705,11 +10722,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$161 = null; + var cache$162 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$161 = newProps.memoizedState.cachePool.pool); - cache$161 !== type && (newProps.flags |= 2048); + (cache$162 = newProps.memoizedState.cachePool.pool); + cache$162 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10739,8 +10756,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$161 = type.rendering; - if (null === cache$161) + cache$162 = type.rendering; + if (null === cache$162) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10748,11 +10765,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$161 = findFirstSuspended(current); - if (null !== cache$161) { + cache$162 = findFirstSuspended(current); + if (null !== cache$162) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$161.updateQueue; + current = cache$162.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10777,7 +10794,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$161)), null !== current)) { + if (((current = findFirstSuspended(cache$162)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10787,7 +10804,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$161.alternate && + !cache$162.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10800,13 +10817,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$161.sibling = workInProgress.child), - (workInProgress.child = cache$161)) + ? ((cache$162.sibling = workInProgress.child), + (workInProgress.child = cache$162)) : ((current = type.last), null !== current - ? (current.sibling = cache$161) - : (workInProgress.child = cache$161), - (type.last = cache$161)); + ? (current.sibling = cache$162) + : (workInProgress.child = cache$162), + (type.last = cache$162)); } if (null !== type.tail) return ( @@ -11041,7 +11058,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -11053,160 +11071,179 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var shouldTimeSlice = - (!forceSync && - 0 === (lanes & 60) && - 0 === (lanes & root$jscomp$0.expiredLanes)) || - !1, - exitStatus = shouldTimeSlice - ? renderRootConcurrent(root$jscomp$0, lanes) - : renderRootSync(root$jscomp$0, lanes, !0); - do { - var renderWasConcurrent = shouldTimeSlice; - if (0 === exitStatus) break; - else if (6 === exitStatus) markRootSuspended(root$jscomp$0, lanes, 0); - else { - forceSync = root$jscomp$0.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(forceSync) - ) { - exitStatus = renderRootSync(root$jscomp$0, lanes, !1); - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) - var JSCompiler_inline_result = 0; - else - (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), + var exitStatus = (forceSync = + !forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes); + if (0 !== exitStatus) { + var renderWasConcurrent = forceSync; + do { + if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes); + renderWasConcurrent = !1; + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else (JSCompiler_inline_result = - 0 !== JSCompiler_inline_result - ? JSCompiler_inline_result - : JSCompiler_inline_result & 536870912 - ? 536870912 - : 0); - if (0 !== JSCompiler_inline_result) { - lanes = JSCompiler_inline_result; - a: { - var root = root$jscomp$0; - exitStatus = workInProgressRootConcurrentErrors; - var wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); - JSCompiler_inline_result = renderRootSync( - root, - JSCompiler_inline_result, - !1 - ); - if (2 !== JSCompiler_inline_result) { - if ( - workInProgressRootDidAttachPingListener && - !wasRootDehydrated - ) { - root.errorRecoveryDisabledLanes |= renderWasConcurrent; - workInProgressRootInterleavedUpdatedLanes |= - renderWasConcurrent; - exitStatus = 4; - break a; + root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= + 256); + JSCompiler_inline_result = renderRootSync( + root, + JSCompiler_inline_result + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; + break a; + } + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); } - renderWasConcurrent = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = exitStatus; - null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + exitStatus = JSCompiler_inline_result; } - exitStatus = JSCompiler_inline_result; + renderWasConcurrent = !1; + if (2 !== exitStatus) continue; } - if (2 !== exitStatus) continue; } - } - if (1 === exitStatus) { - prepareFreshStack(root$jscomp$0, 0); - markRootSuspended(root$jscomp$0, lanes, 0); - break; - } - a: { - shouldTimeSlice = root$jscomp$0; - renderWasConcurrent = exitStatus; - exitStatus = now$1(); - switch (renderWasConcurrent) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - shouldTimeSlice, - lanes, - workInProgressDeferredLane - ); - break a; - } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended( + root$jscomp$0, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); + break; } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; - if ( - (lanes & 62914560) === lanes && - ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now$1()), - 10 < renderWasConcurrent) - ) { - markRootSuspended(shouldTimeSlice, lanes, workInProgressDeferredLane); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; - shouldTimeSlice.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - shouldTimeSlice, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + a: { + renderWasConcurrent = root$jscomp$0; + JSCompiler_inline_result = now$1(); + switch (exitStatus) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + renderWasConcurrent, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + ((exitStatus = globalMostRecentFallbackTime + 300 - now$1()), + 10 < exitStatus) + ) { + markRootSuspended( + renderWasConcurrent, lanes, workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - 2, - renderStartTime, + workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; + renderWasConcurrent.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + renderWasConcurrent, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + renderStartTime, + JSCompiler_inline_result + ), exitStatus - ), - renderWasConcurrent + ); + break a; + } + commitRootWhenReady( + renderWasConcurrent, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + renderStartTime, + JSCompiler_inline_result ); - break a; } - commitRootWhenReady( - shouldTimeSlice, - forceSync, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - 0, - renderStartTime, - exitStatus - ); } - } - break; - } while (1); + break; + } while (1); + } ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { @@ -11232,11 +11269,8 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - didSkipSuspendedSiblings = finishedWork.subtreeFlags; - if ( - didSkipSuspendedSiblings & 8192 || - 16785408 === (didSkipSuspendedSiblings & 16785408) - ) + var subtreeFlags = finishedWork.subtreeFlags; + if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop$1 }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -11258,7 +11292,7 @@ function commitRootWhenReady( completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -11317,19 +11351,22 @@ function markRootUpdated(root, updatedLanes) { : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended(root, suspendedLanes, spawnedLane) { +function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -11447,9 +11484,8 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidSkipSuspendedSiblings = !1; - checkIfRootIsPrerendering(root, lanes); - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -11538,7 +11574,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -11563,35 +11600,29 @@ function renderRootSync(root, lanes) { prepareFreshStack(root, lanes); } lanes = !1; - memoizedUpdaters = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - var unitOfWork = workInProgress, - thrownValue = workInProgressThrownValue; + memoizedUpdaters = workInProgress; + var thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - memoizedUpdaters = 6; + workInProgressRootExitStatus = 6; break a; case 3: case 2: - case 6: - null === suspenseHandlerStackCursor.current && (lanes = !0); + lanes || + null !== suspenseHandlerStackCursor.current || + (lanes = !0); + default: var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); - break; - default: - (reason = workInProgressSuspendedReason), - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue, reason); } } workLoopSync(); - memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$177) { handleThrow(root, thrownValue$177); @@ -11602,11 +11633,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - null === workInProgress && - ((workInProgressRoot = null), - (workInProgressRootRenderLanes = 0), - finishQueueingConcurrentUpdates()); - return memoizedUpdaters; + if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + finishQueueingConcurrentUpdates(); + return workInProgressRootExitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -11627,7 +11658,7 @@ function renderRootConcurrent(root, lanes) { workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + 500; prepareFreshStack(root, lanes); - } else checkIfRootIsPrerendering(root, lanes); + } a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) @@ -11930,30 +11961,35 @@ function commitRootImpl( do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - suspendedRetryLanes = root.finishedWork; - updatedLanes = root.finishedLanes; + var finishedWork = root.finishedWork, + lanes = root.finishedLanes; reusableComponentDevToolDetails.track = - getGroupNameOfHighestPriorityLane(updatedLanes); + getGroupNameOfHighestPriorityLane(lanes); logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === suspendedRetryLanes) return null; + if (null === finishedWork) return null; root.finishedWork = null; root.finishedLanes = 0; - if (suspendedRetryLanes === root.current) - throw Error(formatProdErrorMessage(177)); + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - completedRenderStartTime = - suspendedRetryLanes.lanes | suspendedRetryLanes.childLanes; + completedRenderStartTime = finishedWork.lanes | finishedWork.childLanes; completedRenderStartTime |= concurrentlyUpdatedLanes; - markRootFinished(root, updatedLanes, completedRenderStartTime, spawnedLane); + markRootFinished( + root, + lanes, + completedRenderStartTime, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === suspendedRetryLanes.actualDuration && - 0 === (suspendedRetryLanes.subtreeFlags & 10256) && - 0 === (suspendedRetryLanes.flags & 10256)) || + (0 === finishedWork.actualDuration && + 0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), (pendingPassiveEffectsRemainingLanes = completedRenderStartTime), @@ -11968,46 +12004,46 @@ function commitRootImpl( ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) : 2 === suspendedCommitReason && logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (suspendedRetryLanes.flags & 15990); - 0 !== (suspendedRetryLanes.subtreeFlags & 15990) || transitions + transitions = 0 !== (finishedWork.flags & 15990); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), (spawnedLane = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = 2), - (suspendedCommitReason = executionContext), + (updatedLanes = executionContext), (executionContext |= 4), - commitBeforeMutationEffects(root, suspendedRetryLanes), - commitMutationEffects(root, suspendedRetryLanes, updatedLanes), + commitBeforeMutationEffects(root, finishedWork), + commitMutationEffects(root, finishedWork, lanes), restoreSelection(selectionInformation, root.containerInfo), (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), - (root.current = suspendedRetryLanes), - commitLayoutEffects(suspendedRetryLanes, root, updatedLanes), + (root.current = finishedWork), + commitLayoutEffects(finishedWork, root, lanes), requestPaint(), - (executionContext = suspendedCommitReason), + (executionContext = updatedLanes), (ReactDOMSharedInternals.p = spawnedLane), (ReactSharedInternals.T = transitions)) - : (root.current = suspendedRetryLanes); + : (root.current = finishedWork); commitEndTime = now(); logCommitPhase(commitStartTime, commitEndTime); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = updatedLanes)) + (pendingPassiveEffectsLanes = lanes)) : releaseRootPooledCache(root, completedRenderStartTime); completedRenderStartTime = root.pendingLanes; 0 === completedRenderStartTime && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(suspendedRetryLanes.stateNode, renderPriorityLevel); + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, suspendedRetryLanes = 0; - suspendedRetryLanes < recoverableErrors.length; - suspendedRetryLanes++ + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ ) - (completedRenderStartTime = recoverableErrors[suspendedRetryLanes]), + (completedRenderStartTime = recoverableErrors[finishedWork]), renderPriorityLevel(completedRenderStartTime.value, { componentStack: completedRenderStartTime.stack }); @@ -12015,13 +12051,13 @@ function commitRootImpl( completedRenderStartTime = root.pendingLanes; didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate || - (0 !== (updatedLanes & 4194218) && 0 !== (completedRenderStartTime & 42)) + (0 !== (lanes & 4194218) && 0 !== (completedRenderStartTime & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - transitions || finalizeRender(updatedLanes, now$1()); + transitions || finalizeRender(lanes, now$1()); flushSyncWorkAcrossRoots_impl(0, !1); return null; } @@ -12303,8 +12339,7 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { root$185, root$185 === workInProgressRoot ? JSCompiler_inline_result : 0 )), - 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$185, JSCompiler_inline_result) || + 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), performSyncWorkOnRoot(root$185, JSCompiler_inline_result)); root$185 = root$185.next; @@ -12348,12 +12383,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -12390,6 +12425,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { null !== pingedLanes && cancelCallback$1(pingedLanes); switch (lanesToEventPriority(suspendedLanes)) { case 2: + suspendedLanes = ImmediatePriority; + break; case 8: suspendedLanes = UserBlockingPriority; break; @@ -12538,20 +12575,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1483 = 0; - i$jscomp$inline_1483 < simpleEventPluginEvents.length; - i$jscomp$inline_1483++ + var i$jscomp$inline_1485 = 0; + i$jscomp$inline_1485 < simpleEventPluginEvents.length; + i$jscomp$inline_1485++ ) { - var eventName$jscomp$inline_1484 = - simpleEventPluginEvents[i$jscomp$inline_1483], - domEventName$jscomp$inline_1485 = - eventName$jscomp$inline_1484.toLowerCase(), - capitalizedEvent$jscomp$inline_1486 = - eventName$jscomp$inline_1484[0].toUpperCase() + - eventName$jscomp$inline_1484.slice(1); + var eventName$jscomp$inline_1486 = + simpleEventPluginEvents[i$jscomp$inline_1485], + domEventName$jscomp$inline_1487 = + eventName$jscomp$inline_1486.toLowerCase(), + capitalizedEvent$jscomp$inline_1488 = + eventName$jscomp$inline_1486[0].toUpperCase() + + eventName$jscomp$inline_1486.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1485, - "on" + capitalizedEvent$jscomp$inline_1486 + domEventName$jscomp$inline_1487, + "on" + capitalizedEvent$jscomp$inline_1488 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16017,16 +16054,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1730 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1732 = React.version; if ( - "19.0.0-experimental-778e1ed2-20240926" !== - isomorphicReactPackageVersion$jscomp$inline_1730 + "19.0.0-experimental-3edc000d-20240926" !== + isomorphicReactPackageVersion$jscomp$inline_1732 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1730, - "19.0.0-experimental-778e1ed2-20240926" + isomorphicReactPackageVersion$jscomp$inline_1732, + "19.0.0-experimental-3edc000d-20240926" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16046,25 +16083,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2168 = { +var internals$jscomp$inline_2170 = { bundleType: 0, - version: "19.0.0-experimental-778e1ed2-20240926", + version: "19.0.0-experimental-3edc000d-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" + reconcilerVersion: "19.0.0-experimental-3edc000d-20240926" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2169 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2171 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2169.isDisabled && - hook$jscomp$inline_2169.supportsFiber + !hook$jscomp$inline_2171.isDisabled && + hook$jscomp$inline_2171.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2169.inject( - internals$jscomp$inline_2168 + (rendererID = hook$jscomp$inline_2171.inject( + internals$jscomp$inline_2170 )), - (injectedHook = hook$jscomp$inline_2169); + (injectedHook = hook$jscomp$inline_2171); } catch (err) {} } function noop() {} @@ -16317,7 +16354,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-778e1ed2-20240926"; +exports.version = "19.0.0-experimental-3edc000d-20240926"; "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 562d59ee0057a..ce30e2a59f72e 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 @@ -4322,7 +4322,7 @@ this.rootFormatContext = rootFormatContext; this.progressiveChunkSize = void 0 === progressiveChunkSize ? 12800 : progressiveChunkSize; - this.status = 0; + this.status = 10; this.fatalError = null; this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; @@ -4696,7 +4696,7 @@ : (errorInfo(error), onFatalError(error)); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 2), (request.fatalError = error)); + : ((request.status = 13), (request.fatalError = error)); } function renderWithHooks( request, @@ -5129,7 +5129,7 @@ } else internalInstance.queue = null; } var nextChildren = callRenderInDEV(instance); - if (1 === request.status) throw null; + if (12 === request.status) throw null; instance.props !== resolvedProps && (didWarnAboutReassigningProps || console.error( @@ -5161,7 +5161,7 @@ props, void 0 ); - if (1 === request.status) throw null; + if (12 === request.status) throw null; var hasId = 0 !== localIdCounter, actionStateCount = actionStateCounter, actionStateMatchingIndex$jscomp$0 = actionStateMatchingIndex; @@ -5385,7 +5385,7 @@ (boundarySegment.status = COMPLETED); } catch (thrownValue) { throw ( - ((boundarySegment.status = 1 === request.status ? 3 : 4), + ((boundarySegment.status = 12 === request.status ? 3 : 4), thrownValue) ); } finally { @@ -5437,7 +5437,7 @@ } } catch (thrownValue$2) { newBoundary.status = CLIENT_RENDERED; - if (1 === request.status) { + if (12 === request.status) { contentRootSegment.status = 3; var error = request.fatalError; } else @@ -5598,7 +5598,7 @@ return; case REACT_LAZY_TYPE: var Component = callLazyInitInDEV(type); - if (1 === request.status) throw null; + if (12 === request.status) throw null; renderElement(request, task, keyPath, Component, props, ref); return; } @@ -5890,7 +5890,7 @@ ); case REACT_LAZY_TYPE: node = callLazyInitInDEV(node); - if (1 === request.status) throw null; + if (12 === request.status) throw null; renderNodeDestructive(request, task, node, childIndex); return; } @@ -6600,7 +6600,7 @@ } var errorInfo = getThrownInfo(task.componentStack); if (null === boundary) { - if (2 !== request.status && request.status !== CLOSED) { + if (13 !== request.status && request.status !== CLOSED) { boundary = task.replay; if (null === boundary) { "object" === typeof error && @@ -6833,7 +6833,10 @@ 0 === request.allPendingTasks && completeAll(request); } function performWork(request$jscomp$1) { - if (request$jscomp$1.status !== CLOSED && 2 !== request$jscomp$1.status) { + if ( + request$jscomp$1.status !== CLOSED && + 13 !== request$jscomp$1.status + ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = HooksDispatcher; @@ -6901,7 +6904,7 @@ erroredReplay( request$jscomp$0, request.blockedBoundary, - 1 === request$jscomp$0.status + 12 === request$jscomp$0.status ? request$jscomp$0.fatalError : x, errorInfo, @@ -6954,11 +6957,11 @@ var x$jscomp$0 = thrownValue === SuspenseException ? getSuspendedThenable() - : 1 === request.status + : 12 === request.status ? request.fatalError : thrownValue; if ( - 1 === request.status && + 12 === request.status && null !== request.trackedPostpones ) { var trackedPostpones = request.trackedPostpones, @@ -7705,10 +7708,10 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - null !== request.trackedPostpones - ? performWork(request) - : (performWork(request), - safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks)); + performWork(request); + 10 === request.status && (request.status = 11); + null === request.trackedPostpones && + safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks); } function enqueueFlush(request) { if ( @@ -7724,7 +7727,7 @@ } } function startFlowing(request, destination) { - if (2 === request.status) + if (13 === request.status) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -7738,7 +7741,7 @@ } } function abort(request, reason) { - 0 === request.status && (request.status = 1); + if (11 === request.status || 10 === request.status) request.status = 12; try { var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { @@ -9263,7 +9266,7 @@ COMPLETED = 1, FLUSHED = 2, POSTPONED = 5, - CLOSED = 3, + CLOSED = 14, currentRequest = null, didWarnAboutBadClass = {}, didWarnAboutContextTypes = {}, @@ -9288,5 +9291,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.0.0-experimental-778e1ed2-20240926"; + exports.version = "19.0.0-experimental-3edc000d-20240926"; })(); 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 98b84f55a14ac..2e1222ac14d28 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 @@ -2668,16 +2668,16 @@ function createRenderState(resumableState, generateStaticMarkup) { "\x3c/script>" ); bootstrapScriptContent = idPrefix + "P:"; - var JSCompiler_object_inline_segmentPrefix_1646 = idPrefix + "S:"; + var JSCompiler_object_inline_segmentPrefix_1643 = idPrefix + "S:"; idPrefix += "B:"; - var JSCompiler_object_inline_preconnects_1660 = new Set(), - JSCompiler_object_inline_fontPreloads_1661 = new Set(), - JSCompiler_object_inline_highImagePreloads_1662 = new Set(), - JSCompiler_object_inline_styles_1663 = new Map(), - JSCompiler_object_inline_bootstrapScripts_1664 = new Set(), - JSCompiler_object_inline_scripts_1665 = new Set(), - JSCompiler_object_inline_bulkPreloads_1666 = new Set(), - JSCompiler_object_inline_preloads_1667 = { + var JSCompiler_object_inline_preconnects_1657 = new Set(), + JSCompiler_object_inline_fontPreloads_1658 = new Set(), + JSCompiler_object_inline_highImagePreloads_1659 = new Set(), + JSCompiler_object_inline_styles_1660 = new Map(), + JSCompiler_object_inline_bootstrapScripts_1661 = new Set(), + JSCompiler_object_inline_scripts_1662 = new Set(), + JSCompiler_object_inline_bulkPreloads_1663 = new Set(), + JSCompiler_object_inline_preloads_1664 = { images: new Map(), stylesheets: new Map(), scripts: new Map(), @@ -2714,7 +2714,7 @@ function createRenderState(resumableState, generateStaticMarkup) { scriptConfig.moduleScriptResources[href] = null; scriptConfig = []; pushLinkImpl(scriptConfig, props); - JSCompiler_object_inline_bootstrapScripts_1664.add(scriptConfig); + JSCompiler_object_inline_bootstrapScripts_1661.add(scriptConfig); bootstrapChunks.push('