diff --git a/examples/reproduction-template/package.json b/examples/reproduction-template/package.json index e46540ae538d7..8f2496652e552 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-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912" }, "devDependencies": { "@types/node": "20.12.12", diff --git a/package.json b/package.json index 1402a0e080b8e..028f646eda962 100644 --- a/package.json +++ b/package.json @@ -206,19 +206,19 @@ "pretty-bytes": "5.3.0", "pretty-ms": "7.0.0", "random-seed": "0.3.0", - "react": "19.0.0-rc-7771d3a7-20240827", + "react": "19.0.0-rc-94e652d5-20240912", "react-17": "npm:react@17.0.2", - "react-builtin": "npm:react@19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827", + "react-builtin": "npm:react@19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@19.0.0-rc-7771d3a7-20240827", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-7771d3a7-20240827", - "react-experimental-builtin": "npm:react@0.0.0-experimental-7771d3a7-20240827", - "react-is-builtin": "npm:react-is@19.0.0-rc-7771d3a7-20240827", - "react-server-dom-turbopack": "19.0.0-rc-7771d3a7-20240827", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-7771d3a7-20240827", - "react-server-dom-webpack": "19.0.0-rc-7771d3a7-20240827", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-7771d3a7-20240827", + "react-dom-builtin": "npm:react-dom@19.0.0-rc-94e652d5-20240912", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-94e652d5-20240912", + "react-experimental-builtin": "npm:react@0.0.0-experimental-94e652d5-20240912", + "react-is-builtin": "npm:react-is@19.0.0-rc-94e652d5-20240912", + "react-server-dom-turbopack": "19.0.0-rc-94e652d5-20240912", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-94e652d5-20240912", + "react-server-dom-webpack": "19.0.0-rc-94e652d5-20240912", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-94e652d5-20240912", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -228,8 +228,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.9", - "scheduler-builtin": "npm:scheduler@0.25.0-rc-7771d3a7-20240827", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-7771d3a7-20240827", + "scheduler-builtin": "npm:scheduler@0.25.0-rc-94e652d5-20240912", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-94e652d5-20240912", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", @@ -269,10 +269,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-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827", - "react-is": "19.0.0-rc-7771d3a7-20240827", - "scheduler": "0.25.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912", + "react-is": "19.0.0-rc-94e652d5-20240912", + "scheduler": "0.25.0-rc-94e652d5-20240912" }, "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 8c6e59a5e94ef..ca356a8446e5e 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-7771d3a7-20240827"; +const nextjsReactPeerVersion = "19.0.0-rc-94e652d5-20240912"; /** * 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 a59f471a37b75..942656c15891f 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -108,8 +108,8 @@ "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "babel-plugin-react-compiler": "*", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827", + "react": "19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912", "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 5b1d8511cab05..24b3c991f54a4 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 @@ -1094,28 +1094,40 @@ 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; } @@ -1189,25 +1201,34 @@ for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } - function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index = 31 - clz32(noLongerPendingLanes), + var index = 31 - clz32(remainingLanes), lane = 1 << index; - remainingLanes[index] = 0; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1219,9 +1240,14 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + 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; @@ -3998,6 +4024,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5855,6 +5936,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -5911,10 +6000,16 @@ numberOfReRenders += 1; ignorePreviousDependencies = !1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } hookTypesUpdateIndexDev = -1; ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - var children = callComponentInDEV(Component, props, secondArg); + children = callComponentInDEV(Component, props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -6738,17 +6833,16 @@ function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function mountRef(initialValue) { @@ -7333,60 +7427,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error) { reportGlobalError(error); @@ -8028,8 +8190,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -8069,6 +8231,7 @@ hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -8258,8 +8421,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8695,33 +8858,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2306; - var JSCompiler_object_inline_stack_2305 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2286; + var JSCompiler_object_inline_stack_2285 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2303 = !1; + var JSCompiler_object_inline_message_2283 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2306 = didSuspend) || - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_componentStack_2286 = didSuspend) || + (JSCompiler_object_inline_componentStack_2286 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2306 && - ((JSCompiler_object_inline_message_2303 = !0), + JSCompiler_object_inline_componentStack_2286 && + ((JSCompiler_object_inline_message_2283 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2306 = + JSCompiler_object_inline_componentStack_2286 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2283 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2304 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2284 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2304)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2284)) { c: { - var instance = JSCompiler_object_inline_digest_2304; + var instance = JSCompiler_object_inline_digest_2284; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8762,19 +8925,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2304 + JSCompiler_object_inline_digest_2284 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2304 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2284 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2304 && - ((JSCompiler_object_inline_digest_2304 = - JSCompiler_object_inline_digest_2304.dehydrated), - null !== JSCompiler_object_inline_digest_2304) + null !== JSCompiler_object_inline_digest_2284 && + ((JSCompiler_object_inline_digest_2284 = + JSCompiler_object_inline_digest_2284.dehydrated), + null !== JSCompiler_object_inline_digest_2284) ) return ( - JSCompiler_object_inline_digest_2304.data === + JSCompiler_object_inline_digest_2284.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8782,68 +8945,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2304 = - JSCompiler_object_inline_stack_2305.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2305.fallback; - if (JSCompiler_object_inline_message_2303) + 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) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2305 = + (JSCompiler_object_inline_stack_2285 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2284, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2303 = workInProgress.child), - (JSCompiler_object_inline_message_2303.memoizedState = + (JSCompiler_object_inline_message_2283 = workInProgress.child), + (JSCompiler_object_inline_message_2283.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2303.childLanes = + (JSCompiler_object_inline_message_2283.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2286, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2285 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2305.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2285.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2305 = + (JSCompiler_object_inline_stack_2285 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2284, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2303 = workInProgress.child), - (JSCompiler_object_inline_message_2303.memoizedState = + (JSCompiler_object_inline_message_2283 = workInProgress.child), + (JSCompiler_object_inline_message_2283.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2303.childLanes = + (JSCompiler_object_inline_message_2283.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2286, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2285 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2304 + JSCompiler_object_inline_digest_2284 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2304 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2304) + ((JSCompiler_object_inline_digest_2284 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2284) ) { if (didSuspend) workInProgress.flags & 256 @@ -8860,94 +9023,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_stack_2305.fallback), - (JSCompiler_object_inline_digest_2304 = workInProgress.mode), - (JSCompiler_object_inline_stack_2305 = + (JSCompiler_object_inline_message_2283 = + JSCompiler_object_inline_stack_2285.fallback), + (JSCompiler_object_inline_digest_2284 = workInProgress.mode), + (JSCompiler_object_inline_stack_2285 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2285.children }, - JSCompiler_object_inline_digest_2304 + JSCompiler_object_inline_digest_2284 )), - (JSCompiler_object_inline_message_2303 = + (JSCompiler_object_inline_message_2283 = createFiberFromFragment( - JSCompiler_object_inline_message_2303, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_message_2283, + JSCompiler_object_inline_digest_2284, renderLanes, null )), - (JSCompiler_object_inline_message_2303.flags |= 2), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_message_2303.return = workInProgress), - (JSCompiler_object_inline_stack_2305.sibling = - JSCompiler_object_inline_message_2303), - (workInProgress.child = JSCompiler_object_inline_stack_2305), + (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), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2305 = workInProgress.child), - (JSCompiler_object_inline_stack_2305.memoizedState = + (JSCompiler_object_inline_stack_2285 = workInProgress.child), + (JSCompiler_object_inline_stack_2285.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2305.childLanes = + (JSCompiler_object_inline_stack_2285.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2286, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2303)); + (workInProgress = JSCompiler_object_inline_message_2283)); 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_2304.data === + JSCompiler_object_inline_digest_2284.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2306 = - JSCompiler_object_inline_digest_2304.nextSibling && - JSCompiler_object_inline_digest_2304.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2306) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2306.dgst; - var message = JSCompiler_object_inline_componentStack_2306.msg; - instance = JSCompiler_object_inline_componentStack_2306.stck; + 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; var componentStack = - JSCompiler_object_inline_componentStack_2306.cstck; + JSCompiler_object_inline_componentStack_2286.cstck; } - JSCompiler_object_inline_message_2303 = message; - JSCompiler_object_inline_digest_2304 = JSCompiler_temp; - JSCompiler_object_inline_stack_2305 = instance; - JSCompiler_object_inline_componentStack_2306 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2304 && - ((JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_message_2303 - ? Error(JSCompiler_object_inline_message_2303) + 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) : 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_2303.stack = - JSCompiler_object_inline_stack_2305 || ""), - (JSCompiler_object_inline_message_2303.digest = - JSCompiler_object_inline_digest_2304), - (JSCompiler_object_inline_componentStack_2306 = - void 0 === JSCompiler_object_inline_componentStack_2306 + (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 ? null - : JSCompiler_object_inline_componentStack_2306), - "string" === typeof JSCompiler_object_inline_componentStack_2306 && + : JSCompiler_object_inline_componentStack_2286), + "string" === typeof JSCompiler_object_inline_componentStack_2286 && CapturedStacks.set( - JSCompiler_object_inline_message_2303, - JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_message_2283, + JSCompiler_object_inline_componentStack_2286 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2303, + value: JSCompiler_object_inline_message_2283, source: null, - stack: JSCompiler_object_inline_componentStack_2306 + stack: JSCompiler_object_inline_componentStack_2286 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8962,25 +9125,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_componentStack_2286 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2306) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2286) ) { - JSCompiler_object_inline_componentStack_2306 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2306) { - JSCompiler_object_inline_stack_2305 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2305 & 42)) - JSCompiler_object_inline_stack_2305 = 1; + 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; else - switch (JSCompiler_object_inline_stack_2305) { + switch (JSCompiler_object_inline_stack_2285) { case 2: - JSCompiler_object_inline_stack_2305 = 1; + JSCompiler_object_inline_stack_2285 = 1; break; case 8: - JSCompiler_object_inline_stack_2305 = 4; + JSCompiler_object_inline_stack_2285 = 4; break; case 32: - JSCompiler_object_inline_stack_2305 = 16; + JSCompiler_object_inline_stack_2285 = 16; break; case 128: case 256: @@ -9001,40 +9164,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2305 = 64; + JSCompiler_object_inline_stack_2285 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2305 = 134217728; + JSCompiler_object_inline_stack_2285 = 134217728; break; default: - JSCompiler_object_inline_stack_2305 = 0; + JSCompiler_object_inline_stack_2285 = 0; } - JSCompiler_object_inline_stack_2305 = + JSCompiler_object_inline_stack_2285 = 0 !== - (JSCompiler_object_inline_stack_2305 & - (JSCompiler_object_inline_componentStack_2306.suspendedLanes | + (JSCompiler_object_inline_stack_2285 & + (JSCompiler_object_inline_componentStack_2286.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2305; + : JSCompiler_object_inline_stack_2285; if ( - 0 !== JSCompiler_object_inline_stack_2305 && - JSCompiler_object_inline_stack_2305 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2285 && + JSCompiler_object_inline_stack_2285 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2305), + ((prevState.retryLane = JSCompiler_object_inline_stack_2285), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2285 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2286, current, - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2285 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2304.data === + JSCompiler_object_inline_digest_2284.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9042,7 +9205,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2304.data === + JSCompiler_object_inline_digest_2284.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9050,12 +9213,12 @@ null, current )), - (JSCompiler_object_inline_digest_2304._reactRetry = + (JSCompiler_object_inline_digest_2284._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2304.nextSibling + JSCompiler_object_inline_digest_2284.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9073,54 +9236,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2305.children + JSCompiler_object_inline_stack_2285.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2303) + if (JSCompiler_object_inline_message_2283) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_stack_2305.fallback), - (JSCompiler_object_inline_digest_2304 = workInProgress.mode), + (JSCompiler_object_inline_message_2283 = + JSCompiler_object_inline_stack_2285.fallback), + (JSCompiler_object_inline_digest_2284 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2305 = createWorkInProgress( + (JSCompiler_object_inline_stack_2285 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2285.children } )), - (JSCompiler_object_inline_stack_2305.subtreeFlags = + (JSCompiler_object_inline_stack_2285.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2303 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2283 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2283 )) - : ((JSCompiler_object_inline_message_2303 = createFiberFromFragment( - JSCompiler_object_inline_message_2303, - JSCompiler_object_inline_digest_2304, + : ((JSCompiler_object_inline_message_2283 = createFiberFromFragment( + JSCompiler_object_inline_message_2283, + JSCompiler_object_inline_digest_2284, renderLanes, null )), - (JSCompiler_object_inline_message_2303.flags |= 2)), - (JSCompiler_object_inline_message_2303.return = workInProgress), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_stack_2305.sibling = - JSCompiler_object_inline_message_2303), - (workInProgress.child = JSCompiler_object_inline_stack_2305), - (JSCompiler_object_inline_stack_2305 = - JSCompiler_object_inline_message_2303), - (JSCompiler_object_inline_message_2303 = workInProgress.child), - (JSCompiler_object_inline_digest_2304 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2304 - ? (JSCompiler_object_inline_digest_2304 = + (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 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2304.cachePool), + JSCompiler_object_inline_digest_2284.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9128,38 +9291,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2304 = { + (JSCompiler_object_inline_digest_2284 = { baseLanes: - JSCompiler_object_inline_digest_2304.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2284.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2303.memoizedState = - JSCompiler_object_inline_digest_2304), - (JSCompiler_object_inline_message_2303.childLanes = + (JSCompiler_object_inline_message_2283.memoizedState = + JSCompiler_object_inline_digest_2284), + (JSCompiler_object_inline_message_2283.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2286, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2285 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2285.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2306 = + ((JSCompiler_object_inline_componentStack_2286 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2306 + null === JSCompiler_object_inline_componentStack_2286 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2306.push(current)); + : JSCompiler_object_inline_componentStack_2286.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10444,7 +10607,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -10733,6 +10900,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10743,128 +10920,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10872,101 +11463,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -11049,342 +11545,89 @@ (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (current = 0; current < finishedWork.length; current++) - (flags = finishedWork[current]), - (flags.ref.impl = flags.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.updateQueue), + (root = null !== root ? root.events : null), + null !== root) ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); } - parentFiber = parentFiber.return; + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; + } + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11400,17 +11643,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11424,21 +11677,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11446,11 +11703,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11466,59 +11719,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11526,11 +11784,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11540,11 +11794,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11567,78 +11817,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11718,14 +11896,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11771,7 +11972,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11781,14 +11984,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11856,7 +12063,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11905,74 +12116,53 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + function commitMutationEffectsOnFiber(finishedWork, root) { var current = finishedWork.alternate, flags = finishedWork.flags; switch (finishedWork.tag) { @@ -11980,53 +12170,31 @@ case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, finishedWork, - finishedWork.return, - error$10 - ); - } - } + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12043,116 +12211,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -12161,9 +12331,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -12178,117 +12348,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -12297,23 +12435,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -12321,7 +12462,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -12330,13 +12471,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -12346,12 +12487,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12367,15 +12508,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12383,13 +12524,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12398,47 +12539,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12469,7 +12609,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12480,7 +12620,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12488,52 +12628,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12553,27 +12648,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12656,24 +12737,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12690,7 +12775,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12699,9 +12784,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12738,9 +12847,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12748,22 +12855,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12794,9 +12885,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12843,9 +12932,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12854,18 +12943,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12909,9 +12996,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12944,9 +13029,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12956,11 +13041,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12998,62 +13081,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -13114,25 +13180,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -13149,11 +13196,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -13197,7 +13240,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -13227,22 +13270,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -13251,33 +13309,8 @@ nextEffect = sibling; break a; } - nextEffect = returnFiber; - } - } - } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); + nextEffect = returnFiber; + } } } function FiberNode(tag, pendingProps, key, mode) { @@ -13359,7 +13392,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13412,7 +13446,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13643,12 +13678,12 @@ ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14445,7 +14480,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14487,7 +14523,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14512,7 +14549,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14544,11 +14586,14 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -14560,7 +14605,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14574,13 +14620,17 @@ default: throw Error("Unknown root exit status."); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( renderWasConcurrent, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); else { if ( @@ -14594,7 +14644,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14606,7 +14657,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14619,7 +14673,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14674,7 +14731,10 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14690,10 +14750,13 @@ root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14701,31 +14764,33 @@ recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -14741,26 +14806,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (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 && @@ -14790,13 +14860,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -14807,7 +14882,9 @@ workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -14849,9 +14926,11 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -14974,7 +15053,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -15022,15 +15102,21 @@ null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -15086,7 +15172,12 @@ case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -15118,7 +15209,12 @@ replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -15150,12 +15246,22 @@ } workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); break; case SuspendedOnDeprecatedThrowPromise: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); break; case SuspendedOnHydration: resetWorkInProgressStack(); @@ -15170,8 +15276,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -15296,43 +15402,20 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -15366,12 +15449,46 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15384,7 +15501,9 @@ transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -15398,7 +15517,9 @@ transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15427,7 +15548,14 @@ root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -15443,34 +15571,34 @@ return null; })); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitBeforeMutationEffects(root, finishedWork); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - ReactDOMSharedInternals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = ReactDOMSharedInternals.p), + (ReactDOMSharedInternals.p = DiscreteEventPriority), + (updatedLanes = executionContext), + (executionContext |= CommitContext), + commitBeforeMutationEffects(root, finishedWork), + (commitTime = now()), + commitMutationEffects(root, finishedWork, lanes), + restoreSelection(selectionInformation), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (ReactDOMSharedInternals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : ((root.current = finishedWork), (commitTime = now())); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -15569,55 +15697,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15763,6 +15876,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -15782,7 +15896,9 @@ now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -19221,6 +19337,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -19244,6 +19392,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19444,6 +19613,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function resolveSingletonInstance( type, props, @@ -19482,6 +19657,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -20198,6 +20404,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -22242,6 +22449,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23824,84 +24038,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -23969,6 +24113,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -23988,7 +24195,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -24039,6 +24246,7 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -24046,6 +24254,7 @@ workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -24615,11 +24824,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== 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-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24656,11 +24865,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-94e652d5-20240912" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24804,7 +25013,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; "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 1cf7cbe835a8d..0d2d1bc137606 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,28 +597,40 @@ 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; } @@ -684,39 +696,53 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[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); } - noLongerPendingLanes &= ~lane; + 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; @@ -731,10 +757,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; } } @@ -884,8 +910,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; } @@ -1218,15 +1244,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; @@ -1955,19 +1981,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$290; + var JSCompiler_inline_result$jscomp$283; if (canUseDOM) { - var isSupported$jscomp$inline_425 = "oninput" in document; - if (!isSupported$jscomp$inline_425) { - var element$jscomp$inline_426 = document.createElement("div"); - element$jscomp$inline_426.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_425 = - "function" === typeof element$jscomp$inline_426.oninput; + var isSupported$jscomp$inline_418 = "oninput" in document; + if (!isSupported$jscomp$inline_418) { + var element$jscomp$inline_419 = document.createElement("div"); + element$jscomp$inline_419.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_418 = + "function" === typeof element$jscomp$inline_419.oninput; } - JSCompiler_inline_result$jscomp$290 = isSupported$jscomp$inline_425; - } else JSCompiler_inline_result$jscomp$290 = !1; + JSCompiler_inline_result$jscomp$283 = isSupported$jscomp$inline_418; + } else JSCompiler_inline_result$jscomp$283 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$290 && + JSCompiler_inline_result$jscomp$283 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -3716,9 +3742,15 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); numberOfReRenders += 1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } ReactSharedInternals.H = HooksDispatcherOnRerender; - var children = Component(props, secondArg); + children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -3901,7 +3933,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 ( @@ -3922,11 +3954,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 = { @@ -3972,7 +4004,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$54 && + didReadFromEntangledAsyncAction$55 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4170,8 +4202,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) { @@ -4362,17 +4394,16 @@ function rerenderActionState(action) { function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function updateRef() { @@ -4609,14 +4640,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; @@ -5043,6 +5074,108 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +} +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; +} +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$68 in Component) + void 0 === newProps[propName$68] && + (newProps[propName$68] = Component[propName$68]); + } + return newProps; +} var reportGlobalError = "function" === typeof reportError ? reportError @@ -5085,9 +5218,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$67) { + } catch (e$69) { setTimeout(function () { - throw e$67; + throw e$69; }); } } @@ -5098,9 +5231,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$68) { + } catch (e$70) { setTimeout(function () { - throw e$68; + throw e$70; }); } } @@ -5588,6 +5721,7 @@ function replayFunctionComponent( renderLanes ) { prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -7440,113 +7574,65 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$112 in Component) - void 0 === newProps[propName$112] && - (newProps[propName$112] = Component[propName$112]); +} +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -7602,8 +7688,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$113) { - captureCommitPhaseError(current, nearestMountedAncestor, error$113); + } catch (error$115) { + captureCommitPhaseError(current, nearestMountedAncestor, error$115); } else ref.current = null; } @@ -7614,32 +7700,136 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } -var shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - eventsEnabled = _enabled; - root = getActiveElementDeep(); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + eventsEnabled = _enabled; + root = getActiveElementDeep(); + if (hasSelectionCapabilities(root)) { + if ("selectionStart" in root) + var JSCompiler_temp = { + start: root.selectionStart, + end: root.selectionEnd + }; + else + a: { + JSCompiler_temp = + ((JSCompiler_temp = root.ownerDocument) && + JSCompiler_temp.defaultView) || + window; + var selection = + JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); + if (selection && 0 !== selection.rangeCount) { + JSCompiler_temp = selection.anchorNode; + var anchorOffset = selection.anchorOffset, focusNode = selection.focusNode; selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$19) { + } catch (e$20) { JSCompiler_temp = null; break a; } @@ -7695,69 +7885,82 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + if ( + 0 !== (root & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -7767,85 +7970,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - finishedWork = finishedWork.updateQueue; - finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; - if (null !== finishedWork) { - var effect = (finishedWork = finishedWork.next); - do { - if ((effect.tag & flags) === flags) { - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7854,7 +7981,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 11: case 15: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); + flags & 4 && commitHookEffectListMount(5, finishedWork); break; case 1: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7877,11 +8004,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$115) { + } catch (error$114) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$115 + error$114 ); } } @@ -7915,11 +8042,28 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7973,75 +8117,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -8089,8 +8164,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8099,35 +8178,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$123 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$123; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8156,18 +8255,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$123 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$123 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$123 & 4) && ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, @@ -8273,39 +8372,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8323,19 +8418,10 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$127) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$127); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8360,56 +8446,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8417,36 +8502,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8454,16 +8539,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8478,64 +8563,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$128) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$128 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8544,24 +8628,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$129) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$129); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$131) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$131); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8570,12 +8651,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$132) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$132); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8589,8 +8670,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$133) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$133); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -8621,15 +8702,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8637,13 +8718,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -8652,45 +8733,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$117) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$117 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -8740,11 +8820,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -8757,21 +8837,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$118 = JSCompiler_inline_result.stateNode; + var parent$116 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$118, ""), + (setTextContent(parent$116, ""), (JSCompiler_inline_result.flags &= -33)); - var before$119 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$119, parent$118); + var before$117 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$117, parent$116); break; case 3: case 4: - var parent$120 = JSCompiler_inline_result.stateNode.containerInfo, - before$121 = getHostSibling(finishedWork); + var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, + before$119 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$121, - parent$120 + before$119, + parent$118 ); break; default: @@ -8860,7 +8940,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -8868,23 +8948,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8902,7 +8989,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -8911,6 +8998,23 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -8941,13 +9045,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -9003,7 +9100,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -9100,7 +9197,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: break; @@ -9627,12 +9724,12 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -9649,14 +9746,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$136 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$136 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$143 + null === lastTailNode$136 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$143.sibling = null); + : (lastTailNode$136.sibling = null); } } function bubbleProperties(completedWork) { @@ -9666,19 +9763,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$144 = completedWork.child; null !== child$144; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags & 31457280), - (subtreeFlags |= child$144.flags & 31457280), - (child$144.return = completedWork), - (child$144 = child$144.sibling); + for (var child$137 = completedWork.child; null !== child$137; ) + (newChildLanes |= child$137.lanes | child$137.childLanes), + (subtreeFlags |= child$137.subtreeFlags & 31457280), + (subtreeFlags |= child$137.flags & 31457280), + (child$137.return = completedWork), + (child$137 = child$137.sibling); else - for (child$144 = completedWork.child; null !== child$144; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags), - (subtreeFlags |= child$144.flags), - (child$144.return = completedWork), - (child$144 = child$144.sibling); + for (child$137 = completedWork.child; null !== child$137; ) + (newChildLanes |= child$137.lanes | child$137.childLanes), + (subtreeFlags |= child$137.subtreeFlags), + (subtreeFlags |= child$137.flags), + (child$137.return = completedWork), + (child$137 = child$137.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -9955,11 +10052,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$156 = null; + var cache$149 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$156 = newProps.memoizedState.cachePool.pool); - cache$156 !== type && (newProps.flags |= 2048); + (cache$149 = newProps.memoizedState.cachePool.pool); + cache$149 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -9984,8 +10081,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$156 = type.rendering; - if (null === cache$156) + cache$149 = type.rendering; + if (null === cache$149) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -9993,11 +10090,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$156 = findFirstSuspended(current); - if (null !== cache$156) { + cache$149 = findFirstSuspended(current); + if (null !== cache$149) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$156.updateQueue; + current = cache$149.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10022,7 +10119,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$156)), null !== current)) { + if (((current = findFirstSuspended(cache$149)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10032,7 +10129,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$156.alternate && + !cache$149.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10045,13 +10142,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$156.sibling = workInProgress.child), - (workInProgress.child = cache$156)) + ? ((cache$149.sibling = workInProgress.child), + (workInProgress.child = cache$149)) : ((current = type.last), null !== current - ? (current.sibling = cache$156) - : (workInProgress.child = cache$156), - (type.last = cache$156)); + ? (current.sibling = cache$149) + : (workInProgress.child = cache$149), + (type.last = cache$149)); } if (null !== type.tail) return ( @@ -10224,6 +10321,7 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10231,6 +10329,7 @@ var DefaultAsyncDispatcher = { workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -10274,7 +10373,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10285,7 +10385,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10307,7 +10408,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10339,11 +10446,14 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -10355,7 +10465,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10369,6 +10480,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { default: throw Error(formatProdErrorMessage(329)); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && ((didTimeout = globalMostRecentFallbackTime + 300 - now()), @@ -10377,7 +10490,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10389,7 +10503,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10402,7 +10519,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10454,7 +10574,10 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10470,10 +10593,13 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10481,31 +10607,33 @@ function commitRootWhenReady( recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -10521,25 +10649,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : 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 && @@ -10566,13 +10697,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -10583,7 +10719,9 @@ function performSyncWorkOnRoot(root, lanes) { workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -10625,8 +10763,10 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -10643,9 +10783,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; @@ -10715,7 +10855,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -10747,15 +10888,16 @@ function renderRootSync(root, lanes) { null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); break; - } catch (thrownValue$171) { - handleThrow(root, thrownValue$171); + } catch (thrownValue$164) { + handleThrow(root, thrownValue$164); } while (1); lanes && root.shellSuspendCounter++; @@ -10790,7 +10932,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 1); break; case 2: if (isThenableResolved(thrownValue)) { @@ -10820,7 +10962,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 7)); break; case 5: var resource = null; @@ -10847,12 +10989,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 6); break; case 8: resetWorkInProgressStack(); @@ -10864,8 +11006,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$173) { - handleThrow(root, thrownValue$173); + } catch (thrownValue$166) { + handleThrow(root, thrownValue$166); } while (1); resetContextDependencies(); @@ -10957,31 +11099,20 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } unitOfWork = completedWork.return; var next = completeWork( completedWork.alternate, @@ -11001,12 +11132,37 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11019,7 +11175,9 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -11033,7 +11191,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11049,7 +11209,14 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11065,25 +11232,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); - _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), + (_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), @@ -11123,7 +11290,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$177 = rootWithPendingPassiveEffects, + var root$170 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11162,7 +11329,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$177, remainingLanes); + releaseRootPooledCache(root$170, remainingLanes); } } return !1; @@ -11233,6 +11400,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -11245,7 +11413,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -11318,14 +11488,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$179 = firstScheduledRoot; null !== root$179; ) { + for (var root$172 = firstScheduledRoot; null !== root$172; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$179.pendingLanes; + var pendingLanes = root$172.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$179.suspendedLanes, - pingedLanes = root$179.pingedLanes; + var suspendedLanes = root$172.suspendedLanes, + pingedLanes = root$172.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11339,17 +11509,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$179, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$172, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$179, - root$179 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$172, + root$172 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$179, JSCompiler_inline_result)); - root$179 = root$179.next; + performSyncWorkOnRoot(root$172, JSCompiler_inline_result)); + root$172 = root$172.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11390,12 +11560,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; } @@ -11559,20 +11729,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1388 = 0; - i$jscomp$inline_1388 < simpleEventPluginEvents.length; - i$jscomp$inline_1388++ + var i$jscomp$inline_1400 = 0; + i$jscomp$inline_1400 < simpleEventPluginEvents.length; + i$jscomp$inline_1400++ ) { - var eventName$jscomp$inline_1389 = - simpleEventPluginEvents[i$jscomp$inline_1388], - domEventName$jscomp$inline_1390 = - eventName$jscomp$inline_1389.toLowerCase(), - capitalizedEvent$jscomp$inline_1391 = - eventName$jscomp$inline_1389[0].toUpperCase() + - eventName$jscomp$inline_1389.slice(1); + var eventName$jscomp$inline_1401 = + simpleEventPluginEvents[i$jscomp$inline_1400], + domEventName$jscomp$inline_1402 = + eventName$jscomp$inline_1401.toLowerCase(), + capitalizedEvent$jscomp$inline_1403 = + eventName$jscomp$inline_1401[0].toUpperCase() + + eventName$jscomp$inline_1401.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1390, - "on" + capitalizedEvent$jscomp$inline_1391 + domEventName$jscomp$inline_1402, + "on" + capitalizedEvent$jscomp$inline_1403 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -12755,34 +12925,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$193 = props[hasSrc]; - if (null != propValue$193) + var propValue$186 = props[hasSrc]; + if (null != propValue$186) switch (hasSrc) { case "name": - hasSrcSet = propValue$193; + hasSrcSet = propValue$186; break; case "type": - propValue = propValue$193; + propValue = propValue$186; break; case "checked": - checked = propValue$193; + checked = propValue$186; break; case "defaultChecked": - defaultChecked = propValue$193; + defaultChecked = propValue$186; break; case "value": - propKey = propValue$193; + propKey = propValue$186; break; case "defaultValue": - defaultValue = propValue$193; + defaultValue = propValue$186; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$193) + if (null != propValue$186) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$193, props, null); + setProp(domElement, tag, hasSrc, propValue$186, props, null); } } initInput( @@ -12919,14 +13089,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$193 in props) - props.hasOwnProperty(propValue$193) && - ((hasSrc = props[propValue$193]), + for (propValue$186 in props) + props.hasOwnProperty(propValue$186) && + ((hasSrc = props[propValue$186]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$193, + propValue$186, hasSrc, props, void 0 @@ -12974,14 +13144,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$210 in nextProps) { - var propKey = nextProps[propKey$210]; - lastProp = lastProps[propKey$210]; + for (var propKey$203 in nextProps) { + var propKey = nextProps[propKey$203]; + lastProp = lastProps[propKey$203]; if ( - nextProps.hasOwnProperty(propKey$210) && + nextProps.hasOwnProperty(propKey$203) && (null != propKey || null != lastProp) ) - switch (propKey$210) { + switch (propKey$203) { case "type": type = propKey; break; @@ -13010,7 +13180,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$210, + propKey$203, propKey, nextProps, lastProp @@ -13029,7 +13199,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$210 = null; + propKey = value = defaultValue = propKey$203 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13060,7 +13230,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$210 = type; + propKey$203 = type; break; case "defaultValue": defaultValue = type; @@ -13081,15 +13251,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$210 - ? updateOptions(domElement, !!lastProps, propKey$210, !1) + null != propKey$203 + ? updateOptions(domElement, !!lastProps, propKey$203, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$210 = null; + propKey = propKey$203 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13113,7 +13283,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$210 = name; + propKey$203 = name; break; case "defaultValue": propKey = name; @@ -13127,17 +13297,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$210, propKey); + updateTextarea(domElement, propKey$203, propKey); return; case "option": - for (var propKey$226 in lastProps) + for (var propKey$219 in lastProps) if ( - ((propKey$210 = lastProps[propKey$226]), - lastProps.hasOwnProperty(propKey$226) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$226)) + ((propKey$203 = lastProps[propKey$219]), + lastProps.hasOwnProperty(propKey$219) && + null != propKey$203 && + !nextProps.hasOwnProperty(propKey$219)) ) - switch (propKey$226) { + switch (propKey$219) { case "selected": domElement.selected = !1; break; @@ -13145,33 +13315,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$226, + propKey$219, null, nextProps, - propKey$210 + propKey$203 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$210 = nextProps[lastDefaultValue]), + ((propKey$203 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$210 !== propKey && - (null != propKey$210 || null != propKey)) + propKey$203 !== propKey && + (null != propKey$203 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$210 && - "function" !== typeof propKey$210 && - "symbol" !== typeof propKey$210; + propKey$203 && + "function" !== typeof propKey$203 && + "symbol" !== typeof propKey$203; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$210, + propKey$203, nextProps, propKey ); @@ -13192,24 +13362,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$231 in lastProps) - (propKey$210 = lastProps[propKey$231]), - lastProps.hasOwnProperty(propKey$231) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$231) && - setProp(domElement, tag, propKey$231, null, nextProps, propKey$210); + for (var propKey$224 in lastProps) + (propKey$203 = lastProps[propKey$224]), + lastProps.hasOwnProperty(propKey$224) && + null != propKey$203 && + !nextProps.hasOwnProperty(propKey$224) && + setProp(domElement, tag, propKey$224, null, nextProps, propKey$203); for (checked in nextProps) if ( - ((propKey$210 = nextProps[checked]), + ((propKey$203 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$210 !== propKey && - (null != propKey$210 || null != propKey)) + propKey$203 !== propKey && + (null != propKey$203 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$210) + if (null != propKey$203) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13217,7 +13387,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$210, + propKey$203, nextProps, propKey ); @@ -13225,49 +13395,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$236 in lastProps) - (propKey$210 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && - void 0 !== propKey$210 && - !nextProps.hasOwnProperty(propKey$236) && + for (var propKey$229 in lastProps) + (propKey$203 = lastProps[propKey$229]), + lastProps.hasOwnProperty(propKey$229) && + void 0 !== propKey$203 && + !nextProps.hasOwnProperty(propKey$229) && setPropOnCustomElement( domElement, tag, - propKey$236, + propKey$229, void 0, nextProps, - propKey$210 + propKey$203 ); for (defaultChecked in nextProps) - (propKey$210 = nextProps[defaultChecked]), + (propKey$203 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$210 === propKey || - (void 0 === propKey$210 && void 0 === propKey) || + propKey$203 === propKey || + (void 0 === propKey$203 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$210, + propKey$203, nextProps, propKey ); return; } } - for (var propKey$241 in lastProps) - (propKey$210 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$241) && - setProp(domElement, tag, propKey$241, null, nextProps, propKey$210); + for (var propKey$234 in lastProps) + (propKey$203 = lastProps[propKey$234]), + lastProps.hasOwnProperty(propKey$234) && + null != propKey$203 && + !nextProps.hasOwnProperty(propKey$234) && + setProp(domElement, tag, propKey$234, null, nextProps, propKey$203); for (lastProp in nextProps) - (propKey$210 = nextProps[lastProp]), + (propKey$203 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$210 === propKey || - (null == propKey$210 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$210, nextProps, propKey); + propKey$203 === propKey || + (null == propKey$203 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$203, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -13812,26 +13982,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$249 = getResourcesFromRoot( + var styles$242 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$250 = styles$249.get(type); - resource$250 || + resource$243 = styles$242.get(type); + resource$243 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$250 = { + (resource$243 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$249.set(type, resource$250), - (styles$249 = JSCompiler_inline_result.querySelector( + styles$242.set(type, resource$243), + (styles$242 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$249._p && - ((resource$250.instance = styles$249), - (resource$250.state.loading = 5)), + !styles$242._p && + ((resource$243.instance = styles$242), + (resource$243.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -13844,16 +14014,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$249 || + styles$242 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$250.state + resource$243.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$250; + return resource$243; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -13950,37 +14120,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$255 = hoistableRoot.querySelector( + var instance$248 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$255) + if (instance$248) return ( (resource.state.loading |= 4), - (resource.instance = instance$255), - markNodeAsHoistable(instance$255), - instance$255 + (resource.instance = instance$248), + markNodeAsHoistable(instance$248), + instance$248 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$255 = ( + instance$248 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$255); - var linkInstance = instance$255; + markNodeAsHoistable(instance$248); + var linkInstance = instance$248; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$255, "link", instance); + setInitialProperties(instance$248, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$255, props.precedence, hoistableRoot); - return (resource.instance = instance$255); + insertStylesheet(instance$248, props.precedence, hoistableRoot); + return (resource.instance = instance$248); case "script": - instance$255 = getScriptKey(props.src); + instance$248 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$255) + getScriptSelectorFromKey(instance$248) )) ) return ( @@ -13989,7 +14159,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$255))) + if ((styleProps = preloadPropsMap.get(instance$248))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14312,6 +14482,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -15012,16 +15183,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1635 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1647 = React.version; if ( - "19.0.0-experimental-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1635 + "19.0.0-experimental-94e652d5-20240912" !== + isomorphicReactPackageVersion$jscomp$inline_1647 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1635, - "19.0.0-experimental-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1647, + "19.0.0-experimental-94e652d5-20240912" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15041,25 +15212,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2043 = { +var internals$jscomp$inline_2085 = { bundleType: 0, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-94e652d5-20240912" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2044 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2086 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2044.isDisabled && - hook$jscomp$inline_2044.supportsFiber + !hook$jscomp$inline_2086.isDisabled && + hook$jscomp$inline_2086.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2044.inject( - internals$jscomp$inline_2043 + (rendererID = hook$jscomp$inline_2086.inject( + internals$jscomp$inline_2085 )), - (injectedHook = hook$jscomp$inline_2044); + (injectedHook = hook$jscomp$inline_2086); } catch (err) {} } exports.createRoot = function (container, options) { @@ -15151,4 +15322,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; 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 f51edc5ffb27b..d27b1ef6cf05c 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 @@ -1102,28 +1102,40 @@ 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; } @@ -1197,25 +1209,34 @@ for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } - function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index = 31 - clz32(noLongerPendingLanes), + var index = 31 - clz32(remainingLanes), lane = 1 << index; - remainingLanes[index] = 0; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1227,9 +1248,14 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + 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; @@ -4006,6 +4032,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5863,6 +5944,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -5919,10 +6008,16 @@ numberOfReRenders += 1; ignorePreviousDependencies = !1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } hookTypesUpdateIndexDev = -1; ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - var children = callComponentInDEV(Component, props, secondArg); + children = callComponentInDEV(Component, props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -6746,17 +6841,16 @@ function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function mountRef(initialValue) { @@ -7341,60 +7435,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error) { reportGlobalError(error); @@ -8036,8 +8198,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -8077,6 +8239,7 @@ hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -8266,8 +8429,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8703,33 +8866,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2311; - var JSCompiler_object_inline_stack_2310 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2291; + var JSCompiler_object_inline_stack_2290 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2308 = !1; + var JSCompiler_object_inline_message_2288 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2311 = didSuspend) || - (JSCompiler_object_inline_componentStack_2311 = + (JSCompiler_object_inline_componentStack_2291 = didSuspend) || + (JSCompiler_object_inline_componentStack_2291 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2311 && - ((JSCompiler_object_inline_message_2308 = !0), + JSCompiler_object_inline_componentStack_2291 && + ((JSCompiler_object_inline_message_2288 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2311 = + JSCompiler_object_inline_componentStack_2291 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2308 + JSCompiler_object_inline_message_2288 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2309 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2289 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2309)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2289)) { c: { - var instance = JSCompiler_object_inline_digest_2309; + var instance = JSCompiler_object_inline_digest_2289; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8770,19 +8933,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2309 + JSCompiler_object_inline_digest_2289 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2309 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2289 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2309 && - ((JSCompiler_object_inline_digest_2309 = - JSCompiler_object_inline_digest_2309.dehydrated), - null !== JSCompiler_object_inline_digest_2309) + null !== JSCompiler_object_inline_digest_2289 && + ((JSCompiler_object_inline_digest_2289 = + JSCompiler_object_inline_digest_2289.dehydrated), + null !== JSCompiler_object_inline_digest_2289) ) return ( - JSCompiler_object_inline_digest_2309.data === + JSCompiler_object_inline_digest_2289.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8790,68 +8953,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2309 = - JSCompiler_object_inline_stack_2310.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2310.fallback; - if (JSCompiler_object_inline_message_2308) + JSCompiler_object_inline_digest_2289 = + JSCompiler_object_inline_stack_2290.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2290.fallback; + if (JSCompiler_object_inline_message_2288) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2310 = + (JSCompiler_object_inline_stack_2290 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2309, + JSCompiler_object_inline_digest_2289, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2308 = workInProgress.child), - (JSCompiler_object_inline_message_2308.memoizedState = + (JSCompiler_object_inline_message_2288 = workInProgress.child), + (JSCompiler_object_inline_message_2288.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2308.childLanes = + (JSCompiler_object_inline_message_2288.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2291, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2290 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2310.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2290.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2310 = + (JSCompiler_object_inline_stack_2290 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2309, + JSCompiler_object_inline_digest_2289, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2308 = workInProgress.child), - (JSCompiler_object_inline_message_2308.memoizedState = + (JSCompiler_object_inline_message_2288 = workInProgress.child), + (JSCompiler_object_inline_message_2288.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2308.childLanes = + (JSCompiler_object_inline_message_2288.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2291, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2290 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2309 + JSCompiler_object_inline_digest_2289 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2309 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2309) + ((JSCompiler_object_inline_digest_2289 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2289) ) { if (didSuspend) workInProgress.flags & 256 @@ -8868,94 +9031,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2308 = - JSCompiler_object_inline_stack_2310.fallback), - (JSCompiler_object_inline_digest_2309 = workInProgress.mode), - (JSCompiler_object_inline_stack_2310 = + (JSCompiler_object_inline_message_2288 = + JSCompiler_object_inline_stack_2290.fallback), + (JSCompiler_object_inline_digest_2289 = workInProgress.mode), + (JSCompiler_object_inline_stack_2290 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2310.children + children: JSCompiler_object_inline_stack_2290.children }, - JSCompiler_object_inline_digest_2309 + JSCompiler_object_inline_digest_2289 )), - (JSCompiler_object_inline_message_2308 = + (JSCompiler_object_inline_message_2288 = createFiberFromFragment( - JSCompiler_object_inline_message_2308, - JSCompiler_object_inline_digest_2309, + JSCompiler_object_inline_message_2288, + JSCompiler_object_inline_digest_2289, renderLanes, null )), - (JSCompiler_object_inline_message_2308.flags |= 2), - (JSCompiler_object_inline_stack_2310.return = workInProgress), - (JSCompiler_object_inline_message_2308.return = workInProgress), - (JSCompiler_object_inline_stack_2310.sibling = - JSCompiler_object_inline_message_2308), - (workInProgress.child = JSCompiler_object_inline_stack_2310), + (JSCompiler_object_inline_message_2288.flags |= 2), + (JSCompiler_object_inline_stack_2290.return = workInProgress), + (JSCompiler_object_inline_message_2288.return = workInProgress), + (JSCompiler_object_inline_stack_2290.sibling = + JSCompiler_object_inline_message_2288), + (workInProgress.child = JSCompiler_object_inline_stack_2290), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2310 = workInProgress.child), - (JSCompiler_object_inline_stack_2310.memoizedState = + (JSCompiler_object_inline_stack_2290 = workInProgress.child), + (JSCompiler_object_inline_stack_2290.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2310.childLanes = + (JSCompiler_object_inline_stack_2290.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2291, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2308)); + (workInProgress = JSCompiler_object_inline_message_2288)); 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_2309.data === + JSCompiler_object_inline_digest_2289.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2311 = - JSCompiler_object_inline_digest_2309.nextSibling && - JSCompiler_object_inline_digest_2309.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2311) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2311.dgst; - var message = JSCompiler_object_inline_componentStack_2311.msg; - instance = JSCompiler_object_inline_componentStack_2311.stck; + JSCompiler_object_inline_componentStack_2291 = + JSCompiler_object_inline_digest_2289.nextSibling && + JSCompiler_object_inline_digest_2289.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2291) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2291.dgst; + var message = JSCompiler_object_inline_componentStack_2291.msg; + instance = JSCompiler_object_inline_componentStack_2291.stck; var componentStack = - JSCompiler_object_inline_componentStack_2311.cstck; + JSCompiler_object_inline_componentStack_2291.cstck; } - JSCompiler_object_inline_message_2308 = message; - JSCompiler_object_inline_digest_2309 = JSCompiler_temp; - JSCompiler_object_inline_stack_2310 = instance; - JSCompiler_object_inline_componentStack_2311 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2309 && - ((JSCompiler_object_inline_message_2308 = - JSCompiler_object_inline_message_2308 - ? Error(JSCompiler_object_inline_message_2308) + JSCompiler_object_inline_message_2288 = message; + JSCompiler_object_inline_digest_2289 = JSCompiler_temp; + JSCompiler_object_inline_stack_2290 = instance; + JSCompiler_object_inline_componentStack_2291 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2289 && + ((JSCompiler_object_inline_message_2288 = + JSCompiler_object_inline_message_2288 + ? Error(JSCompiler_object_inline_message_2288) : 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_2308.stack = - JSCompiler_object_inline_stack_2310 || ""), - (JSCompiler_object_inline_message_2308.digest = - JSCompiler_object_inline_digest_2309), - (JSCompiler_object_inline_componentStack_2311 = - void 0 === JSCompiler_object_inline_componentStack_2311 + (JSCompiler_object_inline_message_2288.stack = + JSCompiler_object_inline_stack_2290 || ""), + (JSCompiler_object_inline_message_2288.digest = + JSCompiler_object_inline_digest_2289), + (JSCompiler_object_inline_componentStack_2291 = + void 0 === JSCompiler_object_inline_componentStack_2291 ? null - : JSCompiler_object_inline_componentStack_2311), - "string" === typeof JSCompiler_object_inline_componentStack_2311 && + : JSCompiler_object_inline_componentStack_2291), + "string" === typeof JSCompiler_object_inline_componentStack_2291 && CapturedStacks.set( - JSCompiler_object_inline_message_2308, - JSCompiler_object_inline_componentStack_2311 + JSCompiler_object_inline_message_2288, + JSCompiler_object_inline_componentStack_2291 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2308, + value: JSCompiler_object_inline_message_2288, source: null, - stack: JSCompiler_object_inline_componentStack_2311 + stack: JSCompiler_object_inline_componentStack_2291 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8970,25 +9133,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2311 = + (JSCompiler_object_inline_componentStack_2291 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2311) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2291) ) { - JSCompiler_object_inline_componentStack_2311 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2311) { - JSCompiler_object_inline_stack_2310 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2310 & 42)) - JSCompiler_object_inline_stack_2310 = 1; + JSCompiler_object_inline_componentStack_2291 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2291) { + JSCompiler_object_inline_stack_2290 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2290 & 42)) + JSCompiler_object_inline_stack_2290 = 1; else - switch (JSCompiler_object_inline_stack_2310) { + switch (JSCompiler_object_inline_stack_2290) { case 2: - JSCompiler_object_inline_stack_2310 = 1; + JSCompiler_object_inline_stack_2290 = 1; break; case 8: - JSCompiler_object_inline_stack_2310 = 4; + JSCompiler_object_inline_stack_2290 = 4; break; case 32: - JSCompiler_object_inline_stack_2310 = 16; + JSCompiler_object_inline_stack_2290 = 16; break; case 128: case 256: @@ -9009,40 +9172,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2310 = 64; + JSCompiler_object_inline_stack_2290 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2310 = 134217728; + JSCompiler_object_inline_stack_2290 = 134217728; break; default: - JSCompiler_object_inline_stack_2310 = 0; + JSCompiler_object_inline_stack_2290 = 0; } - JSCompiler_object_inline_stack_2310 = + JSCompiler_object_inline_stack_2290 = 0 !== - (JSCompiler_object_inline_stack_2310 & - (JSCompiler_object_inline_componentStack_2311.suspendedLanes | + (JSCompiler_object_inline_stack_2290 & + (JSCompiler_object_inline_componentStack_2291.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2310; + : JSCompiler_object_inline_stack_2290; if ( - 0 !== JSCompiler_object_inline_stack_2310 && - JSCompiler_object_inline_stack_2310 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2290 && + JSCompiler_object_inline_stack_2290 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2310), + ((prevState.retryLane = JSCompiler_object_inline_stack_2290), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2290 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2291, current, - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2290 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2309.data === + JSCompiler_object_inline_digest_2289.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9050,7 +9213,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2309.data === + JSCompiler_object_inline_digest_2289.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9058,12 +9221,12 @@ null, current )), - (JSCompiler_object_inline_digest_2309._reactRetry = + (JSCompiler_object_inline_digest_2289._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2309.nextSibling + JSCompiler_object_inline_digest_2289.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9081,54 +9244,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2310.children + JSCompiler_object_inline_stack_2290.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2308) + if (JSCompiler_object_inline_message_2288) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2308 = - JSCompiler_object_inline_stack_2310.fallback), - (JSCompiler_object_inline_digest_2309 = workInProgress.mode), + (JSCompiler_object_inline_message_2288 = + JSCompiler_object_inline_stack_2290.fallback), + (JSCompiler_object_inline_digest_2289 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2310 = createWorkInProgress( + (JSCompiler_object_inline_stack_2290 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2310.children + children: JSCompiler_object_inline_stack_2290.children } )), - (JSCompiler_object_inline_stack_2310.subtreeFlags = + (JSCompiler_object_inline_stack_2290.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2308 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2288 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2308 + JSCompiler_object_inline_message_2288 )) - : ((JSCompiler_object_inline_message_2308 = createFiberFromFragment( - JSCompiler_object_inline_message_2308, - JSCompiler_object_inline_digest_2309, + : ((JSCompiler_object_inline_message_2288 = createFiberFromFragment( + JSCompiler_object_inline_message_2288, + JSCompiler_object_inline_digest_2289, renderLanes, null )), - (JSCompiler_object_inline_message_2308.flags |= 2)), - (JSCompiler_object_inline_message_2308.return = workInProgress), - (JSCompiler_object_inline_stack_2310.return = workInProgress), - (JSCompiler_object_inline_stack_2310.sibling = - JSCompiler_object_inline_message_2308), - (workInProgress.child = JSCompiler_object_inline_stack_2310), - (JSCompiler_object_inline_stack_2310 = - JSCompiler_object_inline_message_2308), - (JSCompiler_object_inline_message_2308 = workInProgress.child), - (JSCompiler_object_inline_digest_2309 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2309 - ? (JSCompiler_object_inline_digest_2309 = + (JSCompiler_object_inline_message_2288.flags |= 2)), + (JSCompiler_object_inline_message_2288.return = workInProgress), + (JSCompiler_object_inline_stack_2290.return = workInProgress), + (JSCompiler_object_inline_stack_2290.sibling = + JSCompiler_object_inline_message_2288), + (workInProgress.child = JSCompiler_object_inline_stack_2290), + (JSCompiler_object_inline_stack_2290 = + JSCompiler_object_inline_message_2288), + (JSCompiler_object_inline_message_2288 = workInProgress.child), + (JSCompiler_object_inline_digest_2289 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2289 + ? (JSCompiler_object_inline_digest_2289 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2309.cachePool), + JSCompiler_object_inline_digest_2289.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9136,38 +9299,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2309 = { + (JSCompiler_object_inline_digest_2289 = { baseLanes: - JSCompiler_object_inline_digest_2309.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2289.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2308.memoizedState = - JSCompiler_object_inline_digest_2309), - (JSCompiler_object_inline_message_2308.childLanes = + (JSCompiler_object_inline_message_2288.memoizedState = + JSCompiler_object_inline_digest_2289), + (JSCompiler_object_inline_message_2288.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2291, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2290 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2310.children + children: JSCompiler_object_inline_stack_2290.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2311 = + ((JSCompiler_object_inline_componentStack_2291 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2311 + null === JSCompiler_object_inline_componentStack_2291 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2311.push(current)); + : JSCompiler_object_inline_componentStack_2291.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10452,7 +10615,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -10741,6 +10908,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10751,128 +10928,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$2)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10880,101 +11471,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -11057,342 +11553,89 @@ (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (current = 0; current < finishedWork.length; current++) - (flags = finishedWork[current]), - (flags.ref.impl = flags.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.updateQueue), + (root = null !== root ? root.events : null), + null !== root) ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11408,17 +11651,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11432,21 +11685,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11454,11 +11711,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11474,59 +11727,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11534,11 +11792,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11548,11 +11802,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11575,78 +11825,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$2)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11726,14 +11904,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11779,7 +11980,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11789,14 +11992,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11864,7 +12071,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11913,74 +12124,53 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + function commitMutationEffectsOnFiber(finishedWork, root) { var current = finishedWork.alternate, flags = finishedWork.flags; switch (finishedWork.tag) { @@ -11988,53 +12178,31 @@ case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, finishedWork, - finishedWork.return, - error$10 - ); - } - } + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12051,116 +12219,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -12169,9 +12339,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -12186,117 +12356,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -12305,23 +12443,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -12329,7 +12470,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -12338,13 +12479,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -12354,12 +12495,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12375,15 +12516,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12391,13 +12532,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12406,47 +12547,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12477,7 +12617,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12488,7 +12628,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12496,52 +12636,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12561,27 +12656,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12664,24 +12745,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12698,7 +12783,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12707,9 +12792,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12746,9 +12855,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12756,22 +12863,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12802,9 +12893,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12851,9 +12940,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12862,18 +12951,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12917,9 +13004,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12952,9 +13037,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12964,11 +13049,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -13006,62 +13089,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -13122,25 +13188,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -13157,11 +13204,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -13205,7 +13248,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -13235,22 +13278,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -13260,32 +13318,7 @@ break a; } nextEffect = returnFiber; - } - } - } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); + } } } function FiberNode(tag, pendingProps, key, mode) { @@ -13367,7 +13400,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13420,7 +13454,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13651,12 +13686,12 @@ ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14453,7 +14488,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14495,7 +14531,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14520,7 +14557,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14552,11 +14594,14 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -14568,7 +14613,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14582,13 +14628,17 @@ default: throw Error("Unknown root exit status."); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( renderWasConcurrent, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); else { if ( @@ -14602,7 +14652,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14614,7 +14665,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14627,7 +14681,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14682,7 +14739,10 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14702,10 +14762,13 @@ root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14713,31 +14776,33 @@ recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -14753,26 +14818,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (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 && @@ -14802,13 +14872,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -14819,7 +14894,9 @@ workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -14861,9 +14938,11 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -14986,7 +15065,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -15034,15 +15114,21 @@ null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -15098,7 +15184,12 @@ case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -15130,7 +15221,12 @@ replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -15162,12 +15258,22 @@ } workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); break; case SuspendedOnDeprecatedThrowPromise: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); break; case SuspendedOnHydration: resetWorkInProgressStack(); @@ -15182,8 +15288,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -15308,43 +15414,20 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -15378,12 +15461,46 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15396,7 +15513,9 @@ transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -15410,7 +15529,9 @@ transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15439,7 +15560,14 @@ root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -15455,34 +15583,34 @@ return null; })); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitBeforeMutationEffects(root, finishedWork); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - ReactDOMSharedInternals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = ReactDOMSharedInternals.p), + (ReactDOMSharedInternals.p = DiscreteEventPriority), + (updatedLanes = executionContext), + (executionContext |= CommitContext), + commitBeforeMutationEffects(root, finishedWork), + (commitTime = now()), + commitMutationEffects(root, finishedWork, lanes), + restoreSelection(selectionInformation), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (ReactDOMSharedInternals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : ((root.current = finishedWork), (commitTime = now())); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -15581,55 +15709,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15775,6 +15888,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -15794,7 +15908,9 @@ now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -19233,6 +19349,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -19256,6 +19404,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19456,6 +19625,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function resolveSingletonInstance( type, props, @@ -19494,6 +19669,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -20210,6 +20416,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -22299,6 +22506,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23881,84 +24095,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -24026,6 +24170,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -24045,7 +24252,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -24096,6 +24303,7 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -24103,6 +24311,7 @@ workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -24672,11 +24881,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== 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-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24713,11 +24922,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-94e652d5-20240912" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25191,7 +25400,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; "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 54ef1f04a431f..f6d6fb446a804 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 @@ -678,28 +678,40 @@ 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; } @@ -765,39 +777,53 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[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); } - noLongerPendingLanes &= ~lane; + 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; @@ -812,19 +838,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; } } @@ -836,16 +862,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; } } @@ -995,8 +1021,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; } @@ -1329,15 +1355,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; @@ -2066,19 +2092,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$311; + var JSCompiler_inline_result$jscomp$299; if (canUseDOM) { - var isSupported$jscomp$inline_447 = "oninput" in document; - if (!isSupported$jscomp$inline_447) { - var element$jscomp$inline_448 = document.createElement("div"); - element$jscomp$inline_448.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_447 = - "function" === typeof element$jscomp$inline_448.oninput; + var isSupported$jscomp$inline_435 = "oninput" in document; + if (!isSupported$jscomp$inline_435) { + var element$jscomp$inline_436 = document.createElement("div"); + element$jscomp$inline_436.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_435 = + "function" === typeof element$jscomp$inline_436.oninput; } - JSCompiler_inline_result$jscomp$311 = isSupported$jscomp$inline_447; - } else JSCompiler_inline_result$jscomp$311 = !1; + JSCompiler_inline_result$jscomp$299 = isSupported$jscomp$inline_435; + } else JSCompiler_inline_result$jscomp$299 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$311 && + JSCompiler_inline_result$jscomp$299 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2494,7 +2520,69 @@ function getRootForUpdatedFiber(sourceFiber) { return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; } var emptyContextObject = {}, - CapturedStacks = new WeakMap(); + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1; +function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); +} +function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } +} +function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } +} +function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } +} +function startLayoutEffectTimer() { + layoutEffectStartTime = now(); +} +function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); +} +var CapturedStacks = new WeakMap(); function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -3827,9 +3915,15 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); numberOfReRenders += 1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } ReactSharedInternals.H = HooksDispatcherOnRerender; - var children = Component(props, secondArg); + children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -4012,7 +4106,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$56 = !1; + didReadFromEntangledAsyncAction$59 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -4033,11 +4127,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$56 = !0); + (didReadFromEntangledAsyncAction$59 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$56 = !0); + (didReadFromEntangledAsyncAction$59 = !0); continue; } else (updateLane = { @@ -4083,7 +4177,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$56 && + didReadFromEntangledAsyncAction$59 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4281,8 +4375,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$62) { - onActionError(actionQueue, node, error$62); + } catch (error$65) { + onActionError(actionQueue, node, error$65); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4473,17 +4567,16 @@ function rerenderActionState(action) { function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function updateRef() { @@ -4720,14 +4813,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$65 = enqueueUpdate(provider, fiber, lane); - null !== root$65 && - (scheduleUpdateOnFiber(root$65, provider, lane), - entangleTransitions(root$65, provider, lane)); + var root$68 = enqueueUpdate(provider, fiber, lane); + null !== root$68 && + (scheduleUpdateOnFiber(root$68, provider, lane), + entangleTransitions(root$68, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$65 && + null !== root$68 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5157,67 +5250,112 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; -var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1; -function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && + injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; - } - } +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - } - fiber = fiber.return; - } +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } -} -function startLayoutEffectTimer() { - layoutEffectStartTime = now(); -} -function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$72 in Component) + void 0 === newProps[propName$72] && + (newProps[propName$72] = Component[propName$72]); + } + return newProps; } var reportGlobalError = "function" === typeof reportError @@ -5261,9 +5399,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$71) { + } catch (e$73) { setTimeout(function () { - throw e$71; + throw e$73; }); } } @@ -5274,9 +5412,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$72) { + } catch (e$74) { setTimeout(function () { - throw e$72; + throw e$74; }); } } @@ -5770,6 +5908,7 @@ function replayFunctionComponent( ) { prepareToReadContext(workInProgress); markComponentRenderStarted(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -7638,122 +7777,139 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +function shouldProfile$1(current) { + return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); } -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && - injectedProfilingHooks.markForceUpdateScheduled(inst, lane); +function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ); + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : 0 !== (flags & 4) && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext +} +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + markComponentLayoutEffectUnmountStarted(finishedWork), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : 0 !== (flags & 4) && markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$117 in Component) - void 0 === newProps[propName$117] && - (newProps[propName$117] = Component[propName$117]); +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; -} -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - inProgressLanes = null, - inProgressRoot = null; -function shouldProfile(current) { - return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); } function safelyCallComponentWillUnmount( current, @@ -7765,7 +7921,7 @@ function safelyCallComponentWillUnmount( current.memoizedProps ); instance.state = current.memoizedState; - if (shouldProfile(current)) { + if (shouldProfile$1(current)) { startLayoutEffectTimer(); try { instance.componentWillUnmount(); @@ -7776,8 +7932,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$118) { - captureCommitPhaseError(current, nearestMountedAncestor, error$118); + } catch (error$122) { + captureCommitPhaseError(current, nearestMountedAncestor, error$122); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -7795,7 +7951,7 @@ function safelyAttachRef(current, nearestMountedAncestor) { instanceToUse = instance; } if ("function" === typeof ref) - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), (current.refCleanup = ref(instanceToUse)); } finally { @@ -7814,7 +7970,7 @@ function safelyDetachRef(current, nearestMountedAncestor) { if (null !== ref) if ("function" === typeof refCleanup) try { - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), refCleanup(); } finally { @@ -7830,15 +7986,15 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else if ("function" === typeof ref) try { - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), ref(null); } finally { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$119) { - captureCommitPhaseError(current, nearestMountedAncestor, error$119); + } catch (error$123) { + captureCommitPhaseError(current, nearestMountedAncestor, error$123); } else ref.current = null; } @@ -7849,6 +8005,148 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } +function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration +) { + if (executionContext & 4) + try { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit, + onRender = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onRender && + onRender( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$2)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + inProgressLanes = null, + inProgressRoot = null; +function shouldProfile(current) { + return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); +} var shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; @@ -7874,7 +8172,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; } @@ -7930,69 +8228,82 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + if ( + 0 !== (root & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -8002,176 +8313,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - markComponentLayoutEffectUnmountStarted(finishedWork), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : 0 !== (flags & 4) && markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : 0 !== (flags & 4) && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$123) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$123); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitProfilerUpdate(finishedWork, current) { - if (executionContext & 4) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { - case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - } - parentFiber = parentFiber.return; - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -8186,7 +8330,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) - if (shouldProfile(finishedWork)) { + if (shouldProfile$1(finishedWork)) { startLayoutEffectTimer(); try { finishedRoot.componentDidMount(); @@ -8197,11 +8341,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$124) { + } catch (error$119) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$124 + error$119 ); } else { @@ -8210,7 +8354,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current.memoizedProps ); current = current.memoizedState; - if (shouldProfile(finishedWork)) { + if (shouldProfile$1(finishedWork)) { startLayoutEffectTimer(); try { finishedRoot.componentDidUpdate( @@ -8218,11 +8362,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$125) { + } catch (error$120) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$125 + error$120 ); } recordLayoutEffectDuration(finishedWork); @@ -8233,11 +8377,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$126) { + } catch (error$121) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$126 + error$121 ); } } @@ -8271,12 +8415,30 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitProfilerUpdate(finishedWork, current); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8302,102 +8464,33 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } - flags & 512 && - ("manual" === finishedWork.memoizedProps.mode - ? safelyAttachRef(finishedWork, finishedWork.return) - : safelyDetachRef(finishedWork, finishedWork.return)); - break; - default: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - } -} -function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - 5 === fiber.tag && - ((alternate = fiber.stateNode), - null !== alternate && detachDeletedInstance(alternate)); - fiber.stateNode = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; -} -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$2)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); + flags & 512 && + ("manual" === finishedWork.memoizedProps.mode + ? safelyAttachRef(finishedWork, finishedWork.return) + : safelyDetachRef(finishedWork, finishedWork.return)); + break; + default: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + } } -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + 5 === fiber.tag && + ((alternate = fiber.stateNode), + null !== alternate && detachDeletedInstance(alternate)); + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; } var hostParent = null, hostParentIsContainer = !1; @@ -8446,8 +8539,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8456,35 +8553,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$133 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$133; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8513,18 +8630,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$133 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$133 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$133 & 4) && (markComponentLayoutEffectUnmountStarted(deletedFiber), shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), @@ -8653,39 +8770,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8703,36 +8816,14 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$140) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$140 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$141) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$141 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8757,56 +8848,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8814,36 +8904,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8851,16 +8941,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8875,64 +8965,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$142) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$142 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8941,24 +9030,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$143) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$143); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$145) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$145); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8967,12 +9053,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$146) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$146); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8986,8 +9072,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$147) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$147); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9018,15 +9104,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -9034,13 +9120,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -9049,45 +9135,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$130) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$130 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -9137,11 +9222,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -9154,21 +9239,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$131 = JSCompiler_inline_result.stateNode; + var parent$124 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$131, ""), + (setTextContent(parent$124, ""), (JSCompiler_inline_result.flags &= -33)); - var before$132 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$132, parent$131); + var before$125 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$125, parent$124); break; case 3: case 4: - var parent$133 = JSCompiler_inline_result.stateNode.containerInfo, - before$134 = getHostSibling(finishedWork); + var parent$126 = JSCompiler_inline_result.stateNode.containerInfo, + before$127 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$134, - parent$133 + before$127, + parent$126 ); break; default: @@ -9278,23 +9363,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9312,7 +9404,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -9321,9 +9413,25 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -9354,22 +9462,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$152) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$152); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -9667,25 +9759,6 @@ function detachAlternateSiblings(parentFiber) { while (null !== parentFiber); } } -function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags -) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); -} function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -10080,12 +10153,12 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -10102,14 +10175,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$158 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$158 = lastTailNode), + for (var lastTailNode$146 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$146 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$158 + null === lastTailNode$146 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$158.sibling = null); + : (lastTailNode$146.sibling = null); } } function bubbleProperties(completedWork) { @@ -10121,53 +10194,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$160 = completedWork.selfBaseDuration, - child$161 = completedWork.child; - null !== child$161; + var treeBaseDuration$148 = completedWork.selfBaseDuration, + child$149 = completedWork.child; + null !== child$149; ) - (newChildLanes |= child$161.lanes | child$161.childLanes), - (subtreeFlags |= child$161.subtreeFlags & 31457280), - (subtreeFlags |= child$161.flags & 31457280), - (treeBaseDuration$160 += child$161.treeBaseDuration), - (child$161 = child$161.sibling); - completedWork.treeBaseDuration = treeBaseDuration$160; + (newChildLanes |= child$149.lanes | child$149.childLanes), + (subtreeFlags |= child$149.subtreeFlags & 31457280), + (subtreeFlags |= child$149.flags & 31457280), + (treeBaseDuration$148 += child$149.treeBaseDuration), + (child$149 = child$149.sibling); + completedWork.treeBaseDuration = treeBaseDuration$148; } else for ( - treeBaseDuration$160 = completedWork.child; - null !== treeBaseDuration$160; + treeBaseDuration$148 = completedWork.child; + null !== treeBaseDuration$148; ) (newChildLanes |= - treeBaseDuration$160.lanes | treeBaseDuration$160.childLanes), - (subtreeFlags |= treeBaseDuration$160.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$160.flags & 31457280), - (treeBaseDuration$160.return = completedWork), - (treeBaseDuration$160 = treeBaseDuration$160.sibling); + treeBaseDuration$148.lanes | treeBaseDuration$148.childLanes), + (subtreeFlags |= treeBaseDuration$148.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$148.flags & 31457280), + (treeBaseDuration$148.return = completedWork), + (treeBaseDuration$148 = treeBaseDuration$148.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$160 = completedWork.actualDuration; - child$161 = completedWork.selfBaseDuration; + treeBaseDuration$148 = completedWork.actualDuration; + child$149 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$160 += child.actualDuration), - (child$161 += child.treeBaseDuration), + (treeBaseDuration$148 += child.actualDuration), + (child$149 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$160; - completedWork.treeBaseDuration = child$161; + completedWork.actualDuration = treeBaseDuration$148; + completedWork.treeBaseDuration = child$149; } else for ( - treeBaseDuration$160 = completedWork.child; - null !== treeBaseDuration$160; + treeBaseDuration$148 = completedWork.child; + null !== treeBaseDuration$148; ) (newChildLanes |= - treeBaseDuration$160.lanes | treeBaseDuration$160.childLanes), - (subtreeFlags |= treeBaseDuration$160.subtreeFlags), - (subtreeFlags |= treeBaseDuration$160.flags), - (treeBaseDuration$160.return = completedWork), - (treeBaseDuration$160 = treeBaseDuration$160.sibling); + treeBaseDuration$148.lanes | treeBaseDuration$148.childLanes), + (subtreeFlags |= treeBaseDuration$148.subtreeFlags), + (subtreeFlags |= treeBaseDuration$148.flags), + (treeBaseDuration$148.return = completedWork), + (treeBaseDuration$148 = treeBaseDuration$148.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10460,11 +10533,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$176 = null; + var cache$164 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$176 = newProps.memoizedState.cachePool.pool); - cache$176 !== type && (newProps.flags |= 2048); + (cache$164 = newProps.memoizedState.cachePool.pool); + cache$164 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10494,8 +10567,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$176 = type.rendering; - if (null === cache$176) + cache$164 = type.rendering; + if (null === cache$164) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10503,11 +10576,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$176 = findFirstSuspended(current); - if (null !== cache$176) { + cache$164 = findFirstSuspended(current); + if (null !== cache$164) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$176.updateQueue; + current = cache$164.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10532,7 +10605,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$176)), null !== current)) { + if (((current = findFirstSuspended(cache$164)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10542,7 +10615,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$176.alternate && + !cache$164.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10555,13 +10628,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$176.sibling = workInProgress.child), - (workInProgress.child = cache$176)) + ? ((cache$164.sibling = workInProgress.child), + (workInProgress.child = cache$164)) : ((current = type.last), null !== current - ? (current.sibling = cache$176) - : (workInProgress.child = cache$176), - (type.last = cache$176)); + ? (current.sibling = cache$164) + : (workInProgress.child = cache$164), + (type.last = cache$164)); } if (null !== type.tail) return ( @@ -10743,6 +10816,7 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10750,6 +10824,7 @@ var DefaultAsyncDispatcher = { workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -10794,7 +10869,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10806,7 +10882,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10829,7 +10906,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10861,11 +10944,14 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -10877,7 +10963,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10891,6 +10978,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { default: throw Error(formatProdErrorMessage(329)); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && ((didTimeout = globalMostRecentFallbackTime + 300 - now$1()), @@ -10899,7 +10988,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10911,7 +11001,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10924,7 +11017,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10976,7 +11072,10 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10992,10 +11091,13 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -11003,31 +11105,33 @@ function commitRootWhenReady( recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -11043,25 +11147,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : 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 && @@ -11090,13 +11197,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -11107,7 +11219,9 @@ function performSyncWorkOnRoot(root, lanes) { workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -11149,8 +11263,10 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -11167,9 +11283,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; @@ -11268,7 +11384,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -11310,15 +11427,16 @@ function renderRootSync(root, lanes) { null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue, reason); } } workLoopSync(); break; - } catch (thrownValue$191) { - handleThrow(root, thrownValue$191); + } catch (thrownValue$179) { + handleThrow(root, thrownValue$179); } while (1); lanes && root.shellSuspendCounter++; @@ -11365,7 +11483,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 1); break; case 2: if (isThenableResolved(memoizedUpdaters)) { @@ -11395,7 +11513,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 7)); break; case 5: var resource = null; @@ -11422,12 +11540,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 6); break; case 8: resetWorkInProgressStack(); @@ -11438,8 +11556,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$193) { - handleThrow(root, thrownValue$193); + } catch (thrownValue$181) { + handleThrow(root, thrownValue$181); } while (1); resetContextDependencies(); @@ -11549,39 +11667,20 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if (0 !== (root.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; 0 === (completedWork.mode & 2) @@ -11602,12 +11701,44 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if (0 !== (unitOfWork.mode & 2)) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11620,7 +11751,9 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -11634,7 +11767,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11653,7 +11788,14 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11669,32 +11811,32 @@ 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); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - ReactDOMSharedInternals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = ReactDOMSharedInternals.p), + (ReactDOMSharedInternals.p = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + commitBeforeMutationEffects(root, finishedWork), + (commitTime = now()), + commitMutationEffects(root, finishedWork, lanes), + restoreSelection(selectionInformation), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (ReactDOMSharedInternals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : ((root.current = finishedWork), (commitTime = now())); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11737,7 +11879,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$197 = rootWithPendingPassiveEffects, + var root$185 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11782,7 +11924,7 @@ function flushPassiveEffects() { _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit, - commitTime$121 = commitTime, + commitTime$129 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && @@ -11790,7 +11932,7 @@ function flushPassiveEffects() { id, phase, passiveEffectDuration, - commitTime$121 + commitTime$129 ); var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { @@ -11830,7 +11972,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$197, remainingLanes); + releaseRootPooledCache(root$185, remainingLanes); } } return !1; @@ -11911,6 +12053,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -11923,7 +12066,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now$1() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -12002,14 +12147,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$199 = firstScheduledRoot; null !== root$199; ) { + for (var root$187 = firstScheduledRoot; null !== root$187; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$199.pendingLanes; + var pendingLanes = root$187.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$199.suspendedLanes, - pingedLanes = root$199.pingedLanes; + var suspendedLanes = root$187.suspendedLanes, + pingedLanes = root$187.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -12023,17 +12168,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$199, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$187, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$199, - root$199 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$187, + root$187 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$199, JSCompiler_inline_result)); - root$199 = root$199.next; + performSyncWorkOnRoot(root$187, JSCompiler_inline_result)); + root$187 = root$187.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -12074,12 +12219,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; } @@ -12243,20 +12388,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1475 = 0; - i$jscomp$inline_1475 < simpleEventPluginEvents.length; - i$jscomp$inline_1475++ + var i$jscomp$inline_1489 = 0; + i$jscomp$inline_1489 < simpleEventPluginEvents.length; + i$jscomp$inline_1489++ ) { - var eventName$jscomp$inline_1476 = - simpleEventPluginEvents[i$jscomp$inline_1475], - domEventName$jscomp$inline_1477 = - eventName$jscomp$inline_1476.toLowerCase(), - capitalizedEvent$jscomp$inline_1478 = - eventName$jscomp$inline_1476[0].toUpperCase() + - eventName$jscomp$inline_1476.slice(1); + var eventName$jscomp$inline_1490 = + simpleEventPluginEvents[i$jscomp$inline_1489], + domEventName$jscomp$inline_1491 = + eventName$jscomp$inline_1490.toLowerCase(), + capitalizedEvent$jscomp$inline_1492 = + eventName$jscomp$inline_1490[0].toUpperCase() + + eventName$jscomp$inline_1490.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1477, - "on" + capitalizedEvent$jscomp$inline_1478 + domEventName$jscomp$inline_1491, + "on" + capitalizedEvent$jscomp$inline_1492 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13439,34 +13584,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$213 = props[hasSrc]; - if (null != propValue$213) + var propValue$201 = props[hasSrc]; + if (null != propValue$201) switch (hasSrc) { case "name": - hasSrcSet = propValue$213; + hasSrcSet = propValue$201; break; case "type": - propValue = propValue$213; + propValue = propValue$201; break; case "checked": - checked = propValue$213; + checked = propValue$201; break; case "defaultChecked": - defaultChecked = propValue$213; + defaultChecked = propValue$201; break; case "value": - propKey = propValue$213; + propKey = propValue$201; break; case "defaultValue": - defaultValue = propValue$213; + defaultValue = propValue$201; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$213) + if (null != propValue$201) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$213, props, null); + setProp(domElement, tag, hasSrc, propValue$201, props, null); } } initInput( @@ -13603,14 +13748,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$213 in props) - props.hasOwnProperty(propValue$213) && - ((hasSrc = props[propValue$213]), + for (propValue$201 in props) + props.hasOwnProperty(propValue$201) && + ((hasSrc = props[propValue$201]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$213, + propValue$201, hasSrc, props, void 0 @@ -13658,14 +13803,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$230 in nextProps) { - var propKey = nextProps[propKey$230]; - lastProp = lastProps[propKey$230]; + for (var propKey$218 in nextProps) { + var propKey = nextProps[propKey$218]; + lastProp = lastProps[propKey$218]; if ( - nextProps.hasOwnProperty(propKey$230) && + nextProps.hasOwnProperty(propKey$218) && (null != propKey || null != lastProp) ) - switch (propKey$230) { + switch (propKey$218) { case "type": type = propKey; break; @@ -13694,7 +13839,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$230, + propKey$218, propKey, nextProps, lastProp @@ -13713,7 +13858,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$230 = null; + propKey = value = defaultValue = propKey$218 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13744,7 +13889,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$230 = type; + propKey$218 = type; break; case "defaultValue": defaultValue = type; @@ -13765,15 +13910,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$230 - ? updateOptions(domElement, !!lastProps, propKey$230, !1) + null != propKey$218 + ? updateOptions(domElement, !!lastProps, propKey$218, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$230 = null; + propKey = propKey$218 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13797,7 +13942,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$230 = name; + propKey$218 = name; break; case "defaultValue": propKey = name; @@ -13811,17 +13956,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$230, propKey); + updateTextarea(domElement, propKey$218, propKey); return; case "option": - for (var propKey$246 in lastProps) + for (var propKey$234 in lastProps) if ( - ((propKey$230 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$246)) + ((propKey$218 = lastProps[propKey$234]), + lastProps.hasOwnProperty(propKey$234) && + null != propKey$218 && + !nextProps.hasOwnProperty(propKey$234)) ) - switch (propKey$246) { + switch (propKey$234) { case "selected": domElement.selected = !1; break; @@ -13829,33 +13974,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$246, + propKey$234, null, nextProps, - propKey$230 + propKey$218 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$230 = nextProps[lastDefaultValue]), + ((propKey$218 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$230 !== propKey && - (null != propKey$230 || null != propKey)) + propKey$218 !== propKey && + (null != propKey$218 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$230 && - "function" !== typeof propKey$230 && - "symbol" !== typeof propKey$230; + propKey$218 && + "function" !== typeof propKey$218 && + "symbol" !== typeof propKey$218; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$230, + propKey$218, nextProps, propKey ); @@ -13876,24 +14021,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$251 in lastProps) - (propKey$230 = lastProps[propKey$251]), - lastProps.hasOwnProperty(propKey$251) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$251) && - setProp(domElement, tag, propKey$251, null, nextProps, propKey$230); + for (var propKey$239 in lastProps) + (propKey$218 = lastProps[propKey$239]), + lastProps.hasOwnProperty(propKey$239) && + null != propKey$218 && + !nextProps.hasOwnProperty(propKey$239) && + setProp(domElement, tag, propKey$239, null, nextProps, propKey$218); for (checked in nextProps) if ( - ((propKey$230 = nextProps[checked]), + ((propKey$218 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$230 !== propKey && - (null != propKey$230 || null != propKey)) + propKey$218 !== propKey && + (null != propKey$218 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$230) + if (null != propKey$218) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13901,7 +14046,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$230, + propKey$218, nextProps, propKey ); @@ -13909,49 +14054,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$256 in lastProps) - (propKey$230 = lastProps[propKey$256]), - lastProps.hasOwnProperty(propKey$256) && - void 0 !== propKey$230 && - !nextProps.hasOwnProperty(propKey$256) && + for (var propKey$244 in lastProps) + (propKey$218 = lastProps[propKey$244]), + lastProps.hasOwnProperty(propKey$244) && + void 0 !== propKey$218 && + !nextProps.hasOwnProperty(propKey$244) && setPropOnCustomElement( domElement, tag, - propKey$256, + propKey$244, void 0, nextProps, - propKey$230 + propKey$218 ); for (defaultChecked in nextProps) - (propKey$230 = nextProps[defaultChecked]), + (propKey$218 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$230 === propKey || - (void 0 === propKey$230 && void 0 === propKey) || + propKey$218 === propKey || + (void 0 === propKey$218 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$230, + propKey$218, nextProps, propKey ); return; } } - for (var propKey$261 in lastProps) - (propKey$230 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$261) && - setProp(domElement, tag, propKey$261, null, nextProps, propKey$230); + for (var propKey$249 in lastProps) + (propKey$218 = lastProps[propKey$249]), + lastProps.hasOwnProperty(propKey$249) && + null != propKey$218 && + !nextProps.hasOwnProperty(propKey$249) && + setProp(domElement, tag, propKey$249, null, nextProps, propKey$218); for (lastProp in nextProps) - (propKey$230 = nextProps[lastProp]), + (propKey$218 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$230 === propKey || - (null == propKey$230 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$230, nextProps, propKey); + propKey$218 === propKey || + (null == propKey$218 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$218, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14496,26 +14641,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$269 = getResourcesFromRoot( + var styles$257 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$270 = styles$269.get(type); - resource$270 || + resource$258 = styles$257.get(type); + resource$258 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$270 = { + (resource$258 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$269.set(type, resource$270), - (styles$269 = JSCompiler_inline_result.querySelector( + styles$257.set(type, resource$258), + (styles$257 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$269._p && - ((resource$270.instance = styles$269), - (resource$270.state.loading = 5)), + !styles$257._p && + ((resource$258.instance = styles$257), + (resource$258.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14528,16 +14673,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$269 || + styles$257 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$270.state + resource$258.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$270; + return resource$258; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14634,37 +14779,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$275 = hoistableRoot.querySelector( + var instance$263 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$275) + if (instance$263) return ( (resource.state.loading |= 4), - (resource.instance = instance$275), - markNodeAsHoistable(instance$275), - instance$275 + (resource.instance = instance$263), + markNodeAsHoistable(instance$263), + instance$263 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$275 = ( + instance$263 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$275); - var linkInstance = instance$275; + markNodeAsHoistable(instance$263); + var linkInstance = instance$263; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$275, "link", instance); + setInitialProperties(instance$263, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$275, props.precedence, hoistableRoot); - return (resource.instance = instance$275); + insertStylesheet(instance$263, props.precedence, hoistableRoot); + return (resource.instance = instance$263); case "script": - instance$275 = getScriptKey(props.src); + instance$263 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$275) + getScriptSelectorFromKey(instance$263) )) ) return ( @@ -14673,7 +14818,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$275))) + if ((styleProps = preloadPropsMap.get(instance$263))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14996,6 +15141,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -15715,16 +15861,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1724 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1738 = React.version; if ( - "19.0.0-experimental-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1724 + "19.0.0-experimental-94e652d5-20240912" !== + isomorphicReactPackageVersion$jscomp$inline_1738 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1724, - "19.0.0-experimental-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1738, + "19.0.0-experimental-94e652d5-20240912" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15744,18 +15890,18 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_1731 = { +var internals$jscomp$inline_1745 = { bundleType: 0, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827", + reconcilerVersion: "19.0.0-experimental-94e652d5-20240912", getLaneLabelMap: function () { for ( - var map = new Map(), lane = 1, index$292 = 0; - 31 > index$292; - index$292++ + var map = new Map(), lane = 1, index$280 = 0; + 31 > index$280; + index$280++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -15768,16 +15914,16 @@ var internals$jscomp$inline_1731 = { } }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2134 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2164 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2134.isDisabled && - hook$jscomp$inline_2134.supportsFiber + !hook$jscomp$inline_2164.isDisabled && + hook$jscomp$inline_2164.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2134.inject( - internals$jscomp$inline_1731 + (rendererID = hook$jscomp$inline_2164.inject( + internals$jscomp$inline_1745 )), - (injectedHook = hook$jscomp$inline_2134); + (injectedHook = hook$jscomp$inline_2164); } catch (err) {} } function noop() {} @@ -16030,7 +16176,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; "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 9452c5647daaa..08048d8093c86 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 @@ -4302,7 +4302,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4315,8 +4314,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4329,7 +4327,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4342,35 +4340,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1, - emptyContextObject, - null - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4386,8 +4355,7 @@ onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4400,6 +4368,36 @@ onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1, + emptyContextObject, + null + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function pingTask(request, task) { request.pingedTasks.push(task); @@ -5734,6 +5732,7 @@ resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; try { renderNode(request, task, content, -1); @@ -9291,5 +9290,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-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; })(); 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 c64e10d12e082..507b0d45c032a 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 @@ -3560,7 +3560,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3573,8 +3572,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3587,7 +3585,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3599,33 +3597,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -3641,8 +3612,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -3655,6 +3625,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } var currentRequest = null; function pingTask(request, task) { @@ -4459,6 +4457,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: replay, slots: name, @@ -6055,4 +6054,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js index 833ba505cf282..5b93e21e121ac 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js @@ -4302,7 +4302,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4315,8 +4314,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4329,7 +4327,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4342,35 +4340,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1, - emptyContextObject, - null - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4386,8 +4355,7 @@ onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4400,6 +4368,36 @@ onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1, + emptyContextObject, + null + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function pingTask(request, task) { request.pingedTasks.push(task); @@ -5734,6 +5732,7 @@ resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; try { renderNode(request, task, content, -1); @@ -9291,5 +9290,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js index 5018579879318..50f5faebbe07b 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js @@ -3612,7 +3612,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3625,8 +3624,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3639,7 +3637,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3651,33 +3649,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -3693,8 +3664,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -3707,6 +3677,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } var currentRequest = null; function pingTask(request, task) { @@ -4519,6 +4517,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: replay, slots: name, @@ -6147,4 +6146,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js index 52c68dfb5f0a4..8b6e446862390 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js @@ -4487,7 +4487,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4500,8 +4499,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4514,7 +4512,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4527,35 +4525,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1, - emptyContextObject, - null - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4571,8 +4540,7 @@ onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4585,6 +4553,36 @@ onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1, + emptyContextObject, + null + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function createPrerenderRequest( children, @@ -4631,35 +4629,20 @@ onFatalError, onPostpone ) { - var pingedTasks = [], - abortSet = new Set(); - renderState = { - destination: null, - flushScheduled: !1, - resumableState: postponedState.resumableState, - renderState: renderState, - rootFormatContext: postponedState.rootFormatContext, - progressiveChunkSize: postponedState.progressiveChunkSize, - status: 0, - fatalError: null, - nextSegmentId: postponedState.nextSegmentId, - allPendingTasks: 0, - pendingRootTasks: 0, - completedRootSegment: null, - abortableTasks: abortSet, - pingedTasks: pingedTasks, - clientRenderedBoundaries: [], - completedBoundaries: [], - partialBoundaries: [], - trackedPostpones: null, - onError: void 0 === onError ? defaultErrorHandler : onError, - onPostpone: void 0 === onPostpone ? noop : onPostpone, - onAllReady: void 0 === onAllReady ? noop : onAllReady, - onShellReady: void 0 === onShellReady ? noop : onShellReady, - onShellError: void 0 === onShellError ? noop : onShellError, - onFatalError: void 0 === onFatalError ? noop : onFatalError, - formState: null - }; + renderState = new RequestInstance( + postponedState.resumableState, + renderState, + postponedState.rootFormatContext, + postponedState.progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + null + ); + renderState.nextSegmentId = postponedState.nextSegmentId; if ("number" === typeof postponedState.replaySlots) return ( (onError = postponedState.replaySlots), @@ -4681,7 +4664,7 @@ null, onAllReady, null, - abortSet, + renderState.abortableTasks, null, postponedState.rootFormatContext, null, @@ -4692,7 +4675,7 @@ null )), pushComponentStack(children), - pingedTasks.push(children), + renderState.pingedTasks.push(children), renderState ); children = createReplayTask( @@ -4707,7 +4690,7 @@ -1, null, null, - abortSet, + renderState.abortableTasks, null, postponedState.rootFormatContext, null, @@ -4718,9 +4701,38 @@ null ); pushComponentStack(children); - pingedTasks.push(children); + renderState.pingedTasks.push(children); return renderState; } + function resumeAndPrerenderRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ) { + children = resumeRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ); + children.trackedPostpones = { + workingMap: new Map(), + rootNodes: [], + rootSlots: null + }; + return children; + } function pingTask(request, task) { request.pingedTasks.push(task); 1 === request.pingedTasks.length && @@ -6055,6 +6067,7 @@ resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; try { renderNode(request, task, content, -1); @@ -8177,11 +8190,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== 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-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -9911,5 +9924,55 @@ startWork(request); }); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.resumeAndPrerender = function (children, postponedState, options) { + return new Promise(function (resolve, reject) { + var request = resumeAndPrerenderRequest( + children, + postponedState, + createRenderState( + postponedState.resumableState, + options ? options.nonce : void 0, + void 0, + void 0, + void 0, + void 0 + ), + options ? options.onError : void 0, + function () { + var stream = new ReadableStream( + { + type: "bytes", + pull: function (controller) { + startFlowing(request, controller); + }, + cancel: function (reason) { + request.destination = null; + abort(request, reason); + } + }, + { highWaterMark: 0 } + ); + stream = { postponed: getPostponedState(request), prelude: stream }; + resolve(stream); + }, + void 0, + void 0, + reject, + options ? options.onPostpone : void 0 + ); + if (options && options.signal) { + var signal = options.signal; + if (signal.aborted) abort(request, signal.reason); + else { + var listener = function () { + abort(request, signal.reason); + signal.removeEventListener("abort", listener); + }; + signal.addEventListener("abort", listener); + } + } + startWork(request); + }); + }; + exports.version = "19.0.0-experimental-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js index 61dc6978be305..07f0ece9fd8e5 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js @@ -3969,7 +3969,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3982,8 +3981,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3996,7 +3994,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4008,33 +4006,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4050,8 +4021,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4064,6 +4034,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function createPrerenderRequest( children, @@ -4110,35 +4108,20 @@ function resumeRequest( onFatalError, onPostpone ) { - var pingedTasks = [], - abortSet = new Set(); - renderState = { - destination: null, - flushScheduled: !1, - resumableState: postponedState.resumableState, - renderState: renderState, - rootFormatContext: postponedState.rootFormatContext, - progressiveChunkSize: postponedState.progressiveChunkSize, - status: 0, - fatalError: null, - nextSegmentId: postponedState.nextSegmentId, - allPendingTasks: 0, - pendingRootTasks: 0, - completedRootSegment: null, - abortableTasks: abortSet, - pingedTasks: pingedTasks, - clientRenderedBoundaries: [], - completedBoundaries: [], - partialBoundaries: [], - trackedPostpones: null, - onError: void 0 === onError ? defaultErrorHandler : onError, - onPostpone: void 0 === onPostpone ? noop : onPostpone, - onAllReady: void 0 === onAllReady ? noop : onAllReady, - onShellReady: void 0 === onShellReady ? noop : onShellReady, - onShellError: void 0 === onShellError ? noop : onShellError, - onFatalError: void 0 === onFatalError ? noop : onFatalError, - formState: null - }; + renderState = new RequestInstance( + postponedState.resumableState, + renderState, + postponedState.rootFormatContext, + postponedState.progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + null + ); + renderState.nextSegmentId = postponedState.nextSegmentId; if ("number" === typeof postponedState.replaySlots) return ( (onError = postponedState.replaySlots), @@ -4160,7 +4143,7 @@ function resumeRequest( null, onAllReady, null, - abortSet, + renderState.abortableTasks, null, postponedState.rootFormatContext, null, @@ -4169,7 +4152,7 @@ function resumeRequest( !1 )), pushComponentStack(children), - pingedTasks.push(children), + renderState.pingedTasks.push(children), renderState ); children = createReplayTask( @@ -4184,7 +4167,7 @@ function resumeRequest( -1, null, null, - abortSet, + renderState.abortableTasks, null, postponedState.rootFormatContext, null, @@ -4193,9 +4176,38 @@ function resumeRequest( !1 ); pushComponentStack(children); - pingedTasks.push(children); + renderState.pingedTasks.push(children); return renderState; } +function resumeAndPrerenderRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone +) { + children = resumeRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ); + children.trackedPostpones = { + workingMap: new Map(), + rootNodes: [], + rootSlots: null + }; + return children; +} var currentRequest = null; function pingTask(request, task) { request.pingedTasks.push(task); @@ -4999,6 +5011,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: replay, slots: name, @@ -6572,12 +6585,12 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== isomorphicReactPackageVersion) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion, - "19.0.0-experimental-7771d3a7-20240827" + "19.0.0-experimental-94e652d5-20240912" ) ); } @@ -6782,4 +6795,54 @@ exports.resume = function (children, postponedState, options) { startWork(request); }); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.resumeAndPrerender = function (children, postponedState, options) { + return new Promise(function (resolve, reject) { + var request = resumeAndPrerenderRequest( + children, + postponedState, + createRenderState( + postponedState.resumableState, + options ? options.nonce : void 0, + void 0, + void 0, + void 0, + void 0 + ), + options ? options.onError : void 0, + function () { + var stream = new ReadableStream( + { + type: "bytes", + pull: function (controller) { + startFlowing(request, controller); + }, + cancel: function (reason) { + request.destination = null; + abort(request, reason); + } + }, + { highWaterMark: 0 } + ); + stream = { postponed: getPostponedState(request), prelude: stream }; + resolve(stream); + }, + void 0, + void 0, + reject, + options ? options.onPostpone : void 0 + ); + if (options && options.signal) { + var signal = options.signal; + if (signal.aborted) abort(request, signal.reason); + else { + var listener = function () { + abort(request, signal.reason); + signal.removeEventListener("abort", listener); + }; + signal.addEventListener("abort", listener); + } + } + startWork(request); + }); +}; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js index 5bb3c96ecf27d..b70282e265988 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js @@ -3609,7 +3609,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3622,8 +3621,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3636,7 +3634,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3648,33 +3646,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -3690,8 +3661,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -3704,6 +3674,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } var currentRequest = null; function pingTask(request, task) { @@ -4516,6 +4514,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: replay, slots: name, @@ -6068,13 +6067,13 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) { } var isomorphicReactPackageVersion$jscomp$inline_783 = React.version; if ( - "19.0.0-experimental-7771d3a7-20240827" !== + "19.0.0-experimental-94e652d5-20240912" !== isomorphicReactPackageVersion$jscomp$inline_783 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_783 + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -6162,4 +6161,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js index 726fd2f3c6d57..bc3d699a67cb2 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js @@ -4483,7 +4483,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4496,8 +4495,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4510,7 +4508,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4523,35 +4521,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1, - emptyContextObject, - null - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4567,8 +4536,7 @@ onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4581,6 +4549,36 @@ onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1, + emptyContextObject, + null + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function createPrerenderRequest( children, @@ -4627,35 +4625,20 @@ onFatalError, onPostpone ) { - var pingedTasks = [], - abortSet = new Set(); - renderState = { - destination: null, - flushScheduled: !1, - resumableState: postponedState.resumableState, - renderState: renderState, - rootFormatContext: postponedState.rootFormatContext, - progressiveChunkSize: postponedState.progressiveChunkSize, - status: 0, - fatalError: null, - nextSegmentId: postponedState.nextSegmentId, - allPendingTasks: 0, - pendingRootTasks: 0, - completedRootSegment: null, - abortableTasks: abortSet, - pingedTasks: pingedTasks, - clientRenderedBoundaries: [], - completedBoundaries: [], - partialBoundaries: [], - trackedPostpones: null, - onError: void 0 === onError ? defaultErrorHandler : onError, - onPostpone: void 0 === onPostpone ? noop : onPostpone, - onAllReady: void 0 === onAllReady ? noop : onAllReady, - onShellReady: void 0 === onShellReady ? noop : onShellReady, - onShellError: void 0 === onShellError ? noop : onShellError, - onFatalError: void 0 === onFatalError ? noop : onFatalError, - formState: null - }; + renderState = new RequestInstance( + postponedState.resumableState, + renderState, + postponedState.rootFormatContext, + postponedState.progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + null + ); + renderState.nextSegmentId = postponedState.nextSegmentId; if ("number" === typeof postponedState.replaySlots) return ( (onError = postponedState.replaySlots), @@ -4677,7 +4660,7 @@ null, onAllReady, null, - abortSet, + renderState.abortableTasks, null, postponedState.rootFormatContext, null, @@ -4688,7 +4671,7 @@ null )), pushComponentStack(children), - pingedTasks.push(children), + renderState.pingedTasks.push(children), renderState ); children = createReplayTask( @@ -4703,7 +4686,7 @@ -1, null, null, - abortSet, + renderState.abortableTasks, null, postponedState.rootFormatContext, null, @@ -4714,9 +4697,38 @@ null ); pushComponentStack(children); - pingedTasks.push(children); + renderState.pingedTasks.push(children); return renderState; } + function resumeAndPrerenderRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ) { + children = resumeRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ); + children.trackedPostpones = { + workingMap: new Map(), + rootNodes: [], + rootSlots: null + }; + return children; + } function resolveRequest() { if (currentRequest) return currentRequest; if (supportsRequestStorage) { @@ -6059,6 +6071,7 @@ resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; try { renderNode(request, task, content, -1); @@ -8200,11 +8213,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== 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-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -9930,6 +9943,56 @@ startWork(request); }); }; + exports.resumeAndPrerender = function (children, postponedState, options) { + return new Promise(function (resolve, reject) { + var request = resumeAndPrerenderRequest( + children, + postponedState, + createRenderState( + postponedState.resumableState, + options ? options.nonce : void 0, + void 0, + void 0, + void 0, + void 0 + ), + options ? options.onError : void 0, + function () { + var stream = new ReadableStream( + { + type: "bytes", + pull: function (controller) { + startFlowing(request, controller); + }, + cancel: function (reason) { + request.destination = null; + abort(request, reason); + } + }, + { highWaterMark: 0 } + ); + stream = { postponed: getPostponedState(request), prelude: stream }; + resolve(stream); + }, + void 0, + void 0, + reject, + options ? options.onPostpone : void 0 + ); + if (options && options.signal) { + var signal = options.signal; + if (signal.aborted) abort(request, signal.reason); + else { + var listener = function () { + abort(request, signal.reason); + signal.removeEventListener("abort", listener); + }; + signal.addEventListener("abort", listener); + } + } + startWork(request); + }); + }; // This is a patch added by Next.js const setTimeoutOrImmediate = @@ -9941,5 +10004,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js index 5035b4f547a6b..513206d9c3e10 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js @@ -4013,7 +4013,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4026,8 +4025,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4040,7 +4038,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4052,33 +4050,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4094,8 +4065,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4108,6 +4078,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function createPrerenderRequest( children, @@ -4154,35 +4152,20 @@ function resumeRequest( onFatalError, onPostpone ) { - var pingedTasks = [], - abortSet = new Set(); - renderState = { - destination: null, - flushScheduled: !1, - resumableState: postponedState.resumableState, - renderState: renderState, - rootFormatContext: postponedState.rootFormatContext, - progressiveChunkSize: postponedState.progressiveChunkSize, - status: 0, - fatalError: null, - nextSegmentId: postponedState.nextSegmentId, - allPendingTasks: 0, - pendingRootTasks: 0, - completedRootSegment: null, - abortableTasks: abortSet, - pingedTasks: pingedTasks, - clientRenderedBoundaries: [], - completedBoundaries: [], - partialBoundaries: [], - trackedPostpones: null, - onError: void 0 === onError ? defaultErrorHandler : onError, - onPostpone: void 0 === onPostpone ? noop : onPostpone, - onAllReady: void 0 === onAllReady ? noop : onAllReady, - onShellReady: void 0 === onShellReady ? noop : onShellReady, - onShellError: void 0 === onShellError ? noop : onShellError, - onFatalError: void 0 === onFatalError ? noop : onFatalError, - formState: null - }; + renderState = new RequestInstance( + postponedState.resumableState, + renderState, + postponedState.rootFormatContext, + postponedState.progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + null + ); + renderState.nextSegmentId = postponedState.nextSegmentId; if ("number" === typeof postponedState.replaySlots) return ( (onError = postponedState.replaySlots), @@ -4204,7 +4187,7 @@ function resumeRequest( null, onAllReady, null, - abortSet, + renderState.abortableTasks, null, postponedState.rootFormatContext, null, @@ -4213,7 +4196,7 @@ function resumeRequest( !1 )), pushComponentStack(children), - pingedTasks.push(children), + renderState.pingedTasks.push(children), renderState ); children = createReplayTask( @@ -4228,7 +4211,7 @@ function resumeRequest( -1, null, null, - abortSet, + renderState.abortableTasks, null, postponedState.rootFormatContext, null, @@ -4237,9 +4220,38 @@ function resumeRequest( !1 ); pushComponentStack(children); - pingedTasks.push(children); + renderState.pingedTasks.push(children); return renderState; } +function resumeAndPrerenderRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone +) { + children = resumeRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ); + children.trackedPostpones = { + workingMap: new Map(), + rootNodes: [], + rootSlots: null + }; + return children; +} var currentRequest = null; function resolveRequest() { if (currentRequest) return currentRequest; @@ -5059,6 +5071,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: replay, slots: name, @@ -6680,11 +6693,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== 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-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6888,6 +6901,56 @@ exports.resume = function (children, postponedState, options) { startWork(request); }); }; +exports.resumeAndPrerender = function (children, postponedState, options) { + return new Promise(function (resolve, reject) { + var request = resumeAndPrerenderRequest( + children, + postponedState, + createRenderState( + postponedState.resumableState, + options ? options.nonce : void 0, + void 0, + void 0, + void 0, + void 0 + ), + options ? options.onError : void 0, + function () { + var stream = new ReadableStream( + { + type: "bytes", + pull: function (controller) { + startFlowing(request, controller); + }, + cancel: function (reason) { + request.destination = null; + abort(request, reason); + } + }, + { highWaterMark: 0 } + ); + stream = { postponed: getPostponedState(request), prelude: stream }; + resolve(stream); + }, + void 0, + void 0, + reject, + options ? options.onPostpone : void 0 + ); + if (options && options.signal) { + var signal = options.signal; + if (signal.aborted) abort(request, signal.reason); + else { + var listener = function () { + abort(request, signal.reason); + signal.removeEventListener("abort", listener); + }; + signal.addEventListener("abort", listener); + } + } + startWork(request); + }); +}; // This is a patch added by Next.js const setTimeoutOrImmediate = @@ -6899,4 +6962,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js index eeee07bf4a2f7..e9721775b8ebc 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js @@ -4375,7 +4375,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4388,8 +4387,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4402,7 +4400,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4415,24 +4413,52 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, + } + function createRequest( + children, + resumableState, + renderState, + rootFormatContext, + progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + formState + ) { + resumableState = new RequestInstance( + resumableState, + renderState, + rootFormatContext, + progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + formState + ); + renderState = createPendingSegment( + resumableState, 0, null, rootFormatContext, !1, !1 ); - resumableState.parentFlushed = !0; + renderState.parentFlushed = !0; children = createRenderTask( - this, + resumableState, null, children, -1, null, - resumableState, + renderState, null, - abortSet, + resumableState.abortableTasks, null, rootFormatContext, null, @@ -4443,7 +4469,8 @@ null ); pushComponentStack(children); - pingedTasks.push(children); + resumableState.pingedTasks.push(children); + return resumableState; } function createPrerenderRequest( children, @@ -4458,7 +4485,7 @@ onFatalError, onPostpone ) { - children = new RequestInstance( + children = createRequest( children, resumableState, renderState, @@ -4479,6 +4506,121 @@ }; return children; } + function resumeRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ) { + renderState = new RequestInstance( + postponedState.resumableState, + renderState, + postponedState.rootFormatContext, + postponedState.progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + null + ); + renderState.nextSegmentId = postponedState.nextSegmentId; + if ("number" === typeof postponedState.replaySlots) + return ( + (onError = postponedState.replaySlots), + (onAllReady = createPendingSegment( + renderState, + 0, + null, + postponedState.rootFormatContext, + !1, + !1 + )), + (onAllReady.id = onError), + (onAllReady.parentFlushed = !0), + (children = createRenderTask( + renderState, + null, + children, + -1, + null, + onAllReady, + null, + renderState.abortableTasks, + null, + postponedState.rootFormatContext, + null, + emptyTreeContext, + null, + !1, + emptyContextObject, + null + )), + pushComponentStack(children), + renderState.pingedTasks.push(children), + renderState + ); + children = createReplayTask( + renderState, + null, + { + nodes: postponedState.replayNodes, + slots: postponedState.replaySlots, + pendingTasks: 0 + }, + children, + -1, + null, + null, + renderState.abortableTasks, + null, + postponedState.rootFormatContext, + null, + emptyTreeContext, + null, + !1, + emptyContextObject, + null + ); + pushComponentStack(children); + renderState.pingedTasks.push(children); + return renderState; + } + function resumeAndPrerenderRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ) { + children = resumeRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ); + children.trackedPostpones = { + workingMap: new Map(), + rootNodes: [], + rootSlots: null + }; + return children; + } function resolveRequest() { if (currentRequest) return currentRequest; var store = requestStorage.getStore(); @@ -5817,6 +5959,7 @@ resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; try { renderNode(request, task, content, -1); @@ -7928,11 +8071,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== 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-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); } function createDrainHandler(destination, request) { @@ -7948,13 +8091,16 @@ } function createRequestImpl(children, options) { var resumableState = createResumableState( - options ? options.identifierPrefix : void 0, - options ? options.unstable_externalRuntimeSrc : void 0, - options ? options.bootstrapScriptContent : void 0, - options ? options.bootstrapScripts : void 0, - options ? options.bootstrapModules : void 0 - ), - renderState = createRenderState( + options ? options.identifierPrefix : void 0, + options ? options.unstable_externalRuntimeSrc : void 0, + options ? options.bootstrapScriptContent : void 0, + options ? options.bootstrapScripts : void 0, + options ? options.bootstrapModules : void 0 + ); + return createRequest( + children, + resumableState, + createRenderState( resumableState, options ? options.nonce : void 0, options ? options.unstable_externalRuntimeSrc : void 0, @@ -7962,14 +8108,7 @@ options ? options.onHeaders : void 0, options ? options.maxHeadersLength : void 0 ), - rootFormatContext = createRootFormatContext( - options ? options.namespaceURI : void 0 - ); - return new RequestInstance( - children, - resumableState, - renderState, - rootFormatContext, + createRootFormatContext(options ? options.namespaceURI : void 0), options ? options.progressiveChunkSize : void 0, options ? options.onError : void 0, options ? options.onAllReady : void 0, @@ -7981,7 +8120,10 @@ ); } function resumeRequestImpl(children, postponedState, options) { - var renderState = createRenderState( + return resumeRequest( + children, + postponedState, + createRenderState( postponedState.resumableState, options ? options.nonce : void 0, void 0, @@ -7989,97 +8131,13 @@ void 0, void 0 ), - onError = options ? options.onError : void 0, - onAllReady = options ? options.onAllReady : void 0, - onShellReady = options ? options.onShellReady : void 0, - onShellError = options ? options.onShellError : void 0, - onPostpone = options ? options.onPostpone : void 0; - options = []; - var abortSet = new Set(); - renderState = { - destination: null, - flushScheduled: !1, - resumableState: postponedState.resumableState, - renderState: renderState, - rootFormatContext: postponedState.rootFormatContext, - progressiveChunkSize: postponedState.progressiveChunkSize, - status: 0, - fatalError: null, - nextSegmentId: postponedState.nextSegmentId, - allPendingTasks: 0, - pendingRootTasks: 0, - completedRootSegment: null, - abortableTasks: abortSet, - pingedTasks: options, - clientRenderedBoundaries: [], - completedBoundaries: [], - partialBoundaries: [], - trackedPostpones: null, - onError: void 0 === onError ? defaultErrorHandler : onError, - onPostpone: void 0 === onPostpone ? noop : onPostpone, - onAllReady: void 0 === onAllReady ? noop : onAllReady, - onShellReady: void 0 === onShellReady ? noop : onShellReady, - onShellError: void 0 === onShellError ? noop : onShellError, - onFatalError: noop, - formState: null - }; - "number" === typeof postponedState.replaySlots - ? ((onError = postponedState.replaySlots), - (onAllReady = createPendingSegment( - renderState, - 0, - null, - postponedState.rootFormatContext, - !1, - !1 - )), - (onAllReady.id = onError), - (onAllReady.parentFlushed = !0), - (children = createRenderTask( - renderState, - null, - children, - -1, - null, - onAllReady, - null, - abortSet, - null, - postponedState.rootFormatContext, - null, - emptyTreeContext, - null, - !1, - emptyContextObject, - null - )), - pushComponentStack(children), - options.push(children)) - : ((children = createReplayTask( - renderState, - null, - { - nodes: postponedState.replayNodes, - slots: postponedState.replaySlots, - pendingTasks: 0 - }, - children, - -1, - null, - null, - abortSet, - null, - postponedState.rootFormatContext, - null, - emptyTreeContext, - null, - !1, - emptyContextObject, - null - )), - pushComponentStack(children), - options.push(children)); - return renderState; + options ? options.onError : void 0, + options ? options.onAllReady : void 0, + options ? options.onShellReady : void 0, + options ? options.onShellError : void 0, + void 0, + options ? options.onPostpone : void 0 + ); } function createFakeWritable(readable) { return { @@ -9705,6 +9763,56 @@ } }; }; + exports.resumeAndPrerenderToNodeStream = function ( + children, + postponedState, + options + ) { + return new Promise(function (resolve, reject) { + var request = resumeAndPrerenderRequest( + children, + postponedState, + createRenderState( + postponedState.resumableState, + options ? options.nonce : void 0, + void 0, + void 0, + void 0, + void 0 + ), + options ? options.onError : void 0, + function () { + var readable = new stream.Readable({ + read: function () { + startFlowing(request, writable); + } + }), + writable = createFakeWritable(readable); + readable = { + postponed: getPostponedState(request), + prelude: readable + }; + resolve(readable); + }, + void 0, + void 0, + reject, + options ? options.onPostpone : void 0 + ); + if (options && options.signal) { + var signal = options.signal; + if (signal.aborted) abort(request, signal.reason); + else { + var listener = function () { + abort(request, signal.reason); + signal.removeEventListener("abort", listener); + }; + signal.addEventListener("abort", listener); + } + } + startWork(request); + }); + }; exports.resumeToPipeableStream = function ( children, postponedState, @@ -9740,5 +9848,5 @@ } }; }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js index a47861424a372..76ce65da8d0cc 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js @@ -3900,7 +3900,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3913,8 +3912,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3927,7 +3925,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3939,24 +3937,52 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, +} +function createRequest( + children, + resumableState, + renderState, + rootFormatContext, + progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + formState +) { + resumableState = new RequestInstance( + resumableState, + renderState, + rootFormatContext, + progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + formState + ); + renderState = createPendingSegment( + resumableState, 0, null, rootFormatContext, !1, !1 ); - resumableState.parentFlushed = !0; + renderState.parentFlushed = !0; children = createRenderTask( - this, + resumableState, null, children, -1, null, - resumableState, + renderState, null, - abortSet, + resumableState.abortableTasks, null, rootFormatContext, null, @@ -3965,7 +3991,8 @@ function RequestInstance( !1 ); pushComponentStack(children); - pingedTasks.push(children); + resumableState.pingedTasks.push(children); + return resumableState; } function createPrerenderRequest( children, @@ -3980,7 +4007,7 @@ function createPrerenderRequest( onFatalError, onPostpone ) { - children = new RequestInstance( + children = createRequest( children, resumableState, renderState, @@ -4001,6 +4028,117 @@ function createPrerenderRequest( }; return children; } +function resumeRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone +) { + renderState = new RequestInstance( + postponedState.resumableState, + renderState, + postponedState.rootFormatContext, + postponedState.progressiveChunkSize, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone, + null + ); + renderState.nextSegmentId = postponedState.nextSegmentId; + if ("number" === typeof postponedState.replaySlots) + return ( + (onError = postponedState.replaySlots), + (onAllReady = createPendingSegment( + renderState, + 0, + null, + postponedState.rootFormatContext, + !1, + !1 + )), + (onAllReady.id = onError), + (onAllReady.parentFlushed = !0), + (children = createRenderTask( + renderState, + null, + children, + -1, + null, + onAllReady, + null, + renderState.abortableTasks, + null, + postponedState.rootFormatContext, + null, + emptyTreeContext, + null, + !1 + )), + pushComponentStack(children), + renderState.pingedTasks.push(children), + renderState + ); + children = createReplayTask( + renderState, + null, + { + nodes: postponedState.replayNodes, + slots: postponedState.replaySlots, + pendingTasks: 0 + }, + children, + -1, + null, + null, + renderState.abortableTasks, + null, + postponedState.rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + renderState.pingedTasks.push(children); + return renderState; +} +function resumeAndPrerenderRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone +) { + children = resumeRequest( + children, + postponedState, + renderState, + onError, + onAllReady, + onShellReady, + onShellError, + onFatalError, + onPostpone + ); + children.trackedPostpones = { + workingMap: new Map(), + rootNodes: [], + rootSlots: null + }; + return children; +} var currentRequest = null; function resolveRequest() { if (currentRequest) return currentRequest; @@ -4817,6 +4955,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: replay, slots: name, @@ -6427,11 +6566,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== 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-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6448,13 +6587,16 @@ function createCancelHandler(request, reason) { } function createRequestImpl(children, options) { var resumableState = createResumableState( - options ? options.identifierPrefix : void 0, - options ? options.unstable_externalRuntimeSrc : void 0, - options ? options.bootstrapScriptContent : void 0, - options ? options.bootstrapScripts : void 0, - options ? options.bootstrapModules : void 0 - ), - renderState = createRenderState( + options ? options.identifierPrefix : void 0, + options ? options.unstable_externalRuntimeSrc : void 0, + options ? options.bootstrapScriptContent : void 0, + options ? options.bootstrapScripts : void 0, + options ? options.bootstrapModules : void 0 + ); + return createRequest( + children, + resumableState, + createRenderState( resumableState, options ? options.nonce : void 0, options ? options.unstable_externalRuntimeSrc : void 0, @@ -6462,14 +6604,7 @@ function createRequestImpl(children, options) { options ? options.onHeaders : void 0, options ? options.maxHeadersLength : void 0 ), - rootFormatContext = createRootFormatContext( - options ? options.namespaceURI : void 0 - ); - return new RequestInstance( - children, - resumableState, - renderState, - rootFormatContext, + createRootFormatContext(options ? options.namespaceURI : void 0), options ? options.progressiveChunkSize : void 0, options ? options.onError : void 0, options ? options.onAllReady : void 0, @@ -6481,7 +6616,10 @@ function createRequestImpl(children, options) { ); } function resumeRequestImpl(children, postponedState, options) { - var renderState = createRenderState( + return resumeRequest( + children, + postponedState, + createRenderState( postponedState.resumableState, options ? options.nonce : void 0, void 0, @@ -6489,93 +6627,13 @@ function resumeRequestImpl(children, postponedState, options) { void 0, void 0 ), - onError = options ? options.onError : void 0, - onAllReady = options ? options.onAllReady : void 0, - onShellReady = options ? options.onShellReady : void 0, - onShellError = options ? options.onShellError : void 0, - onPostpone = options ? options.onPostpone : void 0; - options = []; - var abortSet = new Set(); - renderState = { - destination: null, - flushScheduled: !1, - resumableState: postponedState.resumableState, - renderState: renderState, - rootFormatContext: postponedState.rootFormatContext, - progressiveChunkSize: postponedState.progressiveChunkSize, - status: 0, - fatalError: null, - nextSegmentId: postponedState.nextSegmentId, - allPendingTasks: 0, - pendingRootTasks: 0, - completedRootSegment: null, - abortableTasks: abortSet, - pingedTasks: options, - clientRenderedBoundaries: [], - completedBoundaries: [], - partialBoundaries: [], - trackedPostpones: null, - onError: void 0 === onError ? defaultErrorHandler : onError, - onPostpone: void 0 === onPostpone ? noop : onPostpone, - onAllReady: void 0 === onAllReady ? noop : onAllReady, - onShellReady: void 0 === onShellReady ? noop : onShellReady, - onShellError: void 0 === onShellError ? noop : onShellError, - onFatalError: noop, - formState: null - }; - "number" === typeof postponedState.replaySlots - ? ((onError = postponedState.replaySlots), - (onAllReady = createPendingSegment( - renderState, - 0, - null, - postponedState.rootFormatContext, - !1, - !1 - )), - (onAllReady.id = onError), - (onAllReady.parentFlushed = !0), - (children = createRenderTask( - renderState, - null, - children, - -1, - null, - onAllReady, - null, - abortSet, - null, - postponedState.rootFormatContext, - null, - emptyTreeContext, - null, - !1 - )), - pushComponentStack(children), - options.push(children)) - : ((children = createReplayTask( - renderState, - null, - { - nodes: postponedState.replayNodes, - slots: postponedState.replaySlots, - pendingTasks: 0 - }, - children, - -1, - null, - null, - abortSet, - null, - postponedState.rootFormatContext, - null, - emptyTreeContext, - null, - !1 - )), - pushComponentStack(children), - options.push(children)); - return renderState; + options ? options.onError : void 0, + options ? options.onAllReady : void 0, + options ? options.onShellReady : void 0, + options ? options.onShellError : void 0, + void 0, + options ? options.onPostpone : void 0 + ); } ensureCorrectIsomorphicReactVersion(); function createFakeWritable(readable) { @@ -6685,6 +6743,53 @@ exports.renderToPipeableStream = function (children, options) { } }; }; +exports.resumeAndPrerenderToNodeStream = function ( + children, + postponedState, + options +) { + return new Promise(function (resolve, reject) { + var request = resumeAndPrerenderRequest( + children, + postponedState, + createRenderState( + postponedState.resumableState, + options ? options.nonce : void 0, + void 0, + void 0, + void 0, + void 0 + ), + options ? options.onError : void 0, + function () { + var readable = new stream.Readable({ + read: function () { + startFlowing(request, writable); + } + }), + writable = createFakeWritable(readable); + readable = { postponed: getPostponedState(request), prelude: readable }; + resolve(readable); + }, + void 0, + void 0, + reject, + options ? options.onPostpone : void 0 + ); + if (options && options.signal) { + var signal = options.signal; + if (signal.aborted) abort(request, signal.reason); + else { + var listener = function () { + abort(request, signal.reason); + signal.removeEventListener("abort", listener); + }; + signal.addEventListener("abort", listener); + } + } + startWork(request); + }); +}; exports.resumeToPipeableStream = function (children, postponedState, options) { var request = resumeRequestImpl(children, postponedState, options), hasStartedFlowing = !1; @@ -6716,4 +6821,4 @@ exports.resumeToPipeableStream = function (children, postponedState, options) { } }; }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js index 4e35441166319..2e8c7e938bc91 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js @@ -1094,28 +1094,40 @@ 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; } @@ -1189,25 +1201,34 @@ for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } - function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index = 31 - clz32(noLongerPendingLanes), + var index = 31 - clz32(remainingLanes), lane = 1 << index; - remainingLanes[index] = 0; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1219,9 +1240,14 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + 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; @@ -4039,6 +4065,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5896,6 +5977,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -5952,10 +6041,16 @@ numberOfReRenders += 1; ignorePreviousDependencies = !1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } hookTypesUpdateIndexDev = -1; ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - var children = callComponentInDEV(Component, props, secondArg); + children = callComponentInDEV(Component, props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -6779,17 +6874,16 @@ function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function mountRef(initialValue) { @@ -7374,60 +7468,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error) { reportGlobalError(error); @@ -8069,8 +8231,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -8110,6 +8272,7 @@ hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -8299,8 +8462,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8736,33 +8899,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2340; - var JSCompiler_object_inline_stack_2339 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2320; + var JSCompiler_object_inline_stack_2319 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2337 = !1; + var JSCompiler_object_inline_message_2317 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2340 = didSuspend) || - (JSCompiler_object_inline_componentStack_2340 = + (JSCompiler_object_inline_componentStack_2320 = didSuspend) || + (JSCompiler_object_inline_componentStack_2320 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2340 && - ((JSCompiler_object_inline_message_2337 = !0), + JSCompiler_object_inline_componentStack_2320 && + ((JSCompiler_object_inline_message_2317 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2340 = + JSCompiler_object_inline_componentStack_2320 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2337 + JSCompiler_object_inline_message_2317 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2338 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2318 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2338)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2318)) { c: { - var instance = JSCompiler_object_inline_digest_2338; + var instance = JSCompiler_object_inline_digest_2318; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8803,19 +8966,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2338 + JSCompiler_object_inline_digest_2318 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2338 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2318 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2338 && - ((JSCompiler_object_inline_digest_2338 = - JSCompiler_object_inline_digest_2338.dehydrated), - null !== JSCompiler_object_inline_digest_2338) + null !== JSCompiler_object_inline_digest_2318 && + ((JSCompiler_object_inline_digest_2318 = + JSCompiler_object_inline_digest_2318.dehydrated), + null !== JSCompiler_object_inline_digest_2318) ) return ( - JSCompiler_object_inline_digest_2338.data === + JSCompiler_object_inline_digest_2318.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8823,68 +8986,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2338 = - JSCompiler_object_inline_stack_2339.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2339.fallback; - if (JSCompiler_object_inline_message_2337) + JSCompiler_object_inline_digest_2318 = + JSCompiler_object_inline_stack_2319.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2319.fallback; + if (JSCompiler_object_inline_message_2317) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2339 = + (JSCompiler_object_inline_stack_2319 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2338, + JSCompiler_object_inline_digest_2318, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2337 = workInProgress.child), - (JSCompiler_object_inline_message_2337.memoizedState = + (JSCompiler_object_inline_message_2317 = workInProgress.child), + (JSCompiler_object_inline_message_2317.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2337.childLanes = + (JSCompiler_object_inline_message_2317.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2320, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2319 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2339.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2319.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2339 = + (JSCompiler_object_inline_stack_2319 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2338, + JSCompiler_object_inline_digest_2318, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2337 = workInProgress.child), - (JSCompiler_object_inline_message_2337.memoizedState = + (JSCompiler_object_inline_message_2317 = workInProgress.child), + (JSCompiler_object_inline_message_2317.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2337.childLanes = + (JSCompiler_object_inline_message_2317.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2320, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2319 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2338 + JSCompiler_object_inline_digest_2318 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2338 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2338) + ((JSCompiler_object_inline_digest_2318 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2318) ) { if (didSuspend) workInProgress.flags & 256 @@ -8901,94 +9064,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2337 = - JSCompiler_object_inline_stack_2339.fallback), - (JSCompiler_object_inline_digest_2338 = workInProgress.mode), - (JSCompiler_object_inline_stack_2339 = + (JSCompiler_object_inline_message_2317 = + JSCompiler_object_inline_stack_2319.fallback), + (JSCompiler_object_inline_digest_2318 = workInProgress.mode), + (JSCompiler_object_inline_stack_2319 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2339.children + children: JSCompiler_object_inline_stack_2319.children }, - JSCompiler_object_inline_digest_2338 + JSCompiler_object_inline_digest_2318 )), - (JSCompiler_object_inline_message_2337 = + (JSCompiler_object_inline_message_2317 = createFiberFromFragment( - JSCompiler_object_inline_message_2337, - JSCompiler_object_inline_digest_2338, + JSCompiler_object_inline_message_2317, + JSCompiler_object_inline_digest_2318, renderLanes, null )), - (JSCompiler_object_inline_message_2337.flags |= 2), - (JSCompiler_object_inline_stack_2339.return = workInProgress), - (JSCompiler_object_inline_message_2337.return = workInProgress), - (JSCompiler_object_inline_stack_2339.sibling = - JSCompiler_object_inline_message_2337), - (workInProgress.child = JSCompiler_object_inline_stack_2339), + (JSCompiler_object_inline_message_2317.flags |= 2), + (JSCompiler_object_inline_stack_2319.return = workInProgress), + (JSCompiler_object_inline_message_2317.return = workInProgress), + (JSCompiler_object_inline_stack_2319.sibling = + JSCompiler_object_inline_message_2317), + (workInProgress.child = JSCompiler_object_inline_stack_2319), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2339 = workInProgress.child), - (JSCompiler_object_inline_stack_2339.memoizedState = + (JSCompiler_object_inline_stack_2319 = workInProgress.child), + (JSCompiler_object_inline_stack_2319.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2339.childLanes = + (JSCompiler_object_inline_stack_2319.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2320, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2337)); + (workInProgress = JSCompiler_object_inline_message_2317)); 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_2338.data === + JSCompiler_object_inline_digest_2318.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2340 = - JSCompiler_object_inline_digest_2338.nextSibling && - JSCompiler_object_inline_digest_2338.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2340) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2340.dgst; - var message = JSCompiler_object_inline_componentStack_2340.msg; - instance = JSCompiler_object_inline_componentStack_2340.stck; + JSCompiler_object_inline_componentStack_2320 = + JSCompiler_object_inline_digest_2318.nextSibling && + JSCompiler_object_inline_digest_2318.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2320) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2320.dgst; + var message = JSCompiler_object_inline_componentStack_2320.msg; + instance = JSCompiler_object_inline_componentStack_2320.stck; var componentStack = - JSCompiler_object_inline_componentStack_2340.cstck; + JSCompiler_object_inline_componentStack_2320.cstck; } - JSCompiler_object_inline_message_2337 = message; - JSCompiler_object_inline_digest_2338 = JSCompiler_temp; - JSCompiler_object_inline_stack_2339 = instance; - JSCompiler_object_inline_componentStack_2340 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2338 && - ((JSCompiler_object_inline_message_2337 = - JSCompiler_object_inline_message_2337 - ? Error(JSCompiler_object_inline_message_2337) + JSCompiler_object_inline_message_2317 = message; + JSCompiler_object_inline_digest_2318 = JSCompiler_temp; + JSCompiler_object_inline_stack_2319 = instance; + JSCompiler_object_inline_componentStack_2320 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2318 && + ((JSCompiler_object_inline_message_2317 = + JSCompiler_object_inline_message_2317 + ? Error(JSCompiler_object_inline_message_2317) : 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_2337.stack = - JSCompiler_object_inline_stack_2339 || ""), - (JSCompiler_object_inline_message_2337.digest = - JSCompiler_object_inline_digest_2338), - (JSCompiler_object_inline_componentStack_2340 = - void 0 === JSCompiler_object_inline_componentStack_2340 + (JSCompiler_object_inline_message_2317.stack = + JSCompiler_object_inline_stack_2319 || ""), + (JSCompiler_object_inline_message_2317.digest = + JSCompiler_object_inline_digest_2318), + (JSCompiler_object_inline_componentStack_2320 = + void 0 === JSCompiler_object_inline_componentStack_2320 ? null - : JSCompiler_object_inline_componentStack_2340), - "string" === typeof JSCompiler_object_inline_componentStack_2340 && + : JSCompiler_object_inline_componentStack_2320), + "string" === typeof JSCompiler_object_inline_componentStack_2320 && CapturedStacks.set( - JSCompiler_object_inline_message_2337, - JSCompiler_object_inline_componentStack_2340 + JSCompiler_object_inline_message_2317, + JSCompiler_object_inline_componentStack_2320 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2337, + value: JSCompiler_object_inline_message_2317, source: null, - stack: JSCompiler_object_inline_componentStack_2340 + stack: JSCompiler_object_inline_componentStack_2320 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9003,25 +9166,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2340 = + (JSCompiler_object_inline_componentStack_2320 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2340) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2320) ) { - JSCompiler_object_inline_componentStack_2340 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2340) { - JSCompiler_object_inline_stack_2339 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2339 & 42)) - JSCompiler_object_inline_stack_2339 = 1; + JSCompiler_object_inline_componentStack_2320 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2320) { + JSCompiler_object_inline_stack_2319 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2319 & 42)) + JSCompiler_object_inline_stack_2319 = 1; else - switch (JSCompiler_object_inline_stack_2339) { + switch (JSCompiler_object_inline_stack_2319) { case 2: - JSCompiler_object_inline_stack_2339 = 1; + JSCompiler_object_inline_stack_2319 = 1; break; case 8: - JSCompiler_object_inline_stack_2339 = 4; + JSCompiler_object_inline_stack_2319 = 4; break; case 32: - JSCompiler_object_inline_stack_2339 = 16; + JSCompiler_object_inline_stack_2319 = 16; break; case 128: case 256: @@ -9042,40 +9205,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2339 = 64; + JSCompiler_object_inline_stack_2319 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2339 = 134217728; + JSCompiler_object_inline_stack_2319 = 134217728; break; default: - JSCompiler_object_inline_stack_2339 = 0; + JSCompiler_object_inline_stack_2319 = 0; } - JSCompiler_object_inline_stack_2339 = + JSCompiler_object_inline_stack_2319 = 0 !== - (JSCompiler_object_inline_stack_2339 & - (JSCompiler_object_inline_componentStack_2340.suspendedLanes | + (JSCompiler_object_inline_stack_2319 & + (JSCompiler_object_inline_componentStack_2320.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2339; + : JSCompiler_object_inline_stack_2319; if ( - 0 !== JSCompiler_object_inline_stack_2339 && - JSCompiler_object_inline_stack_2339 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2319 && + JSCompiler_object_inline_stack_2319 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2339), + ((prevState.retryLane = JSCompiler_object_inline_stack_2319), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2319 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2320, current, - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2319 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2338.data === + JSCompiler_object_inline_digest_2318.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9083,7 +9246,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2338.data === + JSCompiler_object_inline_digest_2318.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9091,12 +9254,12 @@ null, current )), - (JSCompiler_object_inline_digest_2338._reactRetry = + (JSCompiler_object_inline_digest_2318._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2338.nextSibling + JSCompiler_object_inline_digest_2318.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9114,54 +9277,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2339.children + JSCompiler_object_inline_stack_2319.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2337) + if (JSCompiler_object_inline_message_2317) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2337 = - JSCompiler_object_inline_stack_2339.fallback), - (JSCompiler_object_inline_digest_2338 = workInProgress.mode), + (JSCompiler_object_inline_message_2317 = + JSCompiler_object_inline_stack_2319.fallback), + (JSCompiler_object_inline_digest_2318 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2339 = createWorkInProgress( + (JSCompiler_object_inline_stack_2319 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2339.children + children: JSCompiler_object_inline_stack_2319.children } )), - (JSCompiler_object_inline_stack_2339.subtreeFlags = + (JSCompiler_object_inline_stack_2319.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2337 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2317 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2337 + JSCompiler_object_inline_message_2317 )) - : ((JSCompiler_object_inline_message_2337 = createFiberFromFragment( - JSCompiler_object_inline_message_2337, - JSCompiler_object_inline_digest_2338, + : ((JSCompiler_object_inline_message_2317 = createFiberFromFragment( + JSCompiler_object_inline_message_2317, + JSCompiler_object_inline_digest_2318, renderLanes, null )), - (JSCompiler_object_inline_message_2337.flags |= 2)), - (JSCompiler_object_inline_message_2337.return = workInProgress), - (JSCompiler_object_inline_stack_2339.return = workInProgress), - (JSCompiler_object_inline_stack_2339.sibling = - JSCompiler_object_inline_message_2337), - (workInProgress.child = JSCompiler_object_inline_stack_2339), - (JSCompiler_object_inline_stack_2339 = - JSCompiler_object_inline_message_2337), - (JSCompiler_object_inline_message_2337 = workInProgress.child), - (JSCompiler_object_inline_digest_2338 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2338 - ? (JSCompiler_object_inline_digest_2338 = + (JSCompiler_object_inline_message_2317.flags |= 2)), + (JSCompiler_object_inline_message_2317.return = workInProgress), + (JSCompiler_object_inline_stack_2319.return = workInProgress), + (JSCompiler_object_inline_stack_2319.sibling = + JSCompiler_object_inline_message_2317), + (workInProgress.child = JSCompiler_object_inline_stack_2319), + (JSCompiler_object_inline_stack_2319 = + JSCompiler_object_inline_message_2317), + (JSCompiler_object_inline_message_2317 = workInProgress.child), + (JSCompiler_object_inline_digest_2318 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2318 + ? (JSCompiler_object_inline_digest_2318 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2338.cachePool), + JSCompiler_object_inline_digest_2318.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9169,38 +9332,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2338 = { + (JSCompiler_object_inline_digest_2318 = { baseLanes: - JSCompiler_object_inline_digest_2338.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2318.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2337.memoizedState = - JSCompiler_object_inline_digest_2338), - (JSCompiler_object_inline_message_2337.childLanes = + (JSCompiler_object_inline_message_2317.memoizedState = + JSCompiler_object_inline_digest_2318), + (JSCompiler_object_inline_message_2317.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2320, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2319 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2339.children + children: JSCompiler_object_inline_stack_2319.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2340 = + ((JSCompiler_object_inline_componentStack_2320 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2340 + null === JSCompiler_object_inline_componentStack_2320 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2340.push(current)); + : JSCompiler_object_inline_componentStack_2320.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10485,7 +10648,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -10774,6 +10941,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10784,128 +10961,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10913,101 +11504,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -11090,342 +11586,89 @@ (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (current = 0; current < finishedWork.length; current++) - (flags = finishedWork[current]), - (flags.ref.impl = flags.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.updateQueue), + (root = null !== root ? root.events : null), + null !== root) ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); } - parentFiber = parentFiber.return; + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; + } + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11441,17 +11684,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11465,21 +11718,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11487,11 +11744,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11507,59 +11760,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11567,11 +11825,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11581,11 +11835,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11608,78 +11858,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11759,14 +11937,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11812,7 +12013,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11822,14 +12025,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11897,7 +12104,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11946,74 +12157,53 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + function commitMutationEffectsOnFiber(finishedWork, root) { var current = finishedWork.alternate, flags = finishedWork.flags; switch (finishedWork.tag) { @@ -12021,53 +12211,31 @@ case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, finishedWork, - finishedWork.return, - error$10 - ); - } - } + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12084,116 +12252,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -12202,9 +12372,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -12219,117 +12389,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -12338,23 +12476,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -12362,7 +12503,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -12371,13 +12512,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -12387,12 +12528,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12408,15 +12549,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12424,13 +12565,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12439,47 +12580,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12510,7 +12650,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12521,7 +12661,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12529,52 +12669,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12594,27 +12689,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12697,24 +12778,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12731,7 +12816,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12740,9 +12825,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12779,9 +12888,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12789,22 +12896,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12835,9 +12926,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12884,9 +12973,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12895,18 +12984,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12950,9 +13037,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12985,9 +13070,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12997,11 +13082,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -13039,62 +13122,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -13155,25 +13221,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -13190,11 +13237,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -13238,7 +13281,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -13268,22 +13311,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -13292,33 +13350,8 @@ nextEffect = sibling; break a; } - nextEffect = returnFiber; - } - } - } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); + nextEffect = returnFiber; + } } } function FiberNode(tag, pendingProps, key, mode) { @@ -13400,7 +13433,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13453,7 +13487,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13684,12 +13719,12 @@ ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14668,7 +14703,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14710,7 +14746,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14735,7 +14772,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14767,11 +14809,14 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -14783,7 +14828,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14797,13 +14843,17 @@ default: throw Error("Unknown root exit status."); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( renderWasConcurrent, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); else { if ( @@ -14817,7 +14867,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14829,7 +14880,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14842,7 +14896,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14897,7 +14954,10 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14913,10 +14973,13 @@ root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14924,31 +14987,33 @@ recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -14964,26 +15029,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (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 && @@ -15013,13 +15083,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -15030,7 +15105,9 @@ workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -15072,9 +15149,11 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -15197,7 +15276,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -15245,15 +15325,21 @@ null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -15309,7 +15395,12 @@ case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -15341,7 +15432,12 @@ replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -15373,12 +15469,22 @@ } workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); break; case SuspendedOnDeprecatedThrowPromise: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); break; case SuspendedOnHydration: resetWorkInProgressStack(); @@ -15393,8 +15499,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -15519,43 +15625,20 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -15589,12 +15672,46 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15607,7 +15724,9 @@ transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -15621,7 +15740,9 @@ transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15650,7 +15771,14 @@ root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -15666,34 +15794,34 @@ return null; })); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitBeforeMutationEffects(root, finishedWork); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - ReactDOMSharedInternals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = ReactDOMSharedInternals.p), + (ReactDOMSharedInternals.p = DiscreteEventPriority), + (updatedLanes = executionContext), + (executionContext |= CommitContext), + commitBeforeMutationEffects(root, finishedWork), + (commitTime = now()), + commitMutationEffects(root, finishedWork, lanes), + restoreSelection(selectionInformation), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (ReactDOMSharedInternals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : ((root.current = finishedWork), (commitTime = now())); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -15792,55 +15920,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15986,6 +16099,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -16005,7 +16119,9 @@ now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -19444,6 +19560,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -19467,6 +19615,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19667,6 +19836,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function getBoundingRect(node) { node = node.getBoundingClientRect(); return { @@ -19770,6 +19945,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -20486,6 +20692,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -22571,6 +22778,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -24153,84 +24367,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -24298,6 +24442,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -24317,7 +24524,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -24373,6 +24580,7 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -24380,6 +24588,7 @@ workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -24949,11 +25158,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-94e652d5-20240912" !== 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-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24990,11 +25199,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-94e652d5-20240912" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25304,5 +25513,5 @@ } }; }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js index f126ef43e4d07..fdb7330d8de78 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js @@ -597,28 +597,40 @@ 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; } @@ -684,39 +696,53 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[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); } - noLongerPendingLanes &= ~lane; + 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; @@ -731,10 +757,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; } } @@ -970,8 +996,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; } @@ -1304,15 +1330,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; @@ -2041,19 +2067,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$291; + var JSCompiler_inline_result$jscomp$284; if (canUseDOM) { - var isSupported$jscomp$inline_430 = "oninput" in document; - if (!isSupported$jscomp$inline_430) { - var element$jscomp$inline_431 = document.createElement("div"); - element$jscomp$inline_431.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_430 = - "function" === typeof element$jscomp$inline_431.oninput; + var isSupported$jscomp$inline_423 = "oninput" in document; + if (!isSupported$jscomp$inline_423) { + var element$jscomp$inline_424 = document.createElement("div"); + element$jscomp$inline_424.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_423 = + "function" === typeof element$jscomp$inline_424.oninput; } - JSCompiler_inline_result$jscomp$291 = isSupported$jscomp$inline_430; - } else JSCompiler_inline_result$jscomp$291 = !1; + JSCompiler_inline_result$jscomp$284 = isSupported$jscomp$inline_423; + } else JSCompiler_inline_result$jscomp$284 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$291 && + JSCompiler_inline_result$jscomp$284 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -3802,9 +3828,15 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); numberOfReRenders += 1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } ReactSharedInternals.H = HooksDispatcherOnRerender; - var children = Component(props, secondArg); + children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -3987,7 +4019,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 ( @@ -4008,11 +4040,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 = { @@ -4058,7 +4090,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$54 && + didReadFromEntangledAsyncAction$55 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4256,8 +4288,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) { @@ -4448,17 +4480,16 @@ function rerenderActionState(action) { function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function updateRef() { @@ -4695,14 +4726,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; @@ -5129,6 +5160,108 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +} +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; +} +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$68 in Component) + void 0 === newProps[propName$68] && + (newProps[propName$68] = Component[propName$68]); + } + return newProps; +} var reportGlobalError = "function" === typeof reportError ? reportError @@ -5171,9 +5304,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$67) { + } catch (e$69) { setTimeout(function () { - throw e$67; + throw e$69; }); } } @@ -5184,9 +5317,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$68) { + } catch (e$70) { setTimeout(function () { - throw e$68; + throw e$70; }); } } @@ -5674,6 +5807,7 @@ function replayFunctionComponent( renderLanes ) { prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -7526,113 +7660,65 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$112 in Component) - void 0 === newProps[propName$112] && - (newProps[propName$112] = Component[propName$112]); +} +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -7688,8 +7774,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$113) { - captureCommitPhaseError(current, nearestMountedAncestor, error$113); + } catch (error$115) { + captureCommitPhaseError(current, nearestMountedAncestor, error$115); } else ref.current = null; } @@ -7700,32 +7786,136 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } -var shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - eventsEnabled = _enabled; - root = getActiveElementDeep(); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + eventsEnabled = _enabled; + root = getActiveElementDeep(); + if (hasSelectionCapabilities(root)) { + if ("selectionStart" in root) + var JSCompiler_temp = { + start: root.selectionStart, + end: root.selectionEnd + }; + else + a: { + JSCompiler_temp = + ((JSCompiler_temp = root.ownerDocument) && + JSCompiler_temp.defaultView) || + window; + var selection = + JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); + if (selection && 0 !== selection.rangeCount) { + JSCompiler_temp = selection.anchorNode; + var anchorOffset = selection.anchorOffset, focusNode = selection.focusNode; selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$19) { + } catch (e$20) { JSCompiler_temp = null; break a; } @@ -7781,69 +7971,82 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + if ( + 0 !== (root & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -7853,85 +8056,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - finishedWork = finishedWork.updateQueue; - finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; - if (null !== finishedWork) { - var effect = (finishedWork = finishedWork.next); - do { - if ((effect.tag & flags) === flags) { - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7940,7 +8067,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 11: case 15: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); + flags & 4 && commitHookEffectListMount(5, finishedWork); break; case 1: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7963,11 +8090,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$115) { + } catch (error$114) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$115 + error$114 ); } } @@ -8001,11 +8128,28 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8059,75 +8203,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -8175,8 +8250,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8185,35 +8264,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$123 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$123; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8242,18 +8341,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$123 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$123 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$123 & 4) && ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, @@ -8359,39 +8458,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8409,19 +8504,10 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$127) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$127); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8446,56 +8532,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8503,36 +8588,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8540,16 +8625,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8564,64 +8649,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$128) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$128 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8630,24 +8714,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$129) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$129); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$131) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$131); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8656,12 +8737,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$132) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$132); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8675,8 +8756,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$133) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$133); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -8707,15 +8788,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8723,13 +8804,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -8738,45 +8819,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$117) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$117 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -8826,11 +8906,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -8843,21 +8923,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$118 = JSCompiler_inline_result.stateNode; + var parent$116 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$118, ""), + (setTextContent(parent$116, ""), (JSCompiler_inline_result.flags &= -33)); - var before$119 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$119, parent$118); + var before$117 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$117, parent$116); break; case 3: case 4: - var parent$120 = JSCompiler_inline_result.stateNode.containerInfo, - before$121 = getHostSibling(finishedWork); + var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, + before$119 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$121, - parent$120 + before$119, + parent$118 ); break; default: @@ -8946,7 +9026,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -8954,23 +9034,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8988,7 +9075,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -8997,6 +9084,23 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -9027,13 +9131,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -9089,7 +9186,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -9186,7 +9283,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: break; @@ -9713,12 +9810,12 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -9735,14 +9832,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$136 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$136 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$143 + null === lastTailNode$136 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$143.sibling = null); + : (lastTailNode$136.sibling = null); } } function bubbleProperties(completedWork) { @@ -9752,19 +9849,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$144 = completedWork.child; null !== child$144; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags & 31457280), - (subtreeFlags |= child$144.flags & 31457280), - (child$144.return = completedWork), - (child$144 = child$144.sibling); + for (var child$137 = completedWork.child; null !== child$137; ) + (newChildLanes |= child$137.lanes | child$137.childLanes), + (subtreeFlags |= child$137.subtreeFlags & 31457280), + (subtreeFlags |= child$137.flags & 31457280), + (child$137.return = completedWork), + (child$137 = child$137.sibling); else - for (child$144 = completedWork.child; null !== child$144; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags), - (subtreeFlags |= child$144.flags), - (child$144.return = completedWork), - (child$144 = child$144.sibling); + for (child$137 = completedWork.child; null !== child$137; ) + (newChildLanes |= child$137.lanes | child$137.childLanes), + (subtreeFlags |= child$137.subtreeFlags), + (subtreeFlags |= child$137.flags), + (child$137.return = completedWork), + (child$137 = child$137.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10041,11 +10138,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$156 = null; + var cache$149 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$156 = newProps.memoizedState.cachePool.pool); - cache$156 !== type && (newProps.flags |= 2048); + (cache$149 = newProps.memoizedState.cachePool.pool); + cache$149 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10070,8 +10167,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$156 = type.rendering; - if (null === cache$156) + cache$149 = type.rendering; + if (null === cache$149) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10079,11 +10176,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$156 = findFirstSuspended(current); - if (null !== cache$156) { + cache$149 = findFirstSuspended(current); + if (null !== cache$149) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$156.updateQueue; + current = cache$149.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10108,7 +10205,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$156)), null !== current)) { + if (((current = findFirstSuspended(cache$149)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10118,7 +10215,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$156.alternate && + !cache$149.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10131,13 +10228,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$156.sibling = workInProgress.child), - (workInProgress.child = cache$156)) + ? ((cache$149.sibling = workInProgress.child), + (workInProgress.child = cache$149)) : ((current = type.last), null !== current - ? (current.sibling = cache$156) - : (workInProgress.child = cache$156), - (type.last = cache$156)); + ? (current.sibling = cache$149) + : (workInProgress.child = cache$149), + (type.last = cache$149)); } if (null !== type.tail) return ( @@ -10496,6 +10593,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10503,6 +10601,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -10546,7 +10645,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10557,7 +10657,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10579,7 +10680,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10611,11 +10718,14 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -10627,7 +10737,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10641,6 +10752,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { default: throw Error(formatProdErrorMessage(329)); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && ((didTimeout = globalMostRecentFallbackTime + 300 - now()), @@ -10649,7 +10762,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10661,7 +10775,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10674,7 +10791,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10726,7 +10846,10 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10742,10 +10865,13 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10753,31 +10879,33 @@ function commitRootWhenReady( recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -10793,25 +10921,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : 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 && @@ -10838,13 +10969,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -10855,7 +10991,9 @@ function performSyncWorkOnRoot(root, lanes) { workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -10897,8 +11035,10 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -10915,9 +11055,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; @@ -10987,7 +11127,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -11019,15 +11160,16 @@ function renderRootSync(root, lanes) { null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); break; - } catch (thrownValue$172) { - handleThrow(root, thrownValue$172); + } catch (thrownValue$165) { + handleThrow(root, thrownValue$165); } while (1); lanes && root.shellSuspendCounter++; @@ -11062,7 +11204,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 1); break; case 2: if (isThenableResolved(thrownValue)) { @@ -11092,7 +11234,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 7)); break; case 5: var resource = null; @@ -11119,12 +11261,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 6); break; case 8: resetWorkInProgressStack(); @@ -11136,8 +11278,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$174) { - handleThrow(root, thrownValue$174); + } catch (thrownValue$167) { + handleThrow(root, thrownValue$167); } while (1); resetContextDependencies(); @@ -11229,31 +11371,20 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } unitOfWork = completedWork.return; var next = completeWork( completedWork.alternate, @@ -11273,12 +11404,37 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11291,7 +11447,9 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -11305,7 +11463,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11321,7 +11481,14 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11337,25 +11504,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); - _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), + (_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), @@ -11395,7 +11562,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$178 = rootWithPendingPassiveEffects, + var root$171 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11434,7 +11601,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$178, remainingLanes); + releaseRootPooledCache(root$171, remainingLanes); } } return !1; @@ -11505,6 +11672,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -11517,7 +11685,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -11590,14 +11760,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$180 = firstScheduledRoot; null !== root$180; ) { + for (var root$173 = firstScheduledRoot; null !== root$173; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$180.pendingLanes; + var pendingLanes = root$173.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$180.suspendedLanes, - pingedLanes = root$180.pingedLanes; + var suspendedLanes = root$173.suspendedLanes, + pingedLanes = root$173.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11611,17 +11781,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$180, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$173, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$180, - root$180 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$173, + root$173 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$180, JSCompiler_inline_result)); - root$180 = root$180.next; + performSyncWorkOnRoot(root$173, JSCompiler_inline_result)); + root$173 = root$173.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11662,12 +11832,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; } @@ -11831,20 +12001,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1417 = 0; - i$jscomp$inline_1417 < simpleEventPluginEvents.length; - i$jscomp$inline_1417++ + var i$jscomp$inline_1429 = 0; + i$jscomp$inline_1429 < simpleEventPluginEvents.length; + i$jscomp$inline_1429++ ) { - var eventName$jscomp$inline_1418 = - simpleEventPluginEvents[i$jscomp$inline_1417], - domEventName$jscomp$inline_1419 = - eventName$jscomp$inline_1418.toLowerCase(), - capitalizedEvent$jscomp$inline_1420 = - eventName$jscomp$inline_1418[0].toUpperCase() + - eventName$jscomp$inline_1418.slice(1); + var eventName$jscomp$inline_1430 = + simpleEventPluginEvents[i$jscomp$inline_1429], + domEventName$jscomp$inline_1431 = + eventName$jscomp$inline_1430.toLowerCase(), + capitalizedEvent$jscomp$inline_1432 = + eventName$jscomp$inline_1430[0].toUpperCase() + + eventName$jscomp$inline_1430.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1419, - "on" + capitalizedEvent$jscomp$inline_1420 + domEventName$jscomp$inline_1431, + "on" + capitalizedEvent$jscomp$inline_1432 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13027,34 +13197,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$194 = props[hasSrc]; - if (null != propValue$194) + var propValue$187 = props[hasSrc]; + if (null != propValue$187) switch (hasSrc) { case "name": - hasSrcSet = propValue$194; + hasSrcSet = propValue$187; break; case "type": - propValue = propValue$194; + propValue = propValue$187; break; case "checked": - checked = propValue$194; + checked = propValue$187; break; case "defaultChecked": - defaultChecked = propValue$194; + defaultChecked = propValue$187; break; case "value": - propKey = propValue$194; + propKey = propValue$187; break; case "defaultValue": - defaultValue = propValue$194; + defaultValue = propValue$187; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$194) + if (null != propValue$187) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$194, props, null); + setProp(domElement, tag, hasSrc, propValue$187, props, null); } } initInput( @@ -13191,14 +13361,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$194 in props) - props.hasOwnProperty(propValue$194) && - ((hasSrc = props[propValue$194]), + for (propValue$187 in props) + props.hasOwnProperty(propValue$187) && + ((hasSrc = props[propValue$187]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$194, + propValue$187, hasSrc, props, void 0 @@ -13246,14 +13416,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$211 in nextProps) { - var propKey = nextProps[propKey$211]; - lastProp = lastProps[propKey$211]; + for (var propKey$204 in nextProps) { + var propKey = nextProps[propKey$204]; + lastProp = lastProps[propKey$204]; if ( - nextProps.hasOwnProperty(propKey$211) && + nextProps.hasOwnProperty(propKey$204) && (null != propKey || null != lastProp) ) - switch (propKey$211) { + switch (propKey$204) { case "type": type = propKey; break; @@ -13282,7 +13452,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$211, + propKey$204, propKey, nextProps, lastProp @@ -13301,7 +13471,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$211 = null; + propKey = value = defaultValue = propKey$204 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13332,7 +13502,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$211 = type; + propKey$204 = type; break; case "defaultValue": defaultValue = type; @@ -13353,15 +13523,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$211 - ? updateOptions(domElement, !!lastProps, propKey$211, !1) + null != propKey$204 + ? updateOptions(domElement, !!lastProps, propKey$204, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$211 = null; + propKey = propKey$204 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13385,7 +13555,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$211 = name; + propKey$204 = name; break; case "defaultValue": propKey = name; @@ -13399,17 +13569,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$211, propKey); + updateTextarea(domElement, propKey$204, propKey); return; case "option": - for (var propKey$227 in lastProps) + for (var propKey$220 in lastProps) if ( - ((propKey$211 = lastProps[propKey$227]), - lastProps.hasOwnProperty(propKey$227) && - null != propKey$211 && - !nextProps.hasOwnProperty(propKey$227)) + ((propKey$204 = lastProps[propKey$220]), + lastProps.hasOwnProperty(propKey$220) && + null != propKey$204 && + !nextProps.hasOwnProperty(propKey$220)) ) - switch (propKey$227) { + switch (propKey$220) { case "selected": domElement.selected = !1; break; @@ -13417,33 +13587,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$227, + propKey$220, null, nextProps, - propKey$211 + propKey$204 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$211 = nextProps[lastDefaultValue]), + ((propKey$204 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$211 !== propKey && - (null != propKey$211 || null != propKey)) + propKey$204 !== propKey && + (null != propKey$204 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$211 && - "function" !== typeof propKey$211 && - "symbol" !== typeof propKey$211; + propKey$204 && + "function" !== typeof propKey$204 && + "symbol" !== typeof propKey$204; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$211, + propKey$204, nextProps, propKey ); @@ -13464,24 +13634,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$232 in lastProps) - (propKey$211 = lastProps[propKey$232]), - lastProps.hasOwnProperty(propKey$232) && - null != propKey$211 && - !nextProps.hasOwnProperty(propKey$232) && - setProp(domElement, tag, propKey$232, null, nextProps, propKey$211); + for (var propKey$225 in lastProps) + (propKey$204 = lastProps[propKey$225]), + lastProps.hasOwnProperty(propKey$225) && + null != propKey$204 && + !nextProps.hasOwnProperty(propKey$225) && + setProp(domElement, tag, propKey$225, null, nextProps, propKey$204); for (checked in nextProps) if ( - ((propKey$211 = nextProps[checked]), + ((propKey$204 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$211 !== propKey && - (null != propKey$211 || null != propKey)) + propKey$204 !== propKey && + (null != propKey$204 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$211) + if (null != propKey$204) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13489,7 +13659,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$211, + propKey$204, nextProps, propKey ); @@ -13497,49 +13667,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$237 in lastProps) - (propKey$211 = lastProps[propKey$237]), - lastProps.hasOwnProperty(propKey$237) && - void 0 !== propKey$211 && - !nextProps.hasOwnProperty(propKey$237) && + for (var propKey$230 in lastProps) + (propKey$204 = lastProps[propKey$230]), + lastProps.hasOwnProperty(propKey$230) && + void 0 !== propKey$204 && + !nextProps.hasOwnProperty(propKey$230) && setPropOnCustomElement( domElement, tag, - propKey$237, + propKey$230, void 0, nextProps, - propKey$211 + propKey$204 ); for (defaultChecked in nextProps) - (propKey$211 = nextProps[defaultChecked]), + (propKey$204 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$211 === propKey || - (void 0 === propKey$211 && void 0 === propKey) || + propKey$204 === propKey || + (void 0 === propKey$204 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$211, + propKey$204, nextProps, propKey ); return; } } - for (var propKey$242 in lastProps) - (propKey$211 = lastProps[propKey$242]), - lastProps.hasOwnProperty(propKey$242) && - null != propKey$211 && - !nextProps.hasOwnProperty(propKey$242) && - setProp(domElement, tag, propKey$242, null, nextProps, propKey$211); + for (var propKey$235 in lastProps) + (propKey$204 = lastProps[propKey$235]), + lastProps.hasOwnProperty(propKey$235) && + null != propKey$204 && + !nextProps.hasOwnProperty(propKey$235) && + setProp(domElement, tag, propKey$235, null, nextProps, propKey$204); for (lastProp in nextProps) - (propKey$211 = nextProps[lastProp]), + (propKey$204 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$211 === propKey || - (null == propKey$211 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$211, nextProps, propKey); + propKey$204 === propKey || + (null == propKey$204 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$204, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14141,26 +14311,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$250 = getResourcesFromRoot( + var styles$243 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$251 = styles$250.get(type); - resource$251 || + resource$244 = styles$243.get(type); + resource$244 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$251 = { + (resource$244 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$250.set(type, resource$251), - (styles$250 = JSCompiler_inline_result.querySelector( + styles$243.set(type, resource$244), + (styles$243 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$250._p && - ((resource$251.instance = styles$250), - (resource$251.state.loading = 5)), + !styles$243._p && + ((resource$244.instance = styles$243), + (resource$244.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14173,16 +14343,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$250 || + styles$243 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$251.state + resource$244.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$251; + return resource$244; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14279,37 +14449,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$256 = hoistableRoot.querySelector( + var instance$249 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$256) + if (instance$249) return ( (resource.state.loading |= 4), - (resource.instance = instance$256), - markNodeAsHoistable(instance$256), - instance$256 + (resource.instance = instance$249), + markNodeAsHoistable(instance$249), + instance$249 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$256 = ( + instance$249 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$256); - var linkInstance = instance$256; + markNodeAsHoistable(instance$249); + var linkInstance = instance$249; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$256, "link", instance); + setInitialProperties(instance$249, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$256, props.precedence, hoistableRoot); - return (resource.instance = instance$256); + insertStylesheet(instance$249, props.precedence, hoistableRoot); + return (resource.instance = instance$249); case "script": - instance$256 = getScriptKey(props.src); + instance$249 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$256) + getScriptSelectorFromKey(instance$249) )) ) return ( @@ -14318,7 +14488,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$256))) + if ((styleProps = preloadPropsMap.get(instance$249))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14641,6 +14811,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -15341,16 +15512,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1664 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1676 = React.version; if ( - "19.0.0-experimental-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1664 + "19.0.0-experimental-94e652d5-20240912" !== + isomorphicReactPackageVersion$jscomp$inline_1676 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1664, - "19.0.0-experimental-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1676, + "19.0.0-experimental-94e652d5-20240912" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15370,25 +15541,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2077 = { +var internals$jscomp$inline_2119 = { bundleType: 0, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-94e652d5-20240912" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2078 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2120 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2078.isDisabled && - hook$jscomp$inline_2078.supportsFiber + !hook$jscomp$inline_2120.isDisabled && + hook$jscomp$inline_2120.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2078.inject( - internals$jscomp$inline_2077 + (rendererID = hook$jscomp$inline_2120.inject( + internals$jscomp$inline_2119 )), - (injectedHook = hook$jscomp$inline_2078); + (injectedHook = hook$jscomp$inline_2120); } catch (err) {} } exports.createComponentSelector = function (component) { @@ -15631,4 +15802,4 @@ exports.observeVisibleRects = function ( } }; }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js index b45f16a4441fa..5a69914e39b1b 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js @@ -416,7 +416,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js index 8c5bd8d2651e9..4eacc3eab5238 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js @@ -207,4 +207,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js index d57323bc53c71..28a11360f27ef 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js @@ -336,5 +336,5 @@ })) : Internals.d.m(href)); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js index 5c57438156f5f..a367b380326c7 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js @@ -149,4 +149,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom-experimental/package.json b/packages/next/src/compiled/react-dom-experimental/package.json index 05d7b4f62c03a..7dd19e06f42c4 100644 --- a/packages/next/src/compiled/react-dom-experimental/package.json +++ b/packages/next/src/compiled/react-dom-experimental/package.json @@ -72,10 +72,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.0.0-experimental-7771d3a7-20240827" + "scheduler": "0.0.0-experimental-94e652d5-20240912" }, "peerDependencies": { - "react": "0.0.0-experimental-7771d3a7-20240827" + "react": "0.0.0-experimental-94e652d5-20240912" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-dom-experimental/static.edge.js b/packages/next/src/compiled/react-dom-experimental/static.edge.js index de57d7a4c022e..ff770374b314a 100644 --- a/packages/next/src/compiled/react-dom-experimental/static.edge.js +++ b/packages/next/src/compiled/react-dom-experimental/static.edge.js @@ -9,3 +9,4 @@ if (process.env.NODE_ENV === 'production') { exports.version = s.version; exports.prerender = s.prerender; +exports.resumeAndPrerender = s.resumeAndPrerender; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js index 17b494b4e35fc..15ee4ea443494 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js @@ -1010,28 +1010,40 @@ 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; } @@ -1105,25 +1117,34 @@ for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } - function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index = 31 - clz32(noLongerPendingLanes), + var index = 31 - clz32(remainingLanes), lane = 1 << index; - remainingLanes[index] = 0; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1135,9 +1156,14 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + 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; @@ -3901,6 +3927,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5695,6 +5776,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -5745,10 +5834,16 @@ numberOfReRenders += 1; ignorePreviousDependencies = !1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } hookTypesUpdateIndexDev = -1; ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - var children = callComponentInDEV(Component, props, secondArg); + children = callComponentInDEV(Component, props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -6572,17 +6667,16 @@ function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function mountRef(initialValue) { @@ -7132,60 +7226,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error, errorInfo) { reportGlobalError(error); @@ -7787,8 +7949,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -7828,6 +7990,7 @@ hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -8017,8 +8180,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8447,32 +8610,32 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2299; - var JSCompiler_object_inline_stack_2300 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2277; + var JSCompiler_object_inline_stack_2278 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2301 = !1; + var JSCompiler_object_inline_componentStack_2279 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2299 = didSuspend) || - (JSCompiler_object_inline_digest_2299 = + (JSCompiler_object_inline_digest_2277 = didSuspend) || + (JSCompiler_object_inline_digest_2277 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2299 && - ((JSCompiler_object_inline_componentStack_2301 = !0), + JSCompiler_object_inline_digest_2277 && + ((JSCompiler_object_inline_componentStack_2279 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2299 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2277 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2301 + JSCompiler_object_inline_componentStack_2279 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2298 = nextHydratableInstance; + var JSCompiler_object_inline_message_2276 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2298)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2276)) { c: { - var instance = JSCompiler_object_inline_message_2298; + var instance = JSCompiler_object_inline_message_2276; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8513,19 +8676,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2298 + JSCompiler_object_inline_message_2276 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2298 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2276 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2298 && - ((JSCompiler_object_inline_message_2298 = - JSCompiler_object_inline_message_2298.dehydrated), - null !== JSCompiler_object_inline_message_2298) + null !== JSCompiler_object_inline_message_2276 && + ((JSCompiler_object_inline_message_2276 = + JSCompiler_object_inline_message_2276.dehydrated), + null !== JSCompiler_object_inline_message_2276) ) return ( - JSCompiler_object_inline_message_2298.data === + JSCompiler_object_inline_message_2276.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8533,58 +8696,58 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2298 = - JSCompiler_object_inline_stack_2300.children; - JSCompiler_object_inline_stack_2300 = - JSCompiler_object_inline_stack_2300.fallback; - if (JSCompiler_object_inline_componentStack_2301) + JSCompiler_object_inline_message_2276 = + JSCompiler_object_inline_stack_2278.children; + JSCompiler_object_inline_stack_2278 = + JSCompiler_object_inline_stack_2278.fallback; + if (JSCompiler_object_inline_componentStack_2279) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2301 = + (JSCompiler_object_inline_componentStack_2279 = workInProgress.mode), - (JSCompiler_object_inline_message_2298 = + (JSCompiler_object_inline_message_2276 = mountWorkInProgressOffscreenFiber( { mode: "hidden", - children: JSCompiler_object_inline_message_2298 + children: JSCompiler_object_inline_message_2276 }, - JSCompiler_object_inline_componentStack_2301 + JSCompiler_object_inline_componentStack_2279 )), - (JSCompiler_object_inline_stack_2300 = createFiberFromFragment( - JSCompiler_object_inline_stack_2300, - JSCompiler_object_inline_componentStack_2301, + (JSCompiler_object_inline_stack_2278 = createFiberFromFragment( + JSCompiler_object_inline_stack_2278, + JSCompiler_object_inline_componentStack_2279, renderLanes, null )), - (JSCompiler_object_inline_message_2298.return = workInProgress), - (JSCompiler_object_inline_stack_2300.return = workInProgress), - (JSCompiler_object_inline_message_2298.sibling = - JSCompiler_object_inline_stack_2300), - (workInProgress.child = JSCompiler_object_inline_message_2298), - (JSCompiler_object_inline_componentStack_2301 = + (JSCompiler_object_inline_message_2276.return = workInProgress), + (JSCompiler_object_inline_stack_2278.return = workInProgress), + (JSCompiler_object_inline_message_2276.sibling = + JSCompiler_object_inline_stack_2278), + (workInProgress.child = JSCompiler_object_inline_message_2276), + (JSCompiler_object_inline_componentStack_2279 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2301.memoizedState = + (JSCompiler_object_inline_componentStack_2279.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2301.childLanes = + (JSCompiler_object_inline_componentStack_2279.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2299, + JSCompiler_object_inline_digest_2277, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2300 + JSCompiler_object_inline_stack_2278 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2298 + JSCompiler_object_inline_message_2276 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2298 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2298) + ((JSCompiler_object_inline_message_2276 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2276) ) { if (didSuspend) workInProgress.flags & 256 @@ -8601,94 +8764,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2301 = - JSCompiler_object_inline_stack_2300.fallback), - (JSCompiler_object_inline_message_2298 = workInProgress.mode), - (JSCompiler_object_inline_stack_2300 = + (JSCompiler_object_inline_componentStack_2279 = + JSCompiler_object_inline_stack_2278.fallback), + (JSCompiler_object_inline_message_2276 = workInProgress.mode), + (JSCompiler_object_inline_stack_2278 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2300.children + children: JSCompiler_object_inline_stack_2278.children }, - JSCompiler_object_inline_message_2298 + JSCompiler_object_inline_message_2276 )), - (JSCompiler_object_inline_componentStack_2301 = + (JSCompiler_object_inline_componentStack_2279 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2301, - JSCompiler_object_inline_message_2298, + JSCompiler_object_inline_componentStack_2279, + JSCompiler_object_inline_message_2276, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2301.flags |= 2), - (JSCompiler_object_inline_stack_2300.return = workInProgress), - (JSCompiler_object_inline_componentStack_2301.return = + (JSCompiler_object_inline_componentStack_2279.flags |= 2), + (JSCompiler_object_inline_stack_2278.return = workInProgress), + (JSCompiler_object_inline_componentStack_2279.return = workInProgress), - (JSCompiler_object_inline_stack_2300.sibling = - JSCompiler_object_inline_componentStack_2301), - (workInProgress.child = JSCompiler_object_inline_stack_2300), + (JSCompiler_object_inline_stack_2278.sibling = + JSCompiler_object_inline_componentStack_2279), + (workInProgress.child = JSCompiler_object_inline_stack_2278), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2300 = workInProgress.child), - (JSCompiler_object_inline_stack_2300.memoizedState = + (JSCompiler_object_inline_stack_2278 = workInProgress.child), + (JSCompiler_object_inline_stack_2278.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2300.childLanes = + (JSCompiler_object_inline_stack_2278.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2299, + JSCompiler_object_inline_digest_2277, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2301)); + JSCompiler_object_inline_componentStack_2279)); 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_message_2298.data === + JSCompiler_object_inline_message_2276.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2299 = - JSCompiler_object_inline_message_2298.nextSibling && - JSCompiler_object_inline_message_2298.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2299) { - JSCompiler_temp = JSCompiler_object_inline_digest_2299.dgst; - var message = JSCompiler_object_inline_digest_2299.msg; - instance = JSCompiler_object_inline_digest_2299.stck; - var componentStack = JSCompiler_object_inline_digest_2299.cstck; + JSCompiler_object_inline_digest_2277 = + JSCompiler_object_inline_message_2276.nextSibling && + JSCompiler_object_inline_message_2276.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2277) { + JSCompiler_temp = JSCompiler_object_inline_digest_2277.dgst; + var message = JSCompiler_object_inline_digest_2277.msg; + instance = JSCompiler_object_inline_digest_2277.stck; + var componentStack = JSCompiler_object_inline_digest_2277.cstck; } - JSCompiler_object_inline_message_2298 = message; - JSCompiler_object_inline_digest_2299 = JSCompiler_temp; - JSCompiler_object_inline_stack_2300 = instance; - JSCompiler_object_inline_componentStack_2301 = componentStack; - JSCompiler_object_inline_message_2298 = - JSCompiler_object_inline_message_2298 - ? Error(JSCompiler_object_inline_message_2298) + JSCompiler_object_inline_message_2276 = message; + JSCompiler_object_inline_digest_2277 = JSCompiler_temp; + JSCompiler_object_inline_stack_2278 = instance; + JSCompiler_object_inline_componentStack_2279 = componentStack; + JSCompiler_object_inline_message_2276 = + JSCompiler_object_inline_message_2276 + ? Error(JSCompiler_object_inline_message_2276) : 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_2298.stack = - JSCompiler_object_inline_stack_2300 || ""; - JSCompiler_object_inline_message_2298.digest = - JSCompiler_object_inline_digest_2299; - JSCompiler_object_inline_digest_2299 = - void 0 === JSCompiler_object_inline_componentStack_2301 + JSCompiler_object_inline_message_2276.stack = + JSCompiler_object_inline_stack_2278 || ""; + JSCompiler_object_inline_message_2276.digest = + JSCompiler_object_inline_digest_2277; + JSCompiler_object_inline_digest_2277 = + void 0 === JSCompiler_object_inline_componentStack_2279 ? null - : JSCompiler_object_inline_componentStack_2301; - "string" === typeof JSCompiler_object_inline_digest_2299 && + : JSCompiler_object_inline_componentStack_2279; + "string" === typeof JSCompiler_object_inline_digest_2277 && CapturedStacks.set( - JSCompiler_object_inline_message_2298, - JSCompiler_object_inline_digest_2299 + JSCompiler_object_inline_message_2276, + JSCompiler_object_inline_digest_2277 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2298, + value: JSCompiler_object_inline_message_2276, source: null, - stack: JSCompiler_object_inline_digest_2299 + stack: JSCompiler_object_inline_digest_2277 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8696,25 +8859,25 @@ renderLanes ); } else if ( - ((JSCompiler_object_inline_digest_2299 = + ((JSCompiler_object_inline_digest_2277 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2299) + didReceiveUpdate || JSCompiler_object_inline_digest_2277) ) { - JSCompiler_object_inline_digest_2299 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2299) { - JSCompiler_object_inline_stack_2300 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2300 & 42)) - JSCompiler_object_inline_stack_2300 = 1; + JSCompiler_object_inline_digest_2277 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2277) { + JSCompiler_object_inline_stack_2278 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2278 & 42)) + JSCompiler_object_inline_stack_2278 = 1; else - switch (JSCompiler_object_inline_stack_2300) { + switch (JSCompiler_object_inline_stack_2278) { case 2: - JSCompiler_object_inline_stack_2300 = 1; + JSCompiler_object_inline_stack_2278 = 1; break; case 8: - JSCompiler_object_inline_stack_2300 = 4; + JSCompiler_object_inline_stack_2278 = 4; break; case 32: - JSCompiler_object_inline_stack_2300 = 16; + JSCompiler_object_inline_stack_2278 = 16; break; case 128: case 256: @@ -8735,40 +8898,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2300 = 64; + JSCompiler_object_inline_stack_2278 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2300 = 134217728; + JSCompiler_object_inline_stack_2278 = 134217728; break; default: - JSCompiler_object_inline_stack_2300 = 0; + JSCompiler_object_inline_stack_2278 = 0; } - JSCompiler_object_inline_stack_2300 = + JSCompiler_object_inline_stack_2278 = 0 !== - (JSCompiler_object_inline_stack_2300 & - (JSCompiler_object_inline_digest_2299.suspendedLanes | + (JSCompiler_object_inline_stack_2278 & + (JSCompiler_object_inline_digest_2277.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2300; + : JSCompiler_object_inline_stack_2278; if ( - 0 !== JSCompiler_object_inline_stack_2300 && - JSCompiler_object_inline_stack_2300 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2278 && + JSCompiler_object_inline_stack_2278 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2300), + ((prevState.retryLane = JSCompiler_object_inline_stack_2278), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2300 + JSCompiler_object_inline_stack_2278 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2299, + JSCompiler_object_inline_digest_2277, current, - JSCompiler_object_inline_stack_2300 + JSCompiler_object_inline_stack_2278 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2298.data === + JSCompiler_object_inline_message_2276.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8776,7 +8939,7 @@ renderLanes ); } else - JSCompiler_object_inline_message_2298.data === + JSCompiler_object_inline_message_2276.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -8784,12 +8947,12 @@ null, current )), - (JSCompiler_object_inline_message_2298._reactRetry = + (JSCompiler_object_inline_message_2276._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2298.nextSibling + JSCompiler_object_inline_message_2276.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -8807,57 +8970,57 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2300.children + JSCompiler_object_inline_stack_2278.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2301) + if (JSCompiler_object_inline_componentStack_2279) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2301 = - JSCompiler_object_inline_stack_2300.fallback), - (JSCompiler_object_inline_message_2298 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2279 = + JSCompiler_object_inline_stack_2278.fallback), + (JSCompiler_object_inline_message_2276 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2300 = createWorkInProgress( + (JSCompiler_object_inline_stack_2278 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2300.children + children: JSCompiler_object_inline_stack_2278.children } )), - (JSCompiler_object_inline_stack_2300.subtreeFlags = + (JSCompiler_object_inline_stack_2278.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2301 = + ? (JSCompiler_object_inline_componentStack_2279 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2301 + JSCompiler_object_inline_componentStack_2279 )) - : ((JSCompiler_object_inline_componentStack_2301 = + : ((JSCompiler_object_inline_componentStack_2279 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2301, - JSCompiler_object_inline_message_2298, + JSCompiler_object_inline_componentStack_2279, + JSCompiler_object_inline_message_2276, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2301.flags |= 2)), - (JSCompiler_object_inline_componentStack_2301.return = + (JSCompiler_object_inline_componentStack_2279.flags |= 2)), + (JSCompiler_object_inline_componentStack_2279.return = workInProgress), - (JSCompiler_object_inline_stack_2300.return = workInProgress), - (JSCompiler_object_inline_stack_2300.sibling = - JSCompiler_object_inline_componentStack_2301), - (workInProgress.child = JSCompiler_object_inline_stack_2300), - (JSCompiler_object_inline_stack_2300 = - JSCompiler_object_inline_componentStack_2301), - (JSCompiler_object_inline_componentStack_2301 = workInProgress.child), - (JSCompiler_object_inline_message_2298 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2298 - ? (JSCompiler_object_inline_message_2298 = + (JSCompiler_object_inline_stack_2278.return = workInProgress), + (JSCompiler_object_inline_stack_2278.sibling = + JSCompiler_object_inline_componentStack_2279), + (workInProgress.child = JSCompiler_object_inline_stack_2278), + (JSCompiler_object_inline_stack_2278 = + JSCompiler_object_inline_componentStack_2279), + (JSCompiler_object_inline_componentStack_2279 = workInProgress.child), + (JSCompiler_object_inline_message_2276 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2276 + ? (JSCompiler_object_inline_message_2276 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2298.cachePool), + JSCompiler_object_inline_message_2276.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -8865,37 +9028,37 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2298 = { + (JSCompiler_object_inline_message_2276 = { baseLanes: - JSCompiler_object_inline_message_2298.baseLanes | renderLanes, + JSCompiler_object_inline_message_2276.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2301.memoizedState = - JSCompiler_object_inline_message_2298), - (JSCompiler_object_inline_componentStack_2301.childLanes = + (JSCompiler_object_inline_componentStack_2279.memoizedState = + JSCompiler_object_inline_message_2276), + (JSCompiler_object_inline_componentStack_2279.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2299, + JSCompiler_object_inline_digest_2277, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2300 + JSCompiler_object_inline_stack_2278 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2300.children + children: JSCompiler_object_inline_stack_2278.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2299 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2299 + ((JSCompiler_object_inline_digest_2277 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2277 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2299.push(current)); + : JSCompiler_object_inline_digest_2277.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10095,7 +10258,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -10383,6 +10550,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10393,128 +10570,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10522,101 +11113,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -10699,333 +11195,76 @@ (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11041,17 +11280,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11065,21 +11314,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11087,11 +11340,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11107,59 +11356,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11167,11 +11421,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11181,11 +11431,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11208,78 +11454,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11359,14 +11533,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11412,7 +11609,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11422,14 +11621,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11497,7 +11700,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11546,74 +11753,53 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + function commitMutationEffectsOnFiber(finishedWork, root) { var current = finishedWork.alternate, flags = finishedWork.flags; switch (finishedWork.tag) { @@ -11621,53 +11807,31 @@ case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, finishedWork, - finishedWork.return, - error$10 - ); - } - } + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -11684,116 +11848,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -11802,9 +11968,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -11819,117 +11985,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -11938,23 +12072,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -11962,7 +12099,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -11971,13 +12108,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -11987,12 +12124,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12008,15 +12145,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12024,13 +12161,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12039,47 +12176,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12110,7 +12246,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12121,7 +12257,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12129,52 +12265,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12194,27 +12285,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12297,24 +12374,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12331,7 +12412,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12340,9 +12421,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12379,9 +12484,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12389,22 +12492,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12435,9 +12522,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12484,9 +12569,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12495,18 +12580,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12550,9 +12633,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12585,9 +12666,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12597,11 +12678,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12639,62 +12718,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -12755,25 +12817,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -12790,11 +12833,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -12838,7 +12877,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -12868,22 +12907,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -12891,34 +12945,9 @@ sibling.return = returnFiber; nextEffect = sibling; break a; - } - nextEffect = returnFiber; - } - } - } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); + } + nextEffect = returnFiber; + } } } function FiberNode(tag, pendingProps, key, mode) { @@ -12994,7 +13023,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13047,7 +13077,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13276,12 +13307,12 @@ ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14078,7 +14109,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14120,7 +14152,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14145,7 +14178,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14177,11 +14215,14 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -14193,7 +14234,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14207,13 +14249,17 @@ default: throw Error("Unknown root exit status."); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( renderWasConcurrent, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); else { if ( @@ -14227,7 +14273,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14239,7 +14286,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14252,7 +14302,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14307,7 +14360,10 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14323,10 +14379,13 @@ root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14334,31 +14393,33 @@ recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -14374,26 +14435,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (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 && @@ -14423,13 +14489,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -14440,7 +14511,9 @@ workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -14482,9 +14555,11 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -14607,7 +14682,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -14650,15 +14726,21 @@ null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -14714,7 +14796,12 @@ case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -14746,7 +14833,12 @@ replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -14778,12 +14870,22 @@ } workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); break; case SuspendedOnDeprecatedThrowPromise: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); break; case SuspendedOnHydration: resetWorkInProgressStack(); @@ -14798,8 +14900,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -14924,43 +15026,20 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -14994,12 +15073,46 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15012,7 +15125,9 @@ transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -15026,7 +15141,9 @@ transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15055,7 +15172,14 @@ root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -15071,34 +15195,34 @@ return null; })); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitBeforeMutationEffects(root, finishedWork); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - ReactDOMSharedInternals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = ReactDOMSharedInternals.p), + (ReactDOMSharedInternals.p = DiscreteEventPriority), + (updatedLanes = executionContext), + (executionContext |= CommitContext), + commitBeforeMutationEffects(root, finishedWork), + (commitTime = now()), + commitMutationEffects(root, finishedWork, lanes), + restoreSelection(selectionInformation), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (ReactDOMSharedInternals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : ((root.current = finishedWork), (commitTime = now())); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -15197,55 +15321,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15391,6 +15500,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -15410,7 +15520,9 @@ now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -18838,6 +18950,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -18861,6 +19005,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19061,6 +19226,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function resolveSingletonInstance( type, props, @@ -19099,6 +19270,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -19847,6 +20049,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -21889,6 +22092,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23430,84 +23640,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -23575,6 +23715,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -23594,7 +23797,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -23645,6 +23848,7 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -23652,6 +23856,7 @@ workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -24221,11 +24426,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-94e652d5-20240912" !== 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-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24262,11 +24467,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-rc-7771d3a7-20240827", + version: "19.0.0-rc-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-7771d3a7-20240827" + reconcilerVersion: "19.0.0-rc-94e652d5-20240912" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24410,7 +24615,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js index 1adfa7be203f6..7441e5f15d833 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js @@ -595,28 +595,40 @@ 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; } @@ -682,39 +694,53 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[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); } - noLongerPendingLanes &= ~lane; + 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; @@ -729,10 +755,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; } } @@ -882,8 +908,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; } @@ -1216,15 +1242,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; @@ -1953,19 +1979,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$286; + var JSCompiler_inline_result$jscomp$279; if (canUseDOM) { - var isSupported$jscomp$inline_422 = "oninput" in document; - if (!isSupported$jscomp$inline_422) { - var element$jscomp$inline_423 = document.createElement("div"); - element$jscomp$inline_423.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_422 = - "function" === typeof element$jscomp$inline_423.oninput; + var isSupported$jscomp$inline_415 = "oninput" in document; + if (!isSupported$jscomp$inline_415) { + var element$jscomp$inline_416 = document.createElement("div"); + element$jscomp$inline_416.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_415 = + "function" === typeof element$jscomp$inline_416.oninput; } - JSCompiler_inline_result$jscomp$286 = isSupported$jscomp$inline_422; - } else JSCompiler_inline_result$jscomp$286 = !1; + JSCompiler_inline_result$jscomp$279 = isSupported$jscomp$inline_415; + } else JSCompiler_inline_result$jscomp$279 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$286 && + JSCompiler_inline_result$jscomp$279 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -3670,9 +3696,15 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); numberOfReRenders += 1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } ReactSharedInternals.H = HooksDispatcherOnRerender; - var children = Component(props, secondArg); + children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -3855,7 +3887,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$53 = !1; + didReadFromEntangledAsyncAction$54 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3876,11 +3908,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$53 = !0); + (didReadFromEntangledAsyncAction$54 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$53 = !0); + (didReadFromEntangledAsyncAction$54 = !0); continue; } else (updateLane = { @@ -3926,7 +3958,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$53 && + didReadFromEntangledAsyncAction$54 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4124,8 +4156,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$59) { - onActionError(actionQueue, node, error$59); + } catch (error$60) { + onActionError(actionQueue, node, error$60); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4316,17 +4348,16 @@ function rerenderActionState(action) { function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function updateRef() { @@ -4541,10 +4572,10 @@ function refreshCache(fiber) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$62 = enqueueUpdate(provider, fiber, lane); - null !== root$62 && - (scheduleUpdateOnFiber(root$62, provider, lane), - entangleTransitions(root$62, provider, lane)); + var root$63 = enqueueUpdate(provider, fiber, lane); + null !== root$63 && + (scheduleUpdateOnFiber(root$63, provider, lane), + entangleTransitions(root$63, provider, lane)); provider = { cache: createCache() }; fiber.payload = provider; return; @@ -4959,6 +4990,108 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +} +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; +} +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + 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]); + } + return newProps; +} var reportGlobalError = "function" === typeof reportError ? reportError @@ -5001,9 +5134,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$66) { + } catch (e$68) { setTimeout(function () { - throw e$66; + throw e$68; }); } } @@ -5014,9 +5147,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$67) { + } catch (e$69) { setTimeout(function () { - throw e$67; + throw e$69; }); } } @@ -5456,6 +5589,7 @@ function replayFunctionComponent( renderLanes ) { prepareToReadContext(workInProgress, renderLanes); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -7202,113 +7336,65 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$108 in Component) - void 0 === newProps[propName$108] && - (newProps[propName$108] = Component[propName$108]); +} +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -7364,8 +7450,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$109) { - captureCommitPhaseError(current, nearestMountedAncestor, error$109); + } catch (error$111) { + captureCommitPhaseError(current, nearestMountedAncestor, error$111); } else ref.current = null; } @@ -7376,32 +7462,136 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } -var shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - eventsEnabled = _enabled; - root = getActiveElementDeep(); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + eventsEnabled = _enabled; + root = getActiveElementDeep(); + if (hasSelectionCapabilities(root)) { + if ("selectionStart" in root) + var JSCompiler_temp = { + start: root.selectionStart, + end: root.selectionEnd + }; + else + a: { + JSCompiler_temp = + ((JSCompiler_temp = root.ownerDocument) && + JSCompiler_temp.defaultView) || + window; + var selection = + JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); + if (selection && 0 !== selection.rangeCount) { + JSCompiler_temp = selection.anchorNode; + var anchorOffset = selection.anchorOffset, focusNode = selection.focusNode; selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$19) { + } catch (e$20) { JSCompiler_temp = null; break a; } @@ -7457,59 +7647,69 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -7519,85 +7719,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - finishedWork = finishedWork.updateQueue; - finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; - if (null !== finishedWork) { - var effect = (finishedWork = finishedWork.next); - do { - if ((effect.tag & flags) === flags) { - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7606,7 +7730,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 11: case 15: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); + flags & 4 && commitHookEffectListMount(5, finishedWork); break; case 1: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7629,11 +7753,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$111) { + } catch (error$110) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$111 + error$110 ); } } @@ -7667,11 +7791,28 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7725,75 +7866,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -7841,8 +7913,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -7851,35 +7927,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$119 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$119; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -7908,18 +8004,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$119 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$119 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$119 & 4) && ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, @@ -8025,39 +8121,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8075,19 +8167,10 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$123) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$123); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8112,56 +8195,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8169,36 +8251,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8206,16 +8288,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8230,64 +8312,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$124) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$124 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8296,24 +8377,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$125) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$125); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$127) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$127); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8322,12 +8400,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$128) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$128); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8341,8 +8419,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$129) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$129); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -8373,15 +8451,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8389,13 +8467,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -8404,45 +8482,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$113) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$113 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -8492,11 +8569,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -8509,21 +8586,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$114 = JSCompiler_inline_result.stateNode; + var parent$112 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$114, ""), + (setTextContent(parent$112, ""), (JSCompiler_inline_result.flags &= -33)); - var before$115 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$115, parent$114); + var before$113 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$113, parent$112); break; case 3: case 4: - var parent$116 = JSCompiler_inline_result.stateNode.containerInfo, - before$117 = getHostSibling(finishedWork); + var parent$114 = JSCompiler_inline_result.stateNode.containerInfo, + before$115 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$117, - parent$116 + before$115, + parent$114 ); break; default: @@ -8612,7 +8689,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -8620,23 +8697,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8654,7 +8738,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -8663,6 +8747,23 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -8693,13 +8794,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -8755,7 +8849,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -8852,7 +8946,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: break; @@ -9379,12 +9473,12 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -9401,14 +9495,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$139 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$139 = lastTailNode), + for (var lastTailNode$132 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$132 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$139 + null === lastTailNode$132 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$139.sibling = null); + : (lastTailNode$132.sibling = null); } } function bubbleProperties(completedWork) { @@ -9418,19 +9512,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$140 = completedWork.child; null !== child$140; ) - (newChildLanes |= child$140.lanes | child$140.childLanes), - (subtreeFlags |= child$140.subtreeFlags & 31457280), - (subtreeFlags |= child$140.flags & 31457280), - (child$140.return = completedWork), - (child$140 = child$140.sibling); + for (var child$133 = completedWork.child; null !== child$133; ) + (newChildLanes |= child$133.lanes | child$133.childLanes), + (subtreeFlags |= child$133.subtreeFlags & 31457280), + (subtreeFlags |= child$133.flags & 31457280), + (child$133.return = completedWork), + (child$133 = child$133.sibling); else - for (child$140 = completedWork.child; null !== child$140; ) - (newChildLanes |= child$140.lanes | child$140.childLanes), - (subtreeFlags |= child$140.subtreeFlags), - (subtreeFlags |= child$140.flags), - (child$140.return = completedWork), - (child$140 = child$140.sibling); + for (child$133 = completedWork.child; null !== child$133; ) + (newChildLanes |= child$133.lanes | child$133.childLanes), + (subtreeFlags |= child$133.subtreeFlags), + (subtreeFlags |= child$133.flags), + (child$133.return = completedWork), + (child$133 = child$133.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -9707,11 +9801,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$152 = null; + var cache$145 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$152 = newProps.memoizedState.cachePool.pool); - cache$152 !== type && (newProps.flags |= 2048); + (cache$145 = newProps.memoizedState.cachePool.pool); + cache$145 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -9736,8 +9830,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$152 = type.rendering; - if (null === cache$152) + cache$145 = type.rendering; + if (null === cache$145) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -9745,11 +9839,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$152 = findFirstSuspended(current); - if (null !== cache$152) { + cache$145 = findFirstSuspended(current); + if (null !== cache$145) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$152.updateQueue; + current = cache$145.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -9774,7 +9868,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$152)), null !== current)) { + if (((current = findFirstSuspended(cache$145)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -9784,7 +9878,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$152.alternate && + !cache$145.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -9797,13 +9891,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$152.sibling = workInProgress.child), - (workInProgress.child = cache$152)) + ? ((cache$145.sibling = workInProgress.child), + (workInProgress.child = cache$145)) : ((current = type.last), null !== current - ? (current.sibling = cache$152) - : (workInProgress.child = cache$152), - (type.last = cache$152)); + ? (current.sibling = cache$145) + : (workInProgress.child = cache$145), + (type.last = cache$145)); } if (null !== type.tail) return ( @@ -9976,6 +10070,7 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -9983,6 +10078,7 @@ var DefaultAsyncDispatcher = { workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -10026,7 +10122,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10037,7 +10134,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10059,7 +10157,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10091,11 +10195,14 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -10107,7 +10214,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10121,6 +10229,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { default: throw Error(formatProdErrorMessage(329)); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && ((didTimeout = globalMostRecentFallbackTime + 300 - now()), @@ -10129,7 +10239,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10141,7 +10252,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10154,7 +10268,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10206,7 +10323,10 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10222,10 +10342,13 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10233,31 +10356,33 @@ function commitRootWhenReady( recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -10273,25 +10398,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : 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 && @@ -10318,13 +10446,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -10335,7 +10468,9 @@ function performSyncWorkOnRoot(root, lanes) { workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -10377,8 +10512,10 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -10395,9 +10532,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; @@ -10467,7 +10604,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -10494,15 +10632,16 @@ function renderRootSync(root, lanes) { null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); break; - } catch (thrownValue$167) { - handleThrow(root, thrownValue$167); + } catch (thrownValue$160) { + handleThrow(root, thrownValue$160); } while (1); lanes && root.shellSuspendCounter++; @@ -10537,7 +10676,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 1); break; case 2: if (isThenableResolved(thrownValue)) { @@ -10567,7 +10706,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 7)); break; case 5: var resource = null; @@ -10594,12 +10733,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 6); break; case 8: resetWorkInProgressStack(); @@ -10611,8 +10750,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$169) { - handleThrow(root, thrownValue$169); + } catch (thrownValue$162) { + handleThrow(root, thrownValue$162); } while (1); resetContextDependencies(); @@ -10704,31 +10843,20 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } unitOfWork = completedWork.return; var next = completeWork( completedWork.alternate, @@ -10748,12 +10876,37 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -10766,7 +10919,9 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -10780,7 +10935,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -10796,7 +10953,14 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -10812,25 +10976,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); - _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), + (_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), @@ -10870,7 +11034,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$173 = rootWithPendingPassiveEffects, + var root$166 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -10909,7 +11073,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$173, remainingLanes); + releaseRootPooledCache(root$166, remainingLanes); } } return !1; @@ -10980,6 +11144,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -10992,7 +11157,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -11065,14 +11232,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$175 = firstScheduledRoot; null !== root$175; ) { + for (var root$168 = firstScheduledRoot; null !== root$168; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$175.pendingLanes; + var pendingLanes = root$168.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$175.suspendedLanes, - pingedLanes = root$175.pingedLanes; + var suspendedLanes = root$168.suspendedLanes, + pingedLanes = root$168.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11086,17 +11253,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$175, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$168, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$175, - root$175 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$168, + root$168 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$175, JSCompiler_inline_result)); - root$175 = root$175.next; + performSyncWorkOnRoot(root$168, JSCompiler_inline_result)); + root$168 = root$168.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11137,12 +11304,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; } @@ -11306,20 +11473,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1417 = 0; - i$jscomp$inline_1417 < simpleEventPluginEvents.length; - i$jscomp$inline_1417++ + var i$jscomp$inline_1423 = 0; + i$jscomp$inline_1423 < simpleEventPluginEvents.length; + i$jscomp$inline_1423++ ) { - var eventName$jscomp$inline_1418 = - simpleEventPluginEvents[i$jscomp$inline_1417], - domEventName$jscomp$inline_1419 = - eventName$jscomp$inline_1418.toLowerCase(), - capitalizedEvent$jscomp$inline_1420 = - eventName$jscomp$inline_1418[0].toUpperCase() + - eventName$jscomp$inline_1418.slice(1); + var eventName$jscomp$inline_1424 = + simpleEventPluginEvents[i$jscomp$inline_1423], + domEventName$jscomp$inline_1425 = + eventName$jscomp$inline_1424.toLowerCase(), + capitalizedEvent$jscomp$inline_1426 = + eventName$jscomp$inline_1424[0].toUpperCase() + + eventName$jscomp$inline_1424.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1419, - "on" + capitalizedEvent$jscomp$inline_1420 + domEventName$jscomp$inline_1425, + "on" + capitalizedEvent$jscomp$inline_1426 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -12502,34 +12669,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$189 = props[hasSrc]; - if (null != propValue$189) + var propValue$182 = props[hasSrc]; + if (null != propValue$182) switch (hasSrc) { case "name": - hasSrcSet = propValue$189; + hasSrcSet = propValue$182; break; case "type": - propValue = propValue$189; + propValue = propValue$182; break; case "checked": - checked = propValue$189; + checked = propValue$182; break; case "defaultChecked": - defaultChecked = propValue$189; + defaultChecked = propValue$182; break; case "value": - propKey = propValue$189; + propKey = propValue$182; break; case "defaultValue": - defaultValue = propValue$189; + defaultValue = propValue$182; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$189) + if (null != propValue$182) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$189, props, null); + setProp(domElement, tag, hasSrc, propValue$182, props, null); } } initInput( @@ -12666,14 +12833,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$189 in props) - props.hasOwnProperty(propValue$189) && - ((hasSrc = props[propValue$189]), + for (propValue$182 in props) + props.hasOwnProperty(propValue$182) && + ((hasSrc = props[propValue$182]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$189, + propValue$182, hasSrc, props, void 0 @@ -12721,14 +12888,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$206 in nextProps) { - var propKey = nextProps[propKey$206]; - lastProp = lastProps[propKey$206]; + for (var propKey$199 in nextProps) { + var propKey = nextProps[propKey$199]; + lastProp = lastProps[propKey$199]; if ( - nextProps.hasOwnProperty(propKey$206) && + nextProps.hasOwnProperty(propKey$199) && (null != propKey || null != lastProp) ) - switch (propKey$206) { + switch (propKey$199) { case "type": type = propKey; break; @@ -12757,7 +12924,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$206, + propKey$199, propKey, nextProps, lastProp @@ -12776,7 +12943,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$206 = null; + propKey = value = defaultValue = propKey$199 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -12807,7 +12974,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$206 = type; + propKey$199 = type; break; case "defaultValue": defaultValue = type; @@ -12828,15 +12995,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$206 - ? updateOptions(domElement, !!lastProps, propKey$206, !1) + null != propKey$199 + ? updateOptions(domElement, !!lastProps, propKey$199, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$206 = null; + propKey = propKey$199 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -12860,7 +13027,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$206 = name; + propKey$199 = name; break; case "defaultValue": propKey = name; @@ -12874,17 +13041,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$206, propKey); + updateTextarea(domElement, propKey$199, propKey); return; case "option": - for (var propKey$222 in lastProps) + for (var propKey$215 in lastProps) if ( - ((propKey$206 = lastProps[propKey$222]), - lastProps.hasOwnProperty(propKey$222) && - null != propKey$206 && - !nextProps.hasOwnProperty(propKey$222)) + ((propKey$199 = lastProps[propKey$215]), + lastProps.hasOwnProperty(propKey$215) && + null != propKey$199 && + !nextProps.hasOwnProperty(propKey$215)) ) - switch (propKey$222) { + switch (propKey$215) { case "selected": domElement.selected = !1; break; @@ -12892,33 +13059,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$222, + propKey$215, null, nextProps, - propKey$206 + propKey$199 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$206 = nextProps[lastDefaultValue]), + ((propKey$199 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$206 !== propKey && - (null != propKey$206 || null != propKey)) + propKey$199 !== propKey && + (null != propKey$199 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$206 && - "function" !== typeof propKey$206 && - "symbol" !== typeof propKey$206; + propKey$199 && + "function" !== typeof propKey$199 && + "symbol" !== typeof propKey$199; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$206, + propKey$199, nextProps, propKey ); @@ -12939,24 +13106,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$227 in lastProps) - (propKey$206 = lastProps[propKey$227]), - lastProps.hasOwnProperty(propKey$227) && - null != propKey$206 && - !nextProps.hasOwnProperty(propKey$227) && - setProp(domElement, tag, propKey$227, null, nextProps, propKey$206); + for (var propKey$220 in lastProps) + (propKey$199 = lastProps[propKey$220]), + lastProps.hasOwnProperty(propKey$220) && + null != propKey$199 && + !nextProps.hasOwnProperty(propKey$220) && + setProp(domElement, tag, propKey$220, null, nextProps, propKey$199); for (checked in nextProps) if ( - ((propKey$206 = nextProps[checked]), + ((propKey$199 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$206 !== propKey && - (null != propKey$206 || null != propKey)) + propKey$199 !== propKey && + (null != propKey$199 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$206) + if (null != propKey$199) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -12964,7 +13131,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$206, + propKey$199, nextProps, propKey ); @@ -12972,49 +13139,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$232 in lastProps) - (propKey$206 = lastProps[propKey$232]), - lastProps.hasOwnProperty(propKey$232) && - void 0 !== propKey$206 && - !nextProps.hasOwnProperty(propKey$232) && + for (var propKey$225 in lastProps) + (propKey$199 = lastProps[propKey$225]), + lastProps.hasOwnProperty(propKey$225) && + void 0 !== propKey$199 && + !nextProps.hasOwnProperty(propKey$225) && setPropOnCustomElement( domElement, tag, - propKey$232, + propKey$225, void 0, nextProps, - propKey$206 + propKey$199 ); for (defaultChecked in nextProps) - (propKey$206 = nextProps[defaultChecked]), + (propKey$199 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$206 === propKey || - (void 0 === propKey$206 && void 0 === propKey) || + propKey$199 === propKey || + (void 0 === propKey$199 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$206, + propKey$199, nextProps, propKey ); return; } } - for (var propKey$237 in lastProps) - (propKey$206 = lastProps[propKey$237]), - lastProps.hasOwnProperty(propKey$237) && - null != propKey$206 && - !nextProps.hasOwnProperty(propKey$237) && - setProp(domElement, tag, propKey$237, null, nextProps, propKey$206); + for (var propKey$230 in lastProps) + (propKey$199 = lastProps[propKey$230]), + lastProps.hasOwnProperty(propKey$230) && + null != propKey$199 && + !nextProps.hasOwnProperty(propKey$230) && + setProp(domElement, tag, propKey$230, null, nextProps, propKey$199); for (lastProp in nextProps) - (propKey$206 = nextProps[lastProp]), + (propKey$199 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$206 === propKey || - (null == propKey$206 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$206, nextProps, propKey); + propKey$199 === propKey || + (null == propKey$199 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$199, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -13559,26 +13726,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$245 = getResourcesFromRoot( + var styles$238 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$246 = styles$245.get(type); - resource$246 || + resource$239 = styles$238.get(type); + resource$239 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$246 = { + (resource$239 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$245.set(type, resource$246), - (styles$245 = JSCompiler_inline_result.querySelector( + styles$238.set(type, resource$239), + (styles$238 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$245._p && - ((resource$246.instance = styles$245), - (resource$246.state.loading = 5)), + !styles$238._p && + ((resource$239.instance = styles$238), + (resource$239.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -13591,16 +13758,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$245 || + styles$238 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$246.state + resource$239.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$246; + return resource$239; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -13697,37 +13864,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$251 = hoistableRoot.querySelector( + var instance$244 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$251) + if (instance$244) return ( (resource.state.loading |= 4), - (resource.instance = instance$251), - markNodeAsHoistable(instance$251), - instance$251 + (resource.instance = instance$244), + markNodeAsHoistable(instance$244), + instance$244 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$251 = ( + instance$244 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$251); - var linkInstance = instance$251; + markNodeAsHoistable(instance$244); + var linkInstance = instance$244; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$251, "link", instance); + setInitialProperties(instance$244, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$251, props.precedence, hoistableRoot); - return (resource.instance = instance$251); + insertStylesheet(instance$244, props.precedence, hoistableRoot); + return (resource.instance = instance$244); case "script": - instance$251 = getScriptKey(props.src); + instance$244 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$251) + getScriptSelectorFromKey(instance$244) )) ) return ( @@ -13736,7 +13903,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$251))) + if ((styleProps = preloadPropsMap.get(instance$244))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14059,6 +14226,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -14759,16 +14927,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1664 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1670 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1664 + "19.0.0-rc-94e652d5-20240912" !== + isomorphicReactPackageVersion$jscomp$inline_1670 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1664, - "19.0.0-rc-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1670, + "19.0.0-rc-94e652d5-20240912" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -14788,25 +14956,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2049 = { +var internals$jscomp$inline_2081 = { bundleType: 0, - version: "19.0.0-rc-7771d3a7-20240827", + version: "19.0.0-rc-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-7771d3a7-20240827" + reconcilerVersion: "19.0.0-rc-94e652d5-20240912" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2050 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2082 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2050.isDisabled && - hook$jscomp$inline_2050.supportsFiber + !hook$jscomp$inline_2082.isDisabled && + hook$jscomp$inline_2082.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2050.inject( - internals$jscomp$inline_2049 + (rendererID = hook$jscomp$inline_2082.inject( + internals$jscomp$inline_2081 )), - (injectedHook = hook$jscomp$inline_2050); + (injectedHook = hook$jscomp$inline_2082); } catch (err) {} } exports.createRoot = function (container, options) { @@ -14898,4 +15066,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js index 65dbcede073bf..b1c48a262eaa1 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js @@ -1018,28 +1018,40 @@ 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; } @@ -1113,25 +1125,34 @@ for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } - function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index = 31 - clz32(noLongerPendingLanes), + var index = 31 - clz32(remainingLanes), lane = 1 << index; - remainingLanes[index] = 0; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1143,9 +1164,14 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + 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; @@ -3909,6 +3935,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5703,6 +5784,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -5753,10 +5842,16 @@ numberOfReRenders += 1; ignorePreviousDependencies = !1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } hookTypesUpdateIndexDev = -1; ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - var children = callComponentInDEV(Component, props, secondArg); + children = callComponentInDEV(Component, props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -6580,17 +6675,16 @@ function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function mountRef(initialValue) { @@ -7140,60 +7234,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error, errorInfo) { reportGlobalError(error); @@ -7795,8 +7957,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -7836,6 +7998,7 @@ hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -8025,8 +8188,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8455,32 +8618,32 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2304; - var JSCompiler_object_inline_stack_2305 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2282; + var JSCompiler_object_inline_stack_2283 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2306 = !1; + var JSCompiler_object_inline_componentStack_2284 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2304 = didSuspend) || - (JSCompiler_object_inline_digest_2304 = + (JSCompiler_object_inline_digest_2282 = didSuspend) || + (JSCompiler_object_inline_digest_2282 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2304 && - ((JSCompiler_object_inline_componentStack_2306 = !0), + JSCompiler_object_inline_digest_2282 && + ((JSCompiler_object_inline_componentStack_2284 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2304 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2282 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_componentStack_2284 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2303 = nextHydratableInstance; + var JSCompiler_object_inline_message_2281 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2303)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2281)) { c: { - var instance = JSCompiler_object_inline_message_2303; + var instance = JSCompiler_object_inline_message_2281; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8521,19 +8684,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2281 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2303 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2281 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2303 && - ((JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_message_2303.dehydrated), - null !== JSCompiler_object_inline_message_2303) + null !== JSCompiler_object_inline_message_2281 && + ((JSCompiler_object_inline_message_2281 = + JSCompiler_object_inline_message_2281.dehydrated), + null !== JSCompiler_object_inline_message_2281) ) return ( - JSCompiler_object_inline_message_2303.data === + JSCompiler_object_inline_message_2281.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8541,58 +8704,58 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_stack_2305.children; - JSCompiler_object_inline_stack_2305 = - JSCompiler_object_inline_stack_2305.fallback; - if (JSCompiler_object_inline_componentStack_2306) + JSCompiler_object_inline_message_2281 = + JSCompiler_object_inline_stack_2283.children; + JSCompiler_object_inline_stack_2283 = + JSCompiler_object_inline_stack_2283.fallback; + if (JSCompiler_object_inline_componentStack_2284) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_componentStack_2284 = workInProgress.mode), - (JSCompiler_object_inline_message_2303 = + (JSCompiler_object_inline_message_2281 = mountWorkInProgressOffscreenFiber( { mode: "hidden", - children: JSCompiler_object_inline_message_2303 + children: JSCompiler_object_inline_message_2281 }, - JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_componentStack_2284 )), - (JSCompiler_object_inline_stack_2305 = createFiberFromFragment( - JSCompiler_object_inline_stack_2305, - JSCompiler_object_inline_componentStack_2306, + (JSCompiler_object_inline_stack_2283 = createFiberFromFragment( + JSCompiler_object_inline_stack_2283, + JSCompiler_object_inline_componentStack_2284, renderLanes, null )), - (JSCompiler_object_inline_message_2303.return = workInProgress), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_message_2303.sibling = - JSCompiler_object_inline_stack_2305), - (workInProgress.child = JSCompiler_object_inline_message_2303), - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_message_2281.return = workInProgress), + (JSCompiler_object_inline_stack_2283.return = workInProgress), + (JSCompiler_object_inline_message_2281.sibling = + JSCompiler_object_inline_stack_2283), + (workInProgress.child = JSCompiler_object_inline_message_2281), + (JSCompiler_object_inline_componentStack_2284 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2306.memoizedState = + (JSCompiler_object_inline_componentStack_2284.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2306.childLanes = + (JSCompiler_object_inline_componentStack_2284.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2282, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2283 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2281 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2303 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2303) + ((JSCompiler_object_inline_message_2281 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2281) ) { if (didSuspend) workInProgress.flags & 256 @@ -8609,94 +8772,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2306 = - JSCompiler_object_inline_stack_2305.fallback), - (JSCompiler_object_inline_message_2303 = workInProgress.mode), - (JSCompiler_object_inline_stack_2305 = + (JSCompiler_object_inline_componentStack_2284 = + JSCompiler_object_inline_stack_2283.fallback), + (JSCompiler_object_inline_message_2281 = workInProgress.mode), + (JSCompiler_object_inline_stack_2283 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2283.children }, - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2281 )), - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_componentStack_2284 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2306, - JSCompiler_object_inline_message_2303, + JSCompiler_object_inline_componentStack_2284, + JSCompiler_object_inline_message_2281, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2306.flags |= 2), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_componentStack_2306.return = + (JSCompiler_object_inline_componentStack_2284.flags |= 2), + (JSCompiler_object_inline_stack_2283.return = workInProgress), + (JSCompiler_object_inline_componentStack_2284.return = workInProgress), - (JSCompiler_object_inline_stack_2305.sibling = - JSCompiler_object_inline_componentStack_2306), - (workInProgress.child = JSCompiler_object_inline_stack_2305), + (JSCompiler_object_inline_stack_2283.sibling = + JSCompiler_object_inline_componentStack_2284), + (workInProgress.child = JSCompiler_object_inline_stack_2283), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2305 = workInProgress.child), - (JSCompiler_object_inline_stack_2305.memoizedState = + (JSCompiler_object_inline_stack_2283 = workInProgress.child), + (JSCompiler_object_inline_stack_2283.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2305.childLanes = + (JSCompiler_object_inline_stack_2283.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2282, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2306)); + JSCompiler_object_inline_componentStack_2284)); 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_message_2303.data === + JSCompiler_object_inline_message_2281.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2304 = - JSCompiler_object_inline_message_2303.nextSibling && - JSCompiler_object_inline_message_2303.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2304) { - JSCompiler_temp = JSCompiler_object_inline_digest_2304.dgst; - var message = JSCompiler_object_inline_digest_2304.msg; - instance = JSCompiler_object_inline_digest_2304.stck; - var componentStack = JSCompiler_object_inline_digest_2304.cstck; + JSCompiler_object_inline_digest_2282 = + JSCompiler_object_inline_message_2281.nextSibling && + JSCompiler_object_inline_message_2281.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2282) { + JSCompiler_temp = JSCompiler_object_inline_digest_2282.dgst; + var message = JSCompiler_object_inline_digest_2282.msg; + instance = JSCompiler_object_inline_digest_2282.stck; + var componentStack = JSCompiler_object_inline_digest_2282.cstck; } - JSCompiler_object_inline_message_2303 = message; - JSCompiler_object_inline_digest_2304 = JSCompiler_temp; - JSCompiler_object_inline_stack_2305 = instance; - JSCompiler_object_inline_componentStack_2306 = componentStack; - JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_message_2303 - ? Error(JSCompiler_object_inline_message_2303) + JSCompiler_object_inline_message_2281 = message; + JSCompiler_object_inline_digest_2282 = JSCompiler_temp; + JSCompiler_object_inline_stack_2283 = instance; + JSCompiler_object_inline_componentStack_2284 = componentStack; + JSCompiler_object_inline_message_2281 = + JSCompiler_object_inline_message_2281 + ? Error(JSCompiler_object_inline_message_2281) : 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_2303.stack = - JSCompiler_object_inline_stack_2305 || ""; - JSCompiler_object_inline_message_2303.digest = - JSCompiler_object_inline_digest_2304; - JSCompiler_object_inline_digest_2304 = - void 0 === JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_message_2281.stack = + JSCompiler_object_inline_stack_2283 || ""; + JSCompiler_object_inline_message_2281.digest = + JSCompiler_object_inline_digest_2282; + JSCompiler_object_inline_digest_2282 = + void 0 === JSCompiler_object_inline_componentStack_2284 ? null - : JSCompiler_object_inline_componentStack_2306; - "string" === typeof JSCompiler_object_inline_digest_2304 && + : JSCompiler_object_inline_componentStack_2284; + "string" === typeof JSCompiler_object_inline_digest_2282 && CapturedStacks.set( - JSCompiler_object_inline_message_2303, - JSCompiler_object_inline_digest_2304 + JSCompiler_object_inline_message_2281, + JSCompiler_object_inline_digest_2282 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2303, + value: JSCompiler_object_inline_message_2281, source: null, - stack: JSCompiler_object_inline_digest_2304 + stack: JSCompiler_object_inline_digest_2282 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8704,25 +8867,25 @@ renderLanes ); } else if ( - ((JSCompiler_object_inline_digest_2304 = + ((JSCompiler_object_inline_digest_2282 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2304) + didReceiveUpdate || JSCompiler_object_inline_digest_2282) ) { - JSCompiler_object_inline_digest_2304 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2304) { - JSCompiler_object_inline_stack_2305 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2305 & 42)) - JSCompiler_object_inline_stack_2305 = 1; + JSCompiler_object_inline_digest_2282 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2282) { + JSCompiler_object_inline_stack_2283 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2283 & 42)) + JSCompiler_object_inline_stack_2283 = 1; else - switch (JSCompiler_object_inline_stack_2305) { + switch (JSCompiler_object_inline_stack_2283) { case 2: - JSCompiler_object_inline_stack_2305 = 1; + JSCompiler_object_inline_stack_2283 = 1; break; case 8: - JSCompiler_object_inline_stack_2305 = 4; + JSCompiler_object_inline_stack_2283 = 4; break; case 32: - JSCompiler_object_inline_stack_2305 = 16; + JSCompiler_object_inline_stack_2283 = 16; break; case 128: case 256: @@ -8743,40 +8906,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2305 = 64; + JSCompiler_object_inline_stack_2283 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2305 = 134217728; + JSCompiler_object_inline_stack_2283 = 134217728; break; default: - JSCompiler_object_inline_stack_2305 = 0; + JSCompiler_object_inline_stack_2283 = 0; } - JSCompiler_object_inline_stack_2305 = + JSCompiler_object_inline_stack_2283 = 0 !== - (JSCompiler_object_inline_stack_2305 & - (JSCompiler_object_inline_digest_2304.suspendedLanes | + (JSCompiler_object_inline_stack_2283 & + (JSCompiler_object_inline_digest_2282.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2305; + : JSCompiler_object_inline_stack_2283; if ( - 0 !== JSCompiler_object_inline_stack_2305 && - JSCompiler_object_inline_stack_2305 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2283 && + JSCompiler_object_inline_stack_2283 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2305), + ((prevState.retryLane = JSCompiler_object_inline_stack_2283), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2283 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2282, current, - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2283 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2303.data === + JSCompiler_object_inline_message_2281.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8784,7 +8947,7 @@ renderLanes ); } else - JSCompiler_object_inline_message_2303.data === + JSCompiler_object_inline_message_2281.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -8792,12 +8955,12 @@ null, current )), - (JSCompiler_object_inline_message_2303._reactRetry = + (JSCompiler_object_inline_message_2281._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2303.nextSibling + JSCompiler_object_inline_message_2281.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -8815,57 +8978,57 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2305.children + JSCompiler_object_inline_stack_2283.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2306) + if (JSCompiler_object_inline_componentStack_2284) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2306 = - JSCompiler_object_inline_stack_2305.fallback), - (JSCompiler_object_inline_message_2303 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2284 = + JSCompiler_object_inline_stack_2283.fallback), + (JSCompiler_object_inline_message_2281 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2305 = createWorkInProgress( + (JSCompiler_object_inline_stack_2283 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2283.children } )), - (JSCompiler_object_inline_stack_2305.subtreeFlags = + (JSCompiler_object_inline_stack_2283.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2306 = + ? (JSCompiler_object_inline_componentStack_2284 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_componentStack_2284 )) - : ((JSCompiler_object_inline_componentStack_2306 = + : ((JSCompiler_object_inline_componentStack_2284 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2306, - JSCompiler_object_inline_message_2303, + JSCompiler_object_inline_componentStack_2284, + JSCompiler_object_inline_message_2281, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2306.flags |= 2)), - (JSCompiler_object_inline_componentStack_2306.return = + (JSCompiler_object_inline_componentStack_2284.flags |= 2)), + (JSCompiler_object_inline_componentStack_2284.return = workInProgress), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_stack_2305.sibling = - JSCompiler_object_inline_componentStack_2306), - (workInProgress.child = JSCompiler_object_inline_stack_2305), - (JSCompiler_object_inline_stack_2305 = - JSCompiler_object_inline_componentStack_2306), - (JSCompiler_object_inline_componentStack_2306 = workInProgress.child), - (JSCompiler_object_inline_message_2303 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2303 - ? (JSCompiler_object_inline_message_2303 = + (JSCompiler_object_inline_stack_2283.return = workInProgress), + (JSCompiler_object_inline_stack_2283.sibling = + JSCompiler_object_inline_componentStack_2284), + (workInProgress.child = JSCompiler_object_inline_stack_2283), + (JSCompiler_object_inline_stack_2283 = + JSCompiler_object_inline_componentStack_2284), + (JSCompiler_object_inline_componentStack_2284 = workInProgress.child), + (JSCompiler_object_inline_message_2281 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2281 + ? (JSCompiler_object_inline_message_2281 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2303.cachePool), + JSCompiler_object_inline_message_2281.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -8873,37 +9036,37 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2303 = { + (JSCompiler_object_inline_message_2281 = { baseLanes: - JSCompiler_object_inline_message_2303.baseLanes | renderLanes, + JSCompiler_object_inline_message_2281.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2306.memoizedState = - JSCompiler_object_inline_message_2303), - (JSCompiler_object_inline_componentStack_2306.childLanes = + (JSCompiler_object_inline_componentStack_2284.memoizedState = + JSCompiler_object_inline_message_2281), + (JSCompiler_object_inline_componentStack_2284.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2282, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2283 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2283.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2304 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2304 + ((JSCompiler_object_inline_digest_2282 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2282 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2304.push(current)); + : JSCompiler_object_inline_digest_2282.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10103,7 +10266,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -10391,6 +10558,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10401,128 +10578,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$2)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10530,101 +11121,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -10707,333 +11203,76 @@ (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11049,17 +11288,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11073,21 +11322,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11095,11 +11348,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11115,59 +11364,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11175,11 +11429,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11189,11 +11439,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11216,78 +11462,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$2)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11367,14 +11541,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11420,7 +11617,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11430,14 +11629,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11505,7 +11708,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11554,74 +11761,53 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + function commitMutationEffectsOnFiber(finishedWork, root) { var current = finishedWork.alternate, flags = finishedWork.flags; switch (finishedWork.tag) { @@ -11629,53 +11815,31 @@ case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, finishedWork, - finishedWork.return, - error$10 - ); - } - } + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -11692,116 +11856,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -11810,9 +11976,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -11827,117 +11993,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -11946,23 +12080,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -11970,7 +12107,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -11979,13 +12116,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -11995,12 +12132,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12016,15 +12153,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12032,13 +12169,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12047,47 +12184,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12118,7 +12254,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12129,7 +12265,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12137,52 +12273,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12202,27 +12293,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12305,24 +12382,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12339,7 +12420,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12348,9 +12429,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12387,9 +12492,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12397,22 +12500,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12443,9 +12530,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12492,9 +12577,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12503,18 +12588,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12558,9 +12641,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12593,9 +12674,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12605,11 +12686,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12647,62 +12726,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -12763,25 +12825,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -12798,11 +12841,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -12846,7 +12885,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -12876,22 +12915,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -12900,33 +12954,8 @@ nextEffect = sibling; break a; } - nextEffect = returnFiber; - } - } - } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); + nextEffect = returnFiber; + } } } function FiberNode(tag, pendingProps, key, mode) { @@ -13002,7 +13031,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13055,7 +13085,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13284,12 +13315,12 @@ ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14086,7 +14117,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14128,7 +14160,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14153,7 +14186,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14185,11 +14223,14 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -14201,7 +14242,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14215,13 +14257,17 @@ default: throw Error("Unknown root exit status."); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( renderWasConcurrent, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); else { if ( @@ -14235,7 +14281,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14247,7 +14294,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14260,7 +14310,10 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14315,7 +14368,10 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14335,10 +14391,13 @@ root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14346,31 +14405,33 @@ recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -14386,26 +14447,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (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 && @@ -14435,13 +14501,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -14452,7 +14523,9 @@ workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -14494,9 +14567,11 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -14619,7 +14694,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -14662,15 +14738,21 @@ null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -14726,7 +14808,12 @@ case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -14758,7 +14845,12 @@ replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -14790,12 +14882,22 @@ } workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); break; case SuspendedOnDeprecatedThrowPromise: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); break; case SuspendedOnHydration: resetWorkInProgressStack(); @@ -14810,8 +14912,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -14936,43 +15038,20 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -15006,12 +15085,46 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15024,7 +15137,9 @@ transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -15038,7 +15153,9 @@ transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15067,7 +15184,14 @@ root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -15083,34 +15207,34 @@ return null; })); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitBeforeMutationEffects(root, finishedWork); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - ReactDOMSharedInternals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = ReactDOMSharedInternals.p), + (ReactDOMSharedInternals.p = DiscreteEventPriority), + (updatedLanes = executionContext), + (executionContext |= CommitContext), + commitBeforeMutationEffects(root, finishedWork), + (commitTime = now()), + commitMutationEffects(root, finishedWork, lanes), + restoreSelection(selectionInformation), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (ReactDOMSharedInternals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : ((root.current = finishedWork), (commitTime = now())); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -15209,55 +15333,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15403,6 +15512,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -15422,7 +15532,9 @@ now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -18850,6 +18962,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -18873,6 +19017,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19073,6 +19238,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function resolveSingletonInstance( type, props, @@ -19111,6 +19282,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -19859,6 +20061,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -21946,6 +22149,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23487,84 +23697,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -23632,6 +23772,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -23651,7 +23854,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -23702,6 +23905,7 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -23709,6 +23913,7 @@ workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -24278,11 +24483,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-94e652d5-20240912" !== 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-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24319,11 +24524,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-rc-7771d3a7-20240827", + version: "19.0.0-rc-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-7771d3a7-20240827" + reconcilerVersion: "19.0.0-rc-94e652d5-20240912" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24797,7 +25002,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js index 60cd03dc8d647..a25f1a9507994 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js @@ -676,28 +676,40 @@ 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; } @@ -763,39 +775,53 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[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); } - noLongerPendingLanes &= ~lane; + 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; @@ -810,19 +836,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; } } @@ -834,16 +860,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; } } @@ -993,8 +1019,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; } @@ -1327,15 +1353,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; @@ -2064,19 +2090,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$307; + var JSCompiler_inline_result$jscomp$295; if (canUseDOM) { - var isSupported$jscomp$inline_444 = "oninput" in document; - if (!isSupported$jscomp$inline_444) { - var element$jscomp$inline_445 = document.createElement("div"); - element$jscomp$inline_445.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_444 = - "function" === typeof element$jscomp$inline_445.oninput; + var isSupported$jscomp$inline_432 = "oninput" in document; + if (!isSupported$jscomp$inline_432) { + var element$jscomp$inline_433 = document.createElement("div"); + element$jscomp$inline_433.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_432 = + "function" === typeof element$jscomp$inline_433.oninput; } - JSCompiler_inline_result$jscomp$307 = isSupported$jscomp$inline_444; - } else JSCompiler_inline_result$jscomp$307 = !1; + JSCompiler_inline_result$jscomp$295 = isSupported$jscomp$inline_432; + } else JSCompiler_inline_result$jscomp$295 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$307 && + JSCompiler_inline_result$jscomp$295 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2492,7 +2518,69 @@ function getRootForUpdatedFiber(sourceFiber) { return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; } var emptyContextObject = {}, - CapturedStacks = new WeakMap(); + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1; +function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); +} +function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } +} +function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } +} +function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } +} +function startLayoutEffectTimer() { + layoutEffectStartTime = now(); +} +function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); +} +var CapturedStacks = new WeakMap(); function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -3781,9 +3869,15 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); numberOfReRenders += 1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } ReactSharedInternals.H = HooksDispatcherOnRerender; - var children = Component(props, secondArg); + children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -3966,7 +4060,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$55 = !1; + didReadFromEntangledAsyncAction$58 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3987,11 +4081,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); + (didReadFromEntangledAsyncAction$58 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); + (didReadFromEntangledAsyncAction$58 = !0); continue; } else (updateLane = { @@ -4037,7 +4131,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$55 && + didReadFromEntangledAsyncAction$58 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4235,8 +4329,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$61) { - onActionError(actionQueue, node, error$61); + } catch (error$64) { + onActionError(actionQueue, node, error$64); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4427,17 +4521,16 @@ function rerenderActionState(action) { function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function updateRef() { @@ -4652,10 +4745,10 @@ function refreshCache(fiber) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$64 = enqueueUpdate(provider, fiber, lane); - null !== root$64 && - (scheduleUpdateOnFiber(root$64, provider, lane), - entangleTransitions(root$64, provider, lane)); + var root$67 = enqueueUpdate(provider, fiber, lane); + null !== root$67 && + (scheduleUpdateOnFiber(root$67, provider, lane), + entangleTransitions(root$67, provider, lane)); provider = { cache: createCache() }; fiber.payload = provider; return; @@ -5073,67 +5166,112 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; -var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1; -function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && + injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; - } - } +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - } - fiber = fiber.return; - } +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } -} -function startLayoutEffectTimer() { - layoutEffectStartTime = now(); -} -function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$71 in Component) + void 0 === newProps[propName$71] && + (newProps[propName$71] = Component[propName$71]); + } + return newProps; } var reportGlobalError = "function" === typeof reportError @@ -5177,9 +5315,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$70) { + } catch (e$72) { setTimeout(function () { - throw e$70; + throw e$72; }); } } @@ -5190,9 +5328,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$71) { + } catch (e$73) { setTimeout(function () { - throw e$71; + throw e$73; }); } } @@ -5638,6 +5776,7 @@ function replayFunctionComponent( ) { prepareToReadContext(workInProgress, renderLanes); markComponentRenderStarted(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -7400,122 +7539,139 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +function shouldProfile$1(current) { + return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); } -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && - injectedProfilingHooks.markForceUpdateScheduled(inst, lane); +function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ); + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : 0 !== (flags & 4) && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext +} +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + markComponentLayoutEffectUnmountStarted(finishedWork), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : 0 !== (flags & 4) && markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$113 in Component) - void 0 === newProps[propName$113] && - (newProps[propName$113] = Component[propName$113]); +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; -} -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - inProgressLanes = null, - inProgressRoot = null; -function shouldProfile(current) { - return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); } function safelyCallComponentWillUnmount( current, @@ -7527,7 +7683,7 @@ function safelyCallComponentWillUnmount( current.memoizedProps ); instance.state = current.memoizedState; - if (shouldProfile(current)) { + if (shouldProfile$1(current)) { startLayoutEffectTimer(); try { instance.componentWillUnmount(); @@ -7538,8 +7694,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$114) { - captureCommitPhaseError(current, nearestMountedAncestor, error$114); + } catch (error$118) { + captureCommitPhaseError(current, nearestMountedAncestor, error$118); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -7557,7 +7713,7 @@ function safelyAttachRef(current, nearestMountedAncestor) { instanceToUse = instance; } if ("function" === typeof ref) - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), (current.refCleanup = ref(instanceToUse)); } finally { @@ -7576,7 +7732,7 @@ function safelyDetachRef(current, nearestMountedAncestor) { if (null !== ref) if ("function" === typeof refCleanup) try { - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), refCleanup(); } finally { @@ -7592,15 +7748,15 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else if ("function" === typeof ref) try { - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), ref(null); } finally { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$115) { - captureCommitPhaseError(current, nearestMountedAncestor, error$115); + } catch (error$119) { + captureCommitPhaseError(current, nearestMountedAncestor, error$119); } else ref.current = null; } @@ -7611,6 +7767,148 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } +function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration +) { + if (executionContext & 4) + try { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit, + onRender = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onRender && + onRender( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$2)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + inProgressLanes = null, + inProgressRoot = null; +function shouldProfile(current) { + return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); +} var shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; @@ -7636,7 +7934,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; } @@ -7692,59 +7990,69 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -7754,176 +8062,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - markComponentLayoutEffectUnmountStarted(finishedWork), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : 0 !== (flags & 4) && markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : 0 !== (flags & 4) && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$119) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$119); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitProfilerUpdate(finishedWork, current) { - if (executionContext & 4) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { - case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - } - parentFiber = parentFiber.return; - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7938,7 +8079,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) - if (shouldProfile(finishedWork)) { + if (shouldProfile$1(finishedWork)) { startLayoutEffectTimer(); try { finishedRoot.componentDidMount(); @@ -7949,11 +8090,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$120) { + } catch (error$115) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$120 + error$115 ); } else { @@ -7962,7 +8103,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current.memoizedProps ); current = current.memoizedState; - if (shouldProfile(finishedWork)) { + if (shouldProfile$1(finishedWork)) { startLayoutEffectTimer(); try { finishedRoot.componentDidUpdate( @@ -7970,11 +8111,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$121) { + } catch (error$116) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$121 + error$116 ); } recordLayoutEffectDuration(finishedWork); @@ -7985,11 +8126,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$122) { + } catch (error$117) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$122 + error$117 ); } } @@ -8023,12 +8164,30 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitProfilerUpdate(finishedWork, current); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8054,102 +8213,33 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } - flags & 512 && - ("manual" === finishedWork.memoizedProps.mode - ? safelyAttachRef(finishedWork, finishedWork.return) - : safelyDetachRef(finishedWork, finishedWork.return)); - break; - default: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - } -} -function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - 5 === fiber.tag && - ((alternate = fiber.stateNode), - null !== alternate && detachDeletedInstance(alternate)); - fiber.stateNode = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; -} -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$2)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); + flags & 512 && + ("manual" === finishedWork.memoizedProps.mode + ? safelyAttachRef(finishedWork, finishedWork.return) + : safelyDetachRef(finishedWork, finishedWork.return)); + break; + default: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + } } -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + 5 === fiber.tag && + ((alternate = fiber.stateNode), + null !== alternate && detachDeletedInstance(alternate)); + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; } var hostParent = null, hostParentIsContainer = !1; @@ -8198,8 +8288,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8208,35 +8302,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$129 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$129; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8265,18 +8379,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$129 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$129 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$129 & 4) && (markComponentLayoutEffectUnmountStarted(deletedFiber), shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), @@ -8405,39 +8519,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8455,36 +8565,14 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$136) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$136 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$137) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$137 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8509,56 +8597,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8566,36 +8653,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8603,16 +8690,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8627,64 +8714,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$138) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$138 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8693,24 +8779,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$139) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$139); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$141) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$141); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8719,12 +8802,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$142) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$142); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8738,8 +8821,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$143) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$143); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -8770,15 +8853,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8786,13 +8869,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -8801,45 +8884,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$126) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$126 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -8889,11 +8971,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -8906,21 +8988,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$127 = JSCompiler_inline_result.stateNode; + var parent$120 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$127, ""), + (setTextContent(parent$120, ""), (JSCompiler_inline_result.flags &= -33)); - var before$128 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$128, parent$127); + var before$121 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$121, parent$120); break; case 3: case 4: - var parent$129 = JSCompiler_inline_result.stateNode.containerInfo, - before$130 = getHostSibling(finishedWork); + var parent$122 = JSCompiler_inline_result.stateNode.containerInfo, + before$123 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$130, - parent$129 + before$123, + parent$122 ); break; default: @@ -9030,23 +9112,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9064,7 +9153,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -9073,9 +9162,25 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -9106,22 +9211,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$148) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$148); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -9419,25 +9508,6 @@ function detachAlternateSiblings(parentFiber) { while (null !== parentFiber); } } -function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags -) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); -} function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -9832,12 +9902,12 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -9854,14 +9924,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$154 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$154 = lastTailNode), + for (var lastTailNode$142 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$142 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$154 + null === lastTailNode$142 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$154.sibling = null); + : (lastTailNode$142.sibling = null); } } function bubbleProperties(completedWork) { @@ -9873,53 +9943,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$156 = completedWork.selfBaseDuration, - child$157 = completedWork.child; - null !== child$157; + var treeBaseDuration$144 = completedWork.selfBaseDuration, + child$145 = completedWork.child; + null !== child$145; ) - (newChildLanes |= child$157.lanes | child$157.childLanes), - (subtreeFlags |= child$157.subtreeFlags & 31457280), - (subtreeFlags |= child$157.flags & 31457280), - (treeBaseDuration$156 += child$157.treeBaseDuration), - (child$157 = child$157.sibling); - completedWork.treeBaseDuration = treeBaseDuration$156; + (newChildLanes |= child$145.lanes | child$145.childLanes), + (subtreeFlags |= child$145.subtreeFlags & 31457280), + (subtreeFlags |= child$145.flags & 31457280), + (treeBaseDuration$144 += child$145.treeBaseDuration), + (child$145 = child$145.sibling); + completedWork.treeBaseDuration = treeBaseDuration$144; } else for ( - treeBaseDuration$156 = completedWork.child; - null !== treeBaseDuration$156; + treeBaseDuration$144 = completedWork.child; + null !== treeBaseDuration$144; ) (newChildLanes |= - treeBaseDuration$156.lanes | treeBaseDuration$156.childLanes), - (subtreeFlags |= treeBaseDuration$156.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$156.flags & 31457280), - (treeBaseDuration$156.return = completedWork), - (treeBaseDuration$156 = treeBaseDuration$156.sibling); + treeBaseDuration$144.lanes | treeBaseDuration$144.childLanes), + (subtreeFlags |= treeBaseDuration$144.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$144.flags & 31457280), + (treeBaseDuration$144.return = completedWork), + (treeBaseDuration$144 = treeBaseDuration$144.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$156 = completedWork.actualDuration; - child$157 = completedWork.selfBaseDuration; + treeBaseDuration$144 = completedWork.actualDuration; + child$145 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$156 += child.actualDuration), - (child$157 += child.treeBaseDuration), + (treeBaseDuration$144 += child.actualDuration), + (child$145 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$156; - completedWork.treeBaseDuration = child$157; + completedWork.actualDuration = treeBaseDuration$144; + completedWork.treeBaseDuration = child$145; } else for ( - treeBaseDuration$156 = completedWork.child; - null !== treeBaseDuration$156; + treeBaseDuration$144 = completedWork.child; + null !== treeBaseDuration$144; ) (newChildLanes |= - treeBaseDuration$156.lanes | treeBaseDuration$156.childLanes), - (subtreeFlags |= treeBaseDuration$156.subtreeFlags), - (subtreeFlags |= treeBaseDuration$156.flags), - (treeBaseDuration$156.return = completedWork), - (treeBaseDuration$156 = treeBaseDuration$156.sibling); + treeBaseDuration$144.lanes | treeBaseDuration$144.childLanes), + (subtreeFlags |= treeBaseDuration$144.subtreeFlags), + (subtreeFlags |= treeBaseDuration$144.flags), + (treeBaseDuration$144.return = completedWork), + (treeBaseDuration$144 = treeBaseDuration$144.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10212,11 +10282,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$172 = null; + var cache$160 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$172 = newProps.memoizedState.cachePool.pool); - cache$172 !== type && (newProps.flags |= 2048); + (cache$160 = newProps.memoizedState.cachePool.pool); + cache$160 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10246,8 +10316,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$172 = type.rendering; - if (null === cache$172) + cache$160 = type.rendering; + if (null === cache$160) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10255,11 +10325,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$172 = findFirstSuspended(current); - if (null !== cache$172) { + cache$160 = findFirstSuspended(current); + if (null !== cache$160) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$172.updateQueue; + current = cache$160.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10284,7 +10354,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$172)), null !== current)) { + if (((current = findFirstSuspended(cache$160)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10294,7 +10364,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$172.alternate && + !cache$160.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10307,13 +10377,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$172.sibling = workInProgress.child), - (workInProgress.child = cache$172)) + ? ((cache$160.sibling = workInProgress.child), + (workInProgress.child = cache$160)) : ((current = type.last), null !== current - ? (current.sibling = cache$172) - : (workInProgress.child = cache$172), - (type.last = cache$172)); + ? (current.sibling = cache$160) + : (workInProgress.child = cache$160), + (type.last = cache$160)); } if (null !== type.tail) return ( @@ -10495,6 +10565,7 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10502,6 +10573,7 @@ var DefaultAsyncDispatcher = { workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -10546,7 +10618,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10558,7 +10631,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10581,7 +10655,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10613,11 +10693,14 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; switch (didTimeout) { @@ -10629,7 +10712,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10643,6 +10727,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { default: throw Error(formatProdErrorMessage(329)); } + renderWasConcurrent.finishedWork = shouldTimeSlice; + renderWasConcurrent.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && ((didTimeout = globalMostRecentFallbackTime + 300 - now$1()), @@ -10651,7 +10737,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10663,7 +10750,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10676,7 +10766,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10728,7 +10821,10 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10744,10 +10840,13 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10755,31 +10854,33 @@ function commitRootWhenReady( recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -10795,25 +10896,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : 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 && @@ -10842,13 +10946,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -10859,7 +10968,9 @@ function performSyncWorkOnRoot(root, lanes) { workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes ); ensureRootIsScheduled(root); return null; @@ -10901,8 +11012,10 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -10919,9 +11032,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; @@ -11020,7 +11133,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -11057,15 +11171,16 @@ function renderRootSync(root, lanes) { null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue, reason); } } workLoopSync(); break; - } catch (thrownValue$187) { - handleThrow(root, thrownValue$187); + } catch (thrownValue$175) { + handleThrow(root, thrownValue$175); } while (1); lanes && root.shellSuspendCounter++; @@ -11112,7 +11227,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 1); break; case 2: if (isThenableResolved(memoizedUpdaters)) { @@ -11142,7 +11257,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 7)); break; case 5: var resource = null; @@ -11169,12 +11284,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 6); break; case 8: resetWorkInProgressStack(); @@ -11185,8 +11300,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$189) { - handleThrow(root, thrownValue$189); + } catch (thrownValue$177) { + handleThrow(root, thrownValue$177); } while (1); resetContextDependencies(); @@ -11296,39 +11411,20 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if (0 !== (root.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; 0 === (completedWork.mode & 2) @@ -11349,12 +11445,44 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if (0 !== (unitOfWork.mode & 2)) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11367,7 +11495,9 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ); } finally { (ReactSharedInternals.T = prevTransition), @@ -11381,7 +11511,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11400,7 +11532,14 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11416,32 +11555,32 @@ 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); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - ReactDOMSharedInternals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = ReactDOMSharedInternals.p), + (ReactDOMSharedInternals.p = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + commitBeforeMutationEffects(root, finishedWork), + (commitTime = now()), + commitMutationEffects(root, finishedWork, lanes), + restoreSelection(selectionInformation), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (ReactDOMSharedInternals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : ((root.current = finishedWork), (commitTime = now())); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11484,7 +11623,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$193 = rootWithPendingPassiveEffects, + var root$181 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11529,7 +11668,7 @@ function flushPassiveEffects() { _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit, - commitTime$117 = commitTime, + commitTime$125 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && @@ -11537,7 +11676,7 @@ function flushPassiveEffects() { id, phase, passiveEffectDuration, - commitTime$117 + commitTime$125 ); var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { @@ -11577,7 +11716,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$193, remainingLanes); + releaseRootPooledCache(root$181, remainingLanes); } } return !1; @@ -11658,6 +11797,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -11670,7 +11810,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now$1() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -11749,14 +11891,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$195 = firstScheduledRoot; null !== root$195; ) { + for (var root$183 = firstScheduledRoot; null !== root$183; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$195.pendingLanes; + var pendingLanes = root$183.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$195.suspendedLanes, - pingedLanes = root$195.pingedLanes; + var suspendedLanes = root$183.suspendedLanes, + pingedLanes = root$183.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11770,17 +11912,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$195, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$183, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$195, - root$195 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$183, + root$183 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$195, JSCompiler_inline_result)); - root$195 = root$195.next; + performSyncWorkOnRoot(root$183, JSCompiler_inline_result)); + root$183 = root$183.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11821,12 +11963,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; } @@ -11990,20 +12132,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1504 = 0; - i$jscomp$inline_1504 < simpleEventPluginEvents.length; - i$jscomp$inline_1504++ + var i$jscomp$inline_1512 = 0; + i$jscomp$inline_1512 < simpleEventPluginEvents.length; + i$jscomp$inline_1512++ ) { - var eventName$jscomp$inline_1505 = - simpleEventPluginEvents[i$jscomp$inline_1504], - domEventName$jscomp$inline_1506 = - eventName$jscomp$inline_1505.toLowerCase(), - capitalizedEvent$jscomp$inline_1507 = - eventName$jscomp$inline_1505[0].toUpperCase() + - eventName$jscomp$inline_1505.slice(1); + var eventName$jscomp$inline_1513 = + simpleEventPluginEvents[i$jscomp$inline_1512], + domEventName$jscomp$inline_1514 = + eventName$jscomp$inline_1513.toLowerCase(), + capitalizedEvent$jscomp$inline_1515 = + eventName$jscomp$inline_1513[0].toUpperCase() + + eventName$jscomp$inline_1513.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1506, - "on" + capitalizedEvent$jscomp$inline_1507 + domEventName$jscomp$inline_1514, + "on" + capitalizedEvent$jscomp$inline_1515 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13186,34 +13328,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$209 = props[hasSrc]; - if (null != propValue$209) + var propValue$197 = props[hasSrc]; + if (null != propValue$197) switch (hasSrc) { case "name": - hasSrcSet = propValue$209; + hasSrcSet = propValue$197; break; case "type": - propValue = propValue$209; + propValue = propValue$197; break; case "checked": - checked = propValue$209; + checked = propValue$197; break; case "defaultChecked": - defaultChecked = propValue$209; + defaultChecked = propValue$197; break; case "value": - propKey = propValue$209; + propKey = propValue$197; break; case "defaultValue": - defaultValue = propValue$209; + defaultValue = propValue$197; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$209) + if (null != propValue$197) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$209, props, null); + setProp(domElement, tag, hasSrc, propValue$197, props, null); } } initInput( @@ -13350,14 +13492,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$209 in props) - props.hasOwnProperty(propValue$209) && - ((hasSrc = props[propValue$209]), + for (propValue$197 in props) + props.hasOwnProperty(propValue$197) && + ((hasSrc = props[propValue$197]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$209, + propValue$197, hasSrc, props, void 0 @@ -13405,14 +13547,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$226 in nextProps) { - var propKey = nextProps[propKey$226]; - lastProp = lastProps[propKey$226]; + for (var propKey$214 in nextProps) { + var propKey = nextProps[propKey$214]; + lastProp = lastProps[propKey$214]; if ( - nextProps.hasOwnProperty(propKey$226) && + nextProps.hasOwnProperty(propKey$214) && (null != propKey || null != lastProp) ) - switch (propKey$226) { + switch (propKey$214) { case "type": type = propKey; break; @@ -13441,7 +13583,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$226, + propKey$214, propKey, nextProps, lastProp @@ -13460,7 +13602,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$226 = null; + propKey = value = defaultValue = propKey$214 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13491,7 +13633,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$226 = type; + propKey$214 = type; break; case "defaultValue": defaultValue = type; @@ -13512,15 +13654,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$226 - ? updateOptions(domElement, !!lastProps, propKey$226, !1) + null != propKey$214 + ? updateOptions(domElement, !!lastProps, propKey$214, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$226 = null; + propKey = propKey$214 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13544,7 +13686,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$226 = name; + propKey$214 = name; break; case "defaultValue": propKey = name; @@ -13558,17 +13700,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$226, propKey); + updateTextarea(domElement, propKey$214, propKey); return; case "option": - for (var propKey$242 in lastProps) + for (var propKey$230 in lastProps) if ( - ((propKey$226 = lastProps[propKey$242]), - lastProps.hasOwnProperty(propKey$242) && - null != propKey$226 && - !nextProps.hasOwnProperty(propKey$242)) + ((propKey$214 = lastProps[propKey$230]), + lastProps.hasOwnProperty(propKey$230) && + null != propKey$214 && + !nextProps.hasOwnProperty(propKey$230)) ) - switch (propKey$242) { + switch (propKey$230) { case "selected": domElement.selected = !1; break; @@ -13576,33 +13718,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$242, + propKey$230, null, nextProps, - propKey$226 + propKey$214 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$226 = nextProps[lastDefaultValue]), + ((propKey$214 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$226 !== propKey && - (null != propKey$226 || null != propKey)) + propKey$214 !== propKey && + (null != propKey$214 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$226 && - "function" !== typeof propKey$226 && - "symbol" !== typeof propKey$226; + propKey$214 && + "function" !== typeof propKey$214 && + "symbol" !== typeof propKey$214; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$226, + propKey$214, nextProps, propKey ); @@ -13623,24 +13765,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$247 in lastProps) - (propKey$226 = lastProps[propKey$247]), - lastProps.hasOwnProperty(propKey$247) && - null != propKey$226 && - !nextProps.hasOwnProperty(propKey$247) && - setProp(domElement, tag, propKey$247, null, nextProps, propKey$226); + for (var propKey$235 in lastProps) + (propKey$214 = lastProps[propKey$235]), + lastProps.hasOwnProperty(propKey$235) && + null != propKey$214 && + !nextProps.hasOwnProperty(propKey$235) && + setProp(domElement, tag, propKey$235, null, nextProps, propKey$214); for (checked in nextProps) if ( - ((propKey$226 = nextProps[checked]), + ((propKey$214 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$226 !== propKey && - (null != propKey$226 || null != propKey)) + propKey$214 !== propKey && + (null != propKey$214 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$226) + if (null != propKey$214) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13648,7 +13790,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$226, + propKey$214, nextProps, propKey ); @@ -13656,49 +13798,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$252 in lastProps) - (propKey$226 = lastProps[propKey$252]), - lastProps.hasOwnProperty(propKey$252) && - void 0 !== propKey$226 && - !nextProps.hasOwnProperty(propKey$252) && + for (var propKey$240 in lastProps) + (propKey$214 = lastProps[propKey$240]), + lastProps.hasOwnProperty(propKey$240) && + void 0 !== propKey$214 && + !nextProps.hasOwnProperty(propKey$240) && setPropOnCustomElement( domElement, tag, - propKey$252, + propKey$240, void 0, nextProps, - propKey$226 + propKey$214 ); for (defaultChecked in nextProps) - (propKey$226 = nextProps[defaultChecked]), + (propKey$214 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$226 === propKey || - (void 0 === propKey$226 && void 0 === propKey) || + propKey$214 === propKey || + (void 0 === propKey$214 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$226, + propKey$214, nextProps, propKey ); return; } } - for (var propKey$257 in lastProps) - (propKey$226 = lastProps[propKey$257]), - lastProps.hasOwnProperty(propKey$257) && - null != propKey$226 && - !nextProps.hasOwnProperty(propKey$257) && - setProp(domElement, tag, propKey$257, null, nextProps, propKey$226); + for (var propKey$245 in lastProps) + (propKey$214 = lastProps[propKey$245]), + lastProps.hasOwnProperty(propKey$245) && + null != propKey$214 && + !nextProps.hasOwnProperty(propKey$245) && + setProp(domElement, tag, propKey$245, null, nextProps, propKey$214); for (lastProp in nextProps) - (propKey$226 = nextProps[lastProp]), + (propKey$214 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$226 === propKey || - (null == propKey$226 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$226, nextProps, propKey); + propKey$214 === propKey || + (null == propKey$214 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$214, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14243,26 +14385,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$265 = getResourcesFromRoot( + var styles$253 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$266 = styles$265.get(type); - resource$266 || + resource$254 = styles$253.get(type); + resource$254 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$266 = { + (resource$254 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$265.set(type, resource$266), - (styles$265 = JSCompiler_inline_result.querySelector( + styles$253.set(type, resource$254), + (styles$253 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$265._p && - ((resource$266.instance = styles$265), - (resource$266.state.loading = 5)), + !styles$253._p && + ((resource$254.instance = styles$253), + (resource$254.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14275,16 +14417,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$265 || + styles$253 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$266.state + resource$254.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$266; + return resource$254; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14381,37 +14523,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$271 = hoistableRoot.querySelector( + var instance$259 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$271) + if (instance$259) return ( (resource.state.loading |= 4), - (resource.instance = instance$271), - markNodeAsHoistable(instance$271), - instance$271 + (resource.instance = instance$259), + markNodeAsHoistable(instance$259), + instance$259 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$271 = ( + instance$259 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$271); - var linkInstance = instance$271; + markNodeAsHoistable(instance$259); + var linkInstance = instance$259; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$271, "link", instance); + setInitialProperties(instance$259, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$271, props.precedence, hoistableRoot); - return (resource.instance = instance$271); + insertStylesheet(instance$259, props.precedence, hoistableRoot); + return (resource.instance = instance$259); case "script": - instance$271 = getScriptKey(props.src); + instance$259 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$271) + getScriptSelectorFromKey(instance$259) )) ) return ( @@ -14420,7 +14562,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$271))) + if ((styleProps = preloadPropsMap.get(instance$259))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14743,6 +14885,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -15462,16 +15605,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1753 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1761 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1753 + "19.0.0-rc-94e652d5-20240912" !== + isomorphicReactPackageVersion$jscomp$inline_1761 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1753, - "19.0.0-rc-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1761, + "19.0.0-rc-94e652d5-20240912" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15491,18 +15634,18 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_1760 = { +var internals$jscomp$inline_1768 = { bundleType: 0, - version: "19.0.0-rc-7771d3a7-20240827", + version: "19.0.0-rc-94e652d5-20240912", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-7771d3a7-20240827", + reconcilerVersion: "19.0.0-rc-94e652d5-20240912", getLaneLabelMap: function () { for ( - var map = new Map(), lane = 1, index$288 = 0; - 31 > index$288; - index$288++ + var map = new Map(), lane = 1, index$276 = 0; + 31 > index$276; + index$276++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -15515,16 +15658,16 @@ var internals$jscomp$inline_1760 = { } }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2140 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2160 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2140.isDisabled && - hook$jscomp$inline_2140.supportsFiber + !hook$jscomp$inline_2160.isDisabled && + hook$jscomp$inline_2160.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2140.inject( - internals$jscomp$inline_1760 + (rendererID = hook$jscomp$inline_2160.inject( + internals$jscomp$inline_1768 )), - (injectedHook = hook$jscomp$inline_2140); + (injectedHook = hook$jscomp$inline_2160); } catch (err) {} } function noop() {} @@ -15777,7 +15920,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js index 67393878d6c6f..ecaad9ea2e613 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js @@ -4172,7 +4172,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4185,8 +4184,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4199,7 +4197,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4212,33 +4210,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4254,8 +4225,7 @@ onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4268,6 +4238,34 @@ onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function pingTask(request, task) { request.pingedTasks.push(task); @@ -5536,6 +5534,7 @@ resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: replay, slots: name, @@ -8566,5 +8565,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-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js index 8bda064d2ffaa..147d797bc51db 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js @@ -3442,7 +3442,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3455,8 +3454,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3469,7 +3467,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3481,33 +3479,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -3523,8 +3494,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -3537,6 +3507,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } var currentRequest = null; function pingTask(request, task) { @@ -4335,6 +4333,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: ref, slots: name, @@ -5622,4 +5621,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js index f6c07e29a80c1..ba8aeaa03e5b5 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js @@ -4172,7 +4172,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4185,8 +4184,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4199,7 +4197,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4212,33 +4210,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4254,8 +4225,7 @@ onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4268,6 +4238,34 @@ onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function pingTask(request, task) { request.pingedTasks.push(task); @@ -5536,6 +5534,7 @@ resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: replay, slots: name, @@ -8566,5 +8565,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js index 5c80916be670d..f6b6817dc676a 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js @@ -3490,7 +3490,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3503,8 +3502,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3517,7 +3515,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3529,33 +3527,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -3571,8 +3542,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -3585,6 +3555,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } var currentRequest = null; function pingTask(request, task) { @@ -4391,6 +4389,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: ref, slots: name, @@ -5700,4 +5699,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js index f671015c168cb..496c704eceb60 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js @@ -4319,7 +4319,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4332,8 +4331,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4346,7 +4344,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4359,33 +4357,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4401,8 +4372,7 @@ onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4415,6 +4385,34 @@ onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function pingTask(request, task) { request.pingedTasks.push(task); @@ -5684,6 +5682,7 @@ resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: replay, slots: name, @@ -8753,11 +8752,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-94e652d5-20240912" !== 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-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToReadableStream = function (children, options) { @@ -8850,5 +8849,5 @@ startWork(request$jscomp$0); }); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js index 86d98a463a33c..25b96807408e0 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js @@ -3808,7 +3808,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3821,8 +3820,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3835,7 +3833,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3847,33 +3845,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -3889,8 +3860,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -3903,6 +3873,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } var currentRequest = null; function pingTask(request, task) { @@ -4701,6 +4699,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: ref, slots: name, @@ -5911,14 +5910,14 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_731 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== + "19.0.0-rc-94e652d5-20240912" !== isomorphicReactPackageVersion$jscomp$inline_731 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_731, - "19.0.0-rc-7771d3a7-20240827" + "19.0.0-rc-94e652d5-20240912" ) ); exports.renderToReadableStream = function (children, options) { @@ -6007,4 +6006,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js index 9e667cb883714..6322fd0e66b19 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js @@ -3466,7 +3466,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3479,8 +3478,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3493,7 +3491,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3505,33 +3503,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -3547,8 +3518,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -3561,6 +3531,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } var currentRequest = null; function pingTask(request, task) { @@ -4367,6 +4365,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: ref, slots: name, @@ -5595,13 +5594,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_735 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== + "19.0.0-rc-94e652d5-20240912" !== isomorphicReactPackageVersion$jscomp$inline_735 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_735 + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -5689,4 +5688,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js index 3c19a28a57bf6..99ad8545eb2e3 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js @@ -4315,7 +4315,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4328,8 +4327,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4342,7 +4340,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4355,33 +4353,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4397,8 +4368,7 @@ onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4411,6 +4381,34 @@ onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function resolveRequest() { if (currentRequest) return currentRequest; @@ -5688,6 +5686,7 @@ resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: replay, slots: name, @@ -8772,11 +8771,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-94e652d5-20240912" !== 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-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToReadableStream = function (children, options) { @@ -8880,5 +8879,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js index f3d80f80cef73..60d23dd17361e 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js @@ -3848,7 +3848,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3861,8 +3860,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3875,7 +3873,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3887,33 +3885,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -3929,8 +3900,7 @@ function createRequest( onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -3943,6 +3913,34 @@ function createRequest( onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } var currentRequest = null; function resolveRequest() { @@ -4757,6 +4755,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: ref, slots: name, @@ -6005,13 +6004,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_739 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== + "19.0.0-rc-94e652d5-20240912" !== isomorphicReactPackageVersion$jscomp$inline_739 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_739 + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -6110,4 +6109,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js index 179ce3f6d8eaf..7a4dc8298b858 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js @@ -3986,7 +3986,6 @@ } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3999,8 +3998,7 @@ onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4013,7 +4011,7 @@ this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4026,33 +4024,6 @@ this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function resolveRequest() { if (currentRequest) return currentRequest; @@ -5326,6 +5297,7 @@ resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: replay, slots: name, @@ -7116,8 +7088,7 @@ null, 0 ); - return new RequestInstance( - children, + options = new RequestInstance( resumableState, onHeaders, nonce, @@ -7130,6 +7101,27 @@ options ? options.onPostpone : void 0, options ? options.formState : void 0 ); + resumableState = createPendingSegment(options, 0, null, nonce, !1, !1); + resumableState.parentFlushed = !0; + children = createRenderTask( + options, + null, + children, + -1, + null, + resumableState, + null, + options.abortableTasks, + null, + nonce, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + options.pingedTasks.push(children); + return options; } var util = require("util"), crypto = require("crypto"), @@ -8630,11 +8622,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-94e652d5-20240912" !== 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-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToPipeableStream = function (children, options) { @@ -8676,5 +8668,5 @@ } }; }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js index 6475e58abd9ce..3ab9e272ae9ae 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js @@ -3528,7 +3528,6 @@ function defaultErrorHandler(error) { } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -3541,8 +3540,7 @@ function RequestInstance( onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -3555,7 +3553,7 @@ function RequestInstance( this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -3567,33 +3565,6 @@ function RequestInstance( this.onShellError = void 0 === onShellError ? noop : onShellError; this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } var currentRequest = null; function resolveRequest() { @@ -4405,6 +4376,7 @@ function retryNode(request, task) { resumedBoundary.rootSegmentID = type; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = key; task.replay = { nodes: ref, slots: name, @@ -5654,13 +5626,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_762 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== + "19.0.0-rc-94e652d5-20240912" !== isomorphicReactPackageVersion$jscomp$inline_762 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_762 + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-94e652d5-20240912\nLearn more: https://react.dev/warnings/version-mismatch") ); function createDrainHandler(destination, request) { return function () { @@ -5881,8 +5853,7 @@ function createRequestImpl(children, options) { null, 0 ); - return new RequestInstance( - children, + options = new RequestInstance( JSCompiler_inline_result, onHeaders, nonce, @@ -5895,6 +5866,34 @@ function createRequestImpl(children, options) { options ? options.onPostpone : void 0, options ? options.formState : void 0 ); + JSCompiler_inline_result = createPendingSegment( + options, + 0, + null, + nonce, + !1, + !1 + ); + JSCompiler_inline_result.parentFlushed = !0; + children = createRenderTask( + options, + null, + children, + -1, + null, + JSCompiler_inline_result, + null, + options.abortableTasks, + null, + nonce, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + options.pingedTasks.push(children); + return options; } exports.renderToPipeableStream = function (children, options) { var request = createRequestImpl(children, options), @@ -5935,4 +5934,4 @@ exports.renderToPipeableStream = function (children, options) { } }; }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js index 173968e695fe5..d9f1449ba241a 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js @@ -416,7 +416,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js index 095b510774e87..4e0175702b7cf 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js @@ -207,4 +207,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js index b8e5b5d5d8823..2867b2cf01fc3 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js @@ -336,5 +336,5 @@ })) : Internals.d.m(href)); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js index 677e60302ca72..b92e0170f5c9e 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js @@ -149,4 +149,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-dom/package.json b/packages/next/src/compiled/react-dom/package.json index 9cade623320be..e999e1c9bae8a 100644 --- a/packages/next/src/compiled/react-dom/package.json +++ b/packages/next/src/compiled/react-dom/package.json @@ -67,10 +67,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.25.0-rc-7771d3a7-20240827" + "scheduler": "0.25.0-rc-94e652d5-20240912" }, "peerDependencies": { - "react": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-94e652d5-20240912" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-dom/static.edge.js b/packages/next/src/compiled/react-dom/static.edge.js index de57d7a4c022e..ff770374b314a 100644 --- a/packages/next/src/compiled/react-dom/static.edge.js +++ b/packages/next/src/compiled/react-dom/static.edge.js @@ -9,3 +9,4 @@ if (process.env.NODE_ENV === 'production') { exports.version = s.version; exports.prerender = s.prerender; +exports.resumeAndPrerender = s.resumeAndPrerender; diff --git a/packages/next/src/compiled/react-experimental/cjs/react.development.js b/packages/next/src/compiled/react-experimental/cjs/react.development.js index ef45f672d3fda..0a1a13f44d968 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.development.js @@ -1233,7 +1233,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-experimental/cjs/react.production.js b/packages/next/src/compiled/react-experimental/cjs/react.production.js index 9916bf518ef8c..44f12a28b1d43 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.production.js @@ -562,4 +562,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js index d39f411b29a54..27070b119b7fd 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js @@ -979,5 +979,5 @@ exports.useMemo = function (create, deps) { return resolveDispatcher().useMemo(create, deps); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js index 8e16a838764cf..48e23a2a6365c 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js @@ -567,4 +567,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react-is/package.json b/packages/next/src/compiled/react-is/package.json index db9e4d6053862..f1ae75ddca1cc 100644 --- a/packages/next/src/compiled/react-is/package.json +++ b/packages/next/src/compiled/react-is/package.json @@ -1,6 +1,6 @@ { "name": "react-is", - "version": "19.0.0-rc-7771d3a7-20240827", + "version": "19.0.0-rc-94e652d5-20240912", "description": "Brand checking of React Elements.", "main": "index.js", "sideEffects": false, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js index b2f56ee87e91b..2ef6086088730 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js @@ -1174,11 +1174,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1188,8 +1185,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1938,39 +1937,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -1978,122 +1977,72 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - var errorInfo = JSON.parse(buffer); - model = errorInfo.digest; - as = errorInfo.env; - errorInfo = buildFakeCallStack( + chunk = JSON.parse(buffer); + buffer = chunk.digest; + tag = chunk.env; + chunk = buildFakeCallStack( response, - errorInfo.stack, - as, + chunk.stack, + tag, Error.bind( null, - errorInfo.message || + chunk.message || "An error occurred in the Server Components render but no message was provided" ) ); - var rootTask = getRootTask(response, as); - errorInfo = null != rootTask ? rootTask.run(errorInfo) : errorInfo(); - errorInfo.digest = model; - errorInfo.environmentName = as; - model = response._chunks; - (as = model.get(id)) - ? triggerErrorOnChunk(as, errorInfo) - : model.set( + stringDecoder = getRootTask(response, tag); + chunk = null != stringDecoder ? stringDecoder.run(chunk) : chunk(); + chunk.digest = buffer; + chunk.environmentName = tag; + buffer = response._chunks; + (tag = buffer.get(id)) + ? triggerErrorOnChunk(tag, chunk) + : buffer.set( id, - new ReactPromise("rejected", null, errorInfo, response) + new ReactPromise("rejected", null, chunk, response) ); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); + buffer = JSON.parse(buffer, response._fromJSON); initializeFakeTask( response, - model, - void 0 === model.env ? response._rootEnvironmentName : model.env + buffer, + void 0 === buffer.env ? response._rootEnvironmentName : buffer.env ); - initializeFakeStack(response, model); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - a: if (response._replayConsole) { - stringDecoder = JSON.parse(buffer, response._fromJSON); - id = stringDecoder[0]; - buffer = stringDecoder[1]; - tag = stringDecoder[2]; - chunk = stringDecoder[3]; - stringDecoder = stringDecoder.slice(4); - row = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - currentOwnerInDEV = tag; - try { - b: { - i = 0; - switch (id) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind.apply( - console[id], - [console].concat(stringDecoder) - ); - break b; - case "assert": - i = 1; - } - as = stringDecoder.slice(0); - "string" === typeof as[i] - ? as.splice( - i, - 1, - "%c%s%c " + as[i], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ) - : as.splice( - i, - 0, - "%c%s%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ); - as.unshift(console); - model = bind.apply(console[id], as); - } - errorInfo = buildFakeCallStack(response, buffer, chunk, model); - if ( - null != tag && - ((rootTask = initializeFakeTask(response, tag, chunk)), - initializeFakeStack(response, tag), - null !== rootTask) - ) { - rootTask.run(errorInfo); - break a; - } - var rootTask$jscomp$0 = getRootTask(response, chunk); - null != rootTask$jscomp$0 - ? rootTask$jscomp$0.run(errorInfo) - : errorInfo(); - } finally { - ReactSharedInternals.getCurrentStack = row; - } - } + response._replayConsole && + ((stringDecoder = JSON.parse(buffer, response._fromJSON)), + (id = stringDecoder[0]), + (buffer = stringDecoder[1]), + (tag = stringDecoder[2]), + (chunk = stringDecoder[3]), + (stringDecoder = stringDecoder.slice(4)), + replayConsoleWithCallStackInDEV( + response, + id, + buffer, + tag, + chunk, + stringDecoder + )); break; case 82: startReadableStream(response, id, void 0); @@ -2113,26 +2062,26 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; case 80: - model = JSON.parse(buffer); - model = buildFakeCallStack( + buffer = JSON.parse(buffer); + buffer = buildFakeCallStack( response, - model.stack, - model.env, - Error.bind(null, model.reason || "") + buffer.stack, + buffer.env, + Error.bind(null, buffer.reason || "") ); - as = response._debugRootTask; - model = null != as ? as.run(model) : model(); - model.$$typeof = REACT_POSTPONE_TYPE; - as = response._chunks; - (errorInfo = as.get(id)) - ? triggerErrorOnChunk(errorInfo, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + tag = response._debugRootTask; + buffer = null != tag ? tag.run(buffer) : buffer(); + buffer.$$typeof = REACT_POSTPONE_TYPE; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2352,8 +2301,8 @@ var reader = stream.getReader(); reader.read().then(progress).catch(error); } - var ReactDOM = require("react-dom"), - React = require("react"), + var React = require("react"), + ReactDOM = require("react-dom"), decoderOptions = { stream: !0 }, bind = Function.prototype.bind, chunkCache = new Map(), @@ -2440,7 +2389,104 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), - currentOwnerInDEV = null; + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + a: { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + var JSCompiler_inline_result = bind.apply( + console[methodName], + [console].concat(args) + ); + break a; + case "assert": + offset = 1; + } + var newArgs = args.slice(0); + "string" === typeof newArgs[offset] + ? newArgs.splice( + offset, + 1, + "%c%s%c " + newArgs[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ) + : newArgs.splice( + offset, + 0, + "%c%s%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ); + newArgs.unshift(console); + JSCompiler_inline_result = bind.apply( + console[methodName], + newArgs + ); + } + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + JSCompiler_inline_result + ); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } + var rootTask = getRootTask(response, env); + null != rootTask ? rootTask.run(callStack) : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }, + replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[ + "react-stack-bottom-frame" + ].bind(replayConsoleWithCallStack); + (function (internals) { + if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled || !hook.supportsFlight) return !0; + try { + hook.inject(internals); + } catch (err) { + console.error("React instrumentation encountered an error: %s.", err); + } + return hook.checkDCE ? !0 : !1; + })({ + bundleType: 1, + version: "19.0.0-experimental-94e652d5-20240912", + rendererPackageName: "react-server-dom-turbopack", + currentDispatcherRef: ReactSharedInternals, + reconcilerVersion: "19.0.0-experimental-94e652d5-20240912", + getCurrentComponentInfo: function () { + return currentOwnerInDEV; + } + }); exports.createFromFetch = function (promiseForResponse, options) { var response = createResponseFromOptions(options); promiseForResponse.then( diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.production.js index 697b194769a52..8700544b471d1 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.production.js @@ -748,10 +748,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -761,8 +759,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.development.js index 930a994970e51..2471ac3f54112 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.development.js @@ -1382,11 +1382,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1396,8 +1393,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -2151,39 +2150,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -2191,122 +2190,72 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - var errorInfo = JSON.parse(buffer); - model = errorInfo.digest; - as = errorInfo.env; - errorInfo = buildFakeCallStack( + chunk = JSON.parse(buffer); + buffer = chunk.digest; + tag = chunk.env; + chunk = buildFakeCallStack( response, - errorInfo.stack, - as, + chunk.stack, + tag, Error.bind( null, - errorInfo.message || + chunk.message || "An error occurred in the Server Components render but no message was provided" ) ); - var rootTask = getRootTask(response, as); - errorInfo = null != rootTask ? rootTask.run(errorInfo) : errorInfo(); - errorInfo.digest = model; - errorInfo.environmentName = as; - model = response._chunks; - (as = model.get(id)) - ? triggerErrorOnChunk(as, errorInfo) - : model.set( + stringDecoder = getRootTask(response, tag); + chunk = null != stringDecoder ? stringDecoder.run(chunk) : chunk(); + chunk.digest = buffer; + chunk.environmentName = tag; + buffer = response._chunks; + (tag = buffer.get(id)) + ? triggerErrorOnChunk(tag, chunk) + : buffer.set( id, - new ReactPromise("rejected", null, errorInfo, response) + new ReactPromise("rejected", null, chunk, response) ); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); + buffer = JSON.parse(buffer, response._fromJSON); initializeFakeTask( response, - model, - void 0 === model.env ? response._rootEnvironmentName : model.env + buffer, + void 0 === buffer.env ? response._rootEnvironmentName : buffer.env ); - initializeFakeStack(response, model); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - a: if (response._replayConsole) { - stringDecoder = JSON.parse(buffer, response._fromJSON); - id = stringDecoder[0]; - buffer = stringDecoder[1]; - tag = stringDecoder[2]; - chunk = stringDecoder[3]; - stringDecoder = stringDecoder.slice(4); - row = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - currentOwnerInDEV = tag; - try { - b: { - i = 0; - switch (id) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind$1.apply( - console[id], - [console].concat(stringDecoder) - ); - break b; - case "assert": - i = 1; - } - as = stringDecoder.slice(0); - "string" === typeof as[i] - ? as.splice( - i, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + as[i], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ) - : as.splice( - i, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ); - as.unshift(console); - model = bind$1.apply(console[id], as); - } - errorInfo = buildFakeCallStack(response, buffer, chunk, model); - if ( - null != tag && - ((rootTask = initializeFakeTask(response, tag, chunk)), - initializeFakeStack(response, tag), - null !== rootTask) - ) { - rootTask.run(errorInfo); - break a; - } - var rootTask$jscomp$0 = getRootTask(response, chunk); - null != rootTask$jscomp$0 - ? rootTask$jscomp$0.run(errorInfo) - : errorInfo(); - } finally { - ReactSharedInternals.getCurrentStack = row; - } - } + response._replayConsole && + ((stringDecoder = JSON.parse(buffer, response._fromJSON)), + (id = stringDecoder[0]), + (buffer = stringDecoder[1]), + (tag = stringDecoder[2]), + (chunk = stringDecoder[3]), + (stringDecoder = stringDecoder.slice(4)), + replayConsoleWithCallStackInDEV( + response, + id, + buffer, + tag, + chunk, + stringDecoder + )); break; case 82: startReadableStream(response, id, void 0); @@ -2326,26 +2275,26 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; case 80: - model = JSON.parse(buffer); - model = buildFakeCallStack( + buffer = JSON.parse(buffer); + buffer = buildFakeCallStack( response, - model.stack, - model.env, - Error.bind(null, model.reason || "") + buffer.stack, + buffer.env, + Error.bind(null, buffer.reason || "") ); - as = response._debugRootTask; - model = null != as ? as.run(model) : model(); - model.$$typeof = REACT_POSTPONE_TYPE; - as = response._chunks; - (errorInfo = as.get(id)) - ? triggerErrorOnChunk(errorInfo, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + tag = response._debugRootTask; + buffer = null != tag ? tag.run(buffer) : buffer(); + buffer.$$typeof = REACT_POSTPONE_TYPE; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2661,7 +2610,84 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), - currentOwnerInDEV = null; + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + a: { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + var JSCompiler_inline_result = bind$1.apply( + console[methodName], + [console].concat(args) + ); + break a; + case "assert": + offset = 1; + } + var newArgs = args.slice(0); + "string" === typeof newArgs[offset] + ? newArgs.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + newArgs[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ) + : newArgs.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ); + newArgs.unshift(console); + JSCompiler_inline_result = bind$1.apply( + console[methodName], + newArgs + ); + } + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + JSCompiler_inline_result + ); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } + var rootTask = getRootTask(response, env); + null != rootTask ? rootTask.run(callStack) : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }, + replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[ + "react-stack-bottom-frame" + ].bind(replayConsoleWithCallStack); exports.createFromFetch = function (promiseForResponse, options) { var response = createResponseFromOptions(options); promiseForResponse.then( diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.production.js index c632338a79450..879f6eee46526 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.production.js @@ -915,10 +915,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -928,8 +926,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.development.js index daf43e22b78d3..a77271e196801 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.development.js @@ -1382,11 +1382,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1396,8 +1393,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -2151,39 +2150,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -2191,122 +2190,72 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - var errorInfo = JSON.parse(buffer); - model = errorInfo.digest; - as = errorInfo.env; - errorInfo = buildFakeCallStack( + chunk = JSON.parse(buffer); + buffer = chunk.digest; + tag = chunk.env; + chunk = buildFakeCallStack( response, - errorInfo.stack, - as, + chunk.stack, + tag, Error.bind( null, - errorInfo.message || + chunk.message || "An error occurred in the Server Components render but no message was provided" ) ); - var rootTask = getRootTask(response, as); - errorInfo = null != rootTask ? rootTask.run(errorInfo) : errorInfo(); - errorInfo.digest = model; - errorInfo.environmentName = as; - model = response._chunks; - (as = model.get(id)) - ? triggerErrorOnChunk(as, errorInfo) - : model.set( + stringDecoder = getRootTask(response, tag); + chunk = null != stringDecoder ? stringDecoder.run(chunk) : chunk(); + chunk.digest = buffer; + chunk.environmentName = tag; + buffer = response._chunks; + (tag = buffer.get(id)) + ? triggerErrorOnChunk(tag, chunk) + : buffer.set( id, - new ReactPromise("rejected", null, errorInfo, response) + new ReactPromise("rejected", null, chunk, response) ); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); + buffer = JSON.parse(buffer, response._fromJSON); initializeFakeTask( response, - model, - void 0 === model.env ? response._rootEnvironmentName : model.env + buffer, + void 0 === buffer.env ? response._rootEnvironmentName : buffer.env ); - initializeFakeStack(response, model); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - a: if (response._replayConsole) { - stringDecoder = JSON.parse(buffer, response._fromJSON); - id = stringDecoder[0]; - buffer = stringDecoder[1]; - tag = stringDecoder[2]; - chunk = stringDecoder[3]; - stringDecoder = stringDecoder.slice(4); - row = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - currentOwnerInDEV = tag; - try { - b: { - i = 0; - switch (id) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind$1.apply( - console[id], - [console].concat(stringDecoder) - ); - break b; - case "assert": - i = 1; - } - as = stringDecoder.slice(0); - "string" === typeof as[i] - ? as.splice( - i, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + as[i], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ) - : as.splice( - i, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ); - as.unshift(console); - model = bind$1.apply(console[id], as); - } - errorInfo = buildFakeCallStack(response, buffer, chunk, model); - if ( - null != tag && - ((rootTask = initializeFakeTask(response, tag, chunk)), - initializeFakeStack(response, tag), - null !== rootTask) - ) { - rootTask.run(errorInfo); - break a; - } - var rootTask$jscomp$0 = getRootTask(response, chunk); - null != rootTask$jscomp$0 - ? rootTask$jscomp$0.run(errorInfo) - : errorInfo(); - } finally { - ReactSharedInternals.getCurrentStack = row; - } - } + response._replayConsole && + ((stringDecoder = JSON.parse(buffer, response._fromJSON)), + (id = stringDecoder[0]), + (buffer = stringDecoder[1]), + (tag = stringDecoder[2]), + (chunk = stringDecoder[3]), + (stringDecoder = stringDecoder.slice(4)), + replayConsoleWithCallStackInDEV( + response, + id, + buffer, + tag, + chunk, + stringDecoder + )); break; case 82: startReadableStream(response, id, void 0); @@ -2326,26 +2275,26 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; case 80: - model = JSON.parse(buffer); - model = buildFakeCallStack( + buffer = JSON.parse(buffer); + buffer = buildFakeCallStack( response, - model.stack, - model.env, - Error.bind(null, model.reason || "") + buffer.stack, + buffer.env, + Error.bind(null, buffer.reason || "") ); - as = response._debugRootTask; - model = null != as ? as.run(model) : model(); - model.$$typeof = REACT_POSTPONE_TYPE; - as = response._chunks; - (errorInfo = as.get(id)) - ? triggerErrorOnChunk(errorInfo, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + tag = response._debugRootTask; + buffer = null != tag ? tag.run(buffer) : buffer(); + buffer.$$typeof = REACT_POSTPONE_TYPE; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2550,7 +2499,84 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), - currentOwnerInDEV = null; + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + a: { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + var JSCompiler_inline_result = bind$1.apply( + console[methodName], + [console].concat(args) + ); + break a; + case "assert": + offset = 1; + } + var newArgs = args.slice(0); + "string" === typeof newArgs[offset] + ? newArgs.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + newArgs[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ) + : newArgs.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ); + newArgs.unshift(console); + JSCompiler_inline_result = bind$1.apply( + console[methodName], + newArgs + ); + } + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + JSCompiler_inline_result + ); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } + var rootTask = getRootTask(response, env); + null != rootTask ? rootTask.run(callStack) : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }, + replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[ + "react-stack-bottom-frame" + ].bind(replayConsoleWithCallStack); exports.createFromNodeStream = function (stream, ssrManifest, options) { var response = new ResponseInstance( ssrManifest.moduleMap, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.production.js index 5cf88ede53e9e..dc8b6851a4dff 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.production.js @@ -916,10 +916,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -929,8 +927,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json index 58e09426b50e0..edb8f23a9edab 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json @@ -48,7 +48,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "0.0.0-experimental-7771d3a7-20240827", - "react-dom": "0.0.0-experimental-7771d3a7-20240827" + "react": "0.0.0-experimental-94e652d5-20240912", + "react-dom": "0.0.0-experimental-94e652d5-20240912" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js index 0c802f1d54cf1..5af64a51008ac 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js @@ -22,6 +22,38 @@ : (obj[key] = value); return obj; } + function bindToConsole(methodName, args, badgeName) { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + return bind.apply(console[methodName], [console].concat(args)); + case "assert": + offset = 1; + } + args = args.slice(0); + "string" === typeof args[offset] + ? args.splice( + offset, + 1, + "%c%s%c " + args[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ) + : args.splice( + offset, + 0, + "%c%s%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ); + args.unshift(console); + return bind.apply(console[methodName], args); + } function resolveClientReference(bundlerConfig, metadata) { if (bundlerConfig) { var moduleExports = bundlerConfig[metadata[0]]; @@ -1151,11 +1183,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1165,8 +1194,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1667,6 +1698,34 @@ } return fn; } + function buildFakeCallStack(response, stack, environmentName, innerCall) { + for (var i = 0; i < stack.length; i++) { + var frame = stack[i], + frameKey = frame.join("-") + "-" + environmentName, + fn = fakeFunctionCache.get(frameKey); + if (void 0 === fn) { + fn = frame[0]; + var filename = frame[1], + line = frame[2]; + frame = frame[3]; + var findSourceMapURL = response._debugFindSourceMapURL; + findSourceMapURL = findSourceMapURL + ? findSourceMapURL(filename, environmentName) + : null; + fn = createFakeFunction( + fn, + filename, + findSourceMapURL, + line, + frame, + environmentName + ); + fakeFunctionCache.set(frameKey, fn); + } + innerCall = fn.bind(null, innerCall); + } + return innerCall; + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -1778,39 +1837,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -1818,117 +1877,70 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - tag = JSON.parse(buffer); - as = tag.digest; - buffer = tag.env; - model = Error( - tag.message || + stringDecoder = JSON.parse(buffer); + tag = stringDecoder.digest; + chunk = stringDecoder.env; + buffer = Error( + stringDecoder.message || "An error occurred in the Server Components render but no message was provided" ); - tag = tag.stack; - chunk = model.name + ": " + model.message; - if (tag) - for ( - stringDecoder = 0; - stringDecoder < tag.length; - stringDecoder++ - ) { - var frame = tag[stringDecoder]; - row = frame[0]; - i = frame[1]; - var line = frame[2]; + stringDecoder = stringDecoder.stack; + row = buffer.name + ": " + buffer.message; + if (stringDecoder) + for (i = 0; i < stringDecoder.length; i++) { + var frame = stringDecoder[i], + name = frame[0], + filename = frame[1], + line = frame[2]; frame = frame[3]; - chunk = row - ? chunk + + row = name + ? row + ("\n at " + - row + + name + " (" + - i + + filename + ":" + line + ":" + frame + ")") - : chunk + ("\n at " + i + ":" + line + ":" + frame); + : row + ("\n at " + filename + ":" + line + ":" + frame); } - model.stack = chunk; - model.digest = as; - model.environmentName = buffer; - as = response._chunks; - (buffer = as.get(id)) - ? triggerErrorOnChunk(buffer, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + buffer.stack = row; + buffer.digest = tag; + buffer.environmentName = chunk; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); - initializeFakeStack(response, model); + buffer = JSON.parse(buffer, response._fromJSON); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - if (response._replayConsole) { - buffer = JSON.parse(buffer, response._fromJSON); - response = buffer[0]; - id = buffer[3]; - buffer = buffer.slice(4); - tag = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - try { - a: { - chunk = 0; - switch (response) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind.apply( - console[response], - [console].concat(buffer) - ); - break a; - case "assert": - chunk = 1; - } - as = buffer.slice(0); - "string" === typeof as[chunk] - ? as.splice( - chunk, - 1, - "%c%s%c " + as[chunk], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ) - : as.splice( - chunk, - 0, - "%c%s%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ); - as.unshift(console); - model = bind.apply(console[response], as); - } - model(); - } finally { - ReactSharedInternals.getCurrentStack = tag; - } - } + response._replayConsole && + ((buffer = JSON.parse(buffer, response._fromJSON)), + (response = buffer[0]), + (id = buffer[3]), + (buffer = buffer.slice(4)), + bindToConsole(response, buffer, id)()); break; case 82: startReadableStream(response, id, void 0); @@ -1948,10 +1960,10 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2131,8 +2143,8 @@ var reader = stream.getReader(); reader.read().then(progress).catch(error); } - var ReactDOM = require("react-dom"), - React = require("react"), + var React = require("react"), + ReactDOM = require("react-dom"), decoderOptions = { stream: !0 }, bind = Function.prototype.bind, chunkCache = new Map(), @@ -2204,37 +2216,80 @@ stack, environmentName ) { - for (var callStack = fakeJSXCallSite, i = 0; i < stack.length; i++) { - var frame = stack[i], - frameKey = frame.join("-") + "-" + environmentName, - fn = fakeFunctionCache.get(frameKey); - if (void 0 === fn) { - fn = frame[0]; - var filename = frame[1], - line = frame[2]; - frame = frame[3]; - var findSourceMapURL = response._debugFindSourceMapURL; - findSourceMapURL = findSourceMapURL - ? findSourceMapURL(filename, environmentName) - : null; - fn = createFakeFunction( - fn, - filename, - findSourceMapURL, - line, - frame, - environmentName - ); - fakeFunctionCache.set(frameKey, fn); - } - callStack = fn.bind(null, callStack); - } - return callStack(); + return buildFakeCallStack( + response, + stack, + environmentName, + fakeJSXCallSite + )(); } }, createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" - ].bind(createFakeJSXCallStack); + ].bind(createFakeJSXCallStack), + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + bindToConsole(methodName, args, env) + ); + null != owner && initializeFakeStack(response, owner); + var rootTask = response._debugRootTask; + if (rootTask) + if (response._rootEnvironmentName !== env) { + var createTaskFn = console.createTask.bind( + console, + '"use ' + env.toLowerCase() + '"' + ); + var rootTask$jscomp$0 = rootTask.run(createTaskFn); + } else rootTask$jscomp$0 = rootTask; + else rootTask$jscomp$0 = null; + null != rootTask$jscomp$0 + ? rootTask$jscomp$0.run(callStack) + : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }; + replayConsoleWithCallStack["react-stack-bottom-frame"].bind( + replayConsoleWithCallStack + ); + (function (internals) { + if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled || !hook.supportsFlight) return !0; + try { + hook.inject(internals); + } catch (err) { + console.error("React instrumentation encountered an error: %s.", err); + } + return hook.checkDCE ? !0 : !1; + })({ + bundleType: 1, + version: "19.0.0-rc-94e652d5-20240912", + rendererPackageName: "react-server-dom-turbopack", + currentDispatcherRef: ReactSharedInternals, + reconcilerVersion: "19.0.0-rc-94e652d5-20240912", + getCurrentComponentInfo: function () { + return currentOwnerInDEV; + } + }); exports.createFromFetch = function (promiseForResponse, options) { var response = createResponseFromOptions(options); promiseForResponse.then( diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js index 00ea6111c724f..473d7b4a3ae92 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js @@ -747,10 +747,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -760,8 +758,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js index 2d7af38c31e70..d4405e7a06706 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js @@ -22,6 +22,38 @@ : (obj[key] = value); return obj; } + function bindToConsole(methodName, args, badgeName) { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + return bind$1.apply(console[methodName], [console].concat(args)); + case "assert": + offset = 1; + } + args = args.slice(0); + "string" === typeof args[offset] + ? args.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + args[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ) + : args.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ); + args.unshift(console); + return bind$1.apply(console[methodName], args); + } function resolveClientReference(bundlerConfig, metadata) { if (bundlerConfig) { var moduleExports = bundlerConfig[metadata[0]]; @@ -1359,11 +1391,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1373,8 +1402,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1880,6 +1911,34 @@ } return fn; } + function buildFakeCallStack(response, stack, environmentName, innerCall) { + for (var i = 0; i < stack.length; i++) { + var frame = stack[i], + frameKey = frame.join("-") + "-" + environmentName, + fn = fakeFunctionCache.get(frameKey); + if (void 0 === fn) { + fn = frame[0]; + var filename = frame[1], + line = frame[2]; + frame = frame[3]; + var findSourceMapURL = response._debugFindSourceMapURL; + findSourceMapURL = findSourceMapURL + ? findSourceMapURL(filename, environmentName) + : null; + fn = createFakeFunction( + fn, + filename, + findSourceMapURL, + line, + frame, + environmentName + ); + fakeFunctionCache.set(frameKey, fn); + } + innerCall = fn.bind(null, innerCall); + } + return innerCall; + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -1991,39 +2050,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -2031,117 +2090,70 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - tag = JSON.parse(buffer); - as = tag.digest; - buffer = tag.env; - model = Error( - tag.message || + stringDecoder = JSON.parse(buffer); + tag = stringDecoder.digest; + chunk = stringDecoder.env; + buffer = Error( + stringDecoder.message || "An error occurred in the Server Components render but no message was provided" ); - tag = tag.stack; - chunk = model.name + ": " + model.message; - if (tag) - for ( - stringDecoder = 0; - stringDecoder < tag.length; - stringDecoder++ - ) { - var frame = tag[stringDecoder]; - row = frame[0]; - i = frame[1]; - var line = frame[2]; + stringDecoder = stringDecoder.stack; + row = buffer.name + ": " + buffer.message; + if (stringDecoder) + for (i = 0; i < stringDecoder.length; i++) { + var frame = stringDecoder[i], + name = frame[0], + filename = frame[1], + line = frame[2]; frame = frame[3]; - chunk = row - ? chunk + + row = name + ? row + ("\n at " + - row + + name + " (" + - i + + filename + ":" + line + ":" + frame + ")") - : chunk + ("\n at " + i + ":" + line + ":" + frame); + : row + ("\n at " + filename + ":" + line + ":" + frame); } - model.stack = chunk; - model.digest = as; - model.environmentName = buffer; - as = response._chunks; - (buffer = as.get(id)) - ? triggerErrorOnChunk(buffer, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + buffer.stack = row; + buffer.digest = tag; + buffer.environmentName = chunk; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); - initializeFakeStack(response, model); + buffer = JSON.parse(buffer, response._fromJSON); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - if (response._replayConsole) { - buffer = JSON.parse(buffer, response._fromJSON); - response = buffer[0]; - id = buffer[3]; - buffer = buffer.slice(4); - tag = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - try { - a: { - chunk = 0; - switch (response) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind$1.apply( - console[response], - [console].concat(buffer) - ); - break a; - case "assert": - chunk = 1; - } - as = buffer.slice(0); - "string" === typeof as[chunk] - ? as.splice( - chunk, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + as[chunk], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ) - : as.splice( - chunk, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ); - as.unshift(console); - model = bind$1.apply(console[response], as); - } - model(); - } finally { - ReactSharedInternals.getCurrentStack = tag; - } - } + response._replayConsole && + ((buffer = JSON.parse(buffer, response._fromJSON)), + (response = buffer[0]), + (id = buffer[3]), + (buffer = buffer.slice(4)), + bindToConsole(response, buffer, id)()); break; case 82: startReadableStream(response, id, void 0); @@ -2161,10 +2173,10 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2425,37 +2437,57 @@ stack, environmentName ) { - for (var callStack = fakeJSXCallSite, i = 0; i < stack.length; i++) { - var frame = stack[i], - frameKey = frame.join("-") + "-" + environmentName, - fn = fakeFunctionCache.get(frameKey); - if (void 0 === fn) { - fn = frame[0]; - var filename = frame[1], - line = frame[2]; - frame = frame[3]; - var findSourceMapURL = response._debugFindSourceMapURL; - findSourceMapURL = findSourceMapURL - ? findSourceMapURL(filename, environmentName) - : null; - fn = createFakeFunction( - fn, - filename, - findSourceMapURL, - line, - frame, - environmentName - ); - fakeFunctionCache.set(frameKey, fn); - } - callStack = fn.bind(null, callStack); - } - return callStack(); + return buildFakeCallStack( + response, + stack, + environmentName, + fakeJSXCallSite + )(); } }, createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" - ].bind(createFakeJSXCallStack); + ].bind(createFakeJSXCallStack), + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + try { + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + bindToConsole(methodName, args, env) + ); + null != owner && initializeFakeStack(response, owner); + var rootTask = response._debugRootTask; + if (rootTask) + if (response._rootEnvironmentName !== env) { + var createTaskFn = console.createTask.bind( + console, + '"use ' + env.toLowerCase() + '"' + ); + var rootTask$jscomp$0 = rootTask.run(createTaskFn); + } else rootTask$jscomp$0 = rootTask; + else rootTask$jscomp$0 = null; + null != rootTask$jscomp$0 + ? rootTask$jscomp$0.run(callStack) + : callStack(); + } finally { + ReactSharedInternals.getCurrentStack = prevStack; + } + } + }; + replayConsoleWithCallStack["react-stack-bottom-frame"].bind( + replayConsoleWithCallStack + ); exports.createFromFetch = function (promiseForResponse, options) { var response = createResponseFromOptions(options); promiseForResponse.then( diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js index ac65e2a46b862..f4c58a33d6d9c 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js @@ -914,10 +914,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -927,8 +925,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js index 88f3c6a7eb83f..6188fc1f8f491 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js @@ -22,6 +22,38 @@ : (obj[key] = value); return obj; } + function bindToConsole(methodName, args, badgeName) { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + return bind$1.apply(console[methodName], [console].concat(args)); + case "assert": + offset = 1; + } + args = args.slice(0); + "string" === typeof args[offset] + ? args.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + args[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ) + : args.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ); + args.unshift(console); + return bind$1.apply(console[methodName], args); + } function resolveClientReference(bundlerConfig, metadata) { if (bundlerConfig) { var moduleExports = bundlerConfig[metadata[0]]; @@ -1359,11 +1391,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1373,8 +1402,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1880,6 +1911,34 @@ } return fn; } + function buildFakeCallStack(response, stack, environmentName, innerCall) { + for (var i = 0; i < stack.length; i++) { + var frame = stack[i], + frameKey = frame.join("-") + "-" + environmentName, + fn = fakeFunctionCache.get(frameKey); + if (void 0 === fn) { + fn = frame[0]; + var filename = frame[1], + line = frame[2]; + frame = frame[3]; + var findSourceMapURL = response._debugFindSourceMapURL; + findSourceMapURL = findSourceMapURL + ? findSourceMapURL(filename, environmentName) + : null; + fn = createFakeFunction( + fn, + filename, + findSourceMapURL, + line, + frame, + environmentName + ); + fakeFunctionCache.set(frameKey, fn); + } + innerCall = fn.bind(null, innerCall); + } + return innerCall; + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -1991,39 +2050,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -2031,117 +2090,70 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - tag = JSON.parse(buffer); - as = tag.digest; - buffer = tag.env; - model = Error( - tag.message || + stringDecoder = JSON.parse(buffer); + tag = stringDecoder.digest; + chunk = stringDecoder.env; + buffer = Error( + stringDecoder.message || "An error occurred in the Server Components render but no message was provided" ); - tag = tag.stack; - chunk = model.name + ": " + model.message; - if (tag) - for ( - stringDecoder = 0; - stringDecoder < tag.length; - stringDecoder++ - ) { - var frame = tag[stringDecoder]; - row = frame[0]; - i = frame[1]; - var line = frame[2]; + stringDecoder = stringDecoder.stack; + row = buffer.name + ": " + buffer.message; + if (stringDecoder) + for (i = 0; i < stringDecoder.length; i++) { + var frame = stringDecoder[i], + name = frame[0], + filename = frame[1], + line = frame[2]; frame = frame[3]; - chunk = row - ? chunk + + row = name + ? row + ("\n at " + - row + + name + " (" + - i + + filename + ":" + line + ":" + frame + ")") - : chunk + ("\n at " + i + ":" + line + ":" + frame); + : row + ("\n at " + filename + ":" + line + ":" + frame); } - model.stack = chunk; - model.digest = as; - model.environmentName = buffer; - as = response._chunks; - (buffer = as.get(id)) - ? triggerErrorOnChunk(buffer, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + buffer.stack = row; + buffer.digest = tag; + buffer.environmentName = chunk; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); - initializeFakeStack(response, model); + buffer = JSON.parse(buffer, response._fromJSON); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - if (response._replayConsole) { - buffer = JSON.parse(buffer, response._fromJSON); - response = buffer[0]; - id = buffer[3]; - buffer = buffer.slice(4); - tag = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - try { - a: { - chunk = 0; - switch (response) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind$1.apply( - console[response], - [console].concat(buffer) - ); - break a; - case "assert": - chunk = 1; - } - as = buffer.slice(0); - "string" === typeof as[chunk] - ? as.splice( - chunk, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + as[chunk], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ) - : as.splice( - chunk, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ); - as.unshift(console); - model = bind$1.apply(console[response], as); - } - model(); - } finally { - ReactSharedInternals.getCurrentStack = tag; - } - } + response._replayConsole && + ((buffer = JSON.parse(buffer, response._fromJSON)), + (response = buffer[0]), + (id = buffer[3]), + (buffer = buffer.slice(4)), + bindToConsole(response, buffer, id)()); break; case 82: startReadableStream(response, id, void 0); @@ -2161,10 +2173,10 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2314,37 +2326,57 @@ stack, environmentName ) { - for (var callStack = fakeJSXCallSite, i = 0; i < stack.length; i++) { - var frame = stack[i], - frameKey = frame.join("-") + "-" + environmentName, - fn = fakeFunctionCache.get(frameKey); - if (void 0 === fn) { - fn = frame[0]; - var filename = frame[1], - line = frame[2]; - frame = frame[3]; - var findSourceMapURL = response._debugFindSourceMapURL; - findSourceMapURL = findSourceMapURL - ? findSourceMapURL(filename, environmentName) - : null; - fn = createFakeFunction( - fn, - filename, - findSourceMapURL, - line, - frame, - environmentName - ); - fakeFunctionCache.set(frameKey, fn); - } - callStack = fn.bind(null, callStack); - } - return callStack(); + return buildFakeCallStack( + response, + stack, + environmentName, + fakeJSXCallSite + )(); } }, createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" - ].bind(createFakeJSXCallStack); + ].bind(createFakeJSXCallStack), + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + try { + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + bindToConsole(methodName, args, env) + ); + null != owner && initializeFakeStack(response, owner); + var rootTask = response._debugRootTask; + if (rootTask) + if (response._rootEnvironmentName !== env) { + var createTaskFn = console.createTask.bind( + console, + '"use ' + env.toLowerCase() + '"' + ); + var rootTask$jscomp$0 = rootTask.run(createTaskFn); + } else rootTask$jscomp$0 = rootTask; + else rootTask$jscomp$0 = null; + null != rootTask$jscomp$0 + ? rootTask$jscomp$0.run(callStack) + : callStack(); + } finally { + ReactSharedInternals.getCurrentStack = prevStack; + } + } + }; + replayConsoleWithCallStack["react-stack-bottom-frame"].bind( + replayConsoleWithCallStack + ); exports.createFromNodeStream = function (stream, ssrManifest, options) { var response = new ResponseInstance( ssrManifest.moduleMap, diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js index f44fff096b426..3c10208e7c61f 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js @@ -915,10 +915,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -928,8 +926,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js index 4f9fc1562a777..4f6e91f12fc75 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js @@ -324,6 +324,9 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + return currentOwner ? currentOwner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -521,6 +524,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = currentRequest ? currentRequest : null; + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -622,14 +674,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -656,7 +708,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -807,10 +859,9 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - model = stringToChunk(code + model + "\n"); - request.completedHintChunks.push(model); + code = serializeRowHeader("H" + code, id) + model + "\n"; + code = stringToChunk(code); + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -882,7 +933,7 @@ } prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); props = callComponentInDEV(Component, props, componentDebugInfo); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1015,7 +1066,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1055,7 +1106,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1085,7 +1136,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1110,7 +1161,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1164,6 +1215,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); id = id.toString(16) + ":" + request + "\n"; @@ -1209,7 +1263,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - row = importId.toString(16) + ":I" + json + "\n", + row = serializeRowHeader("I", importId) + json + "\n", processedChunk = stringToChunk(row); request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); @@ -1362,9 +1416,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1458,7 +1512,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1732,33 +1786,14 @@ null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1766,19 +1801,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; id = stringToChunk(id); request.completedErrorChunks.push(id); } @@ -1802,7 +1832,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; id = stringToChunk(id); request.completedRegularChunks.push(id); } @@ -1994,6 +2024,35 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + id = stringToChunk(id); + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2035,9 +2094,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2069,11 +2128,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2086,13 +2145,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2201,7 +2260,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -2222,7 +2281,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2243,8 +2302,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3361,13 +3420,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - return currentOwner ? currentOwner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3408,10 +3465,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, @@ -3563,7 +3643,7 @@ startWork(request); }, pull: function (controller) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), closeWithError(controller, request.fatalError); else if ( diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js index b902bf461ac3c..68f4c93c24597 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js @@ -320,6 +320,14 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + if (supportsComponentStorage) { + var owner = componentStorage.getStore(); + if (owner) return owner; + } + return null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -517,6 +525,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -626,14 +683,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -660,7 +717,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -811,10 +868,9 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - model = stringToChunk(code + model + "\n"); - request.completedHintChunks.push(model); + code = serializeRowHeader("H" + code, id) + model + "\n"; + code = stringToChunk(code); + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -894,7 +950,7 @@ componentDebugInfo ) : callComponentInDEV(Component, props, componentDebugInfo); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1027,7 +1083,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1067,7 +1123,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1097,7 +1153,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1122,7 +1178,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1176,6 +1232,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); id = id.toString(16) + ":" + request + "\n"; @@ -1221,7 +1280,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - row = importId.toString(16) + ":I" + json + "\n", + row = serializeRowHeader("I", importId) + json + "\n", processedChunk = stringToChunk(row); request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); @@ -1374,9 +1433,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1470,7 +1529,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1755,33 +1814,14 @@ null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1789,19 +1829,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; id = stringToChunk(id); request.completedErrorChunks.push(id); } @@ -1825,7 +1860,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; id = stringToChunk(id); request.completedRegularChunks.push(id); } @@ -2017,6 +2052,35 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + id = stringToChunk(id); + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2058,9 +2122,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2092,11 +2156,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2109,13 +2173,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2224,7 +2288,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? supportsRequestStorage ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); @@ -2253,7 +2317,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2274,8 +2338,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3396,18 +3460,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - if (supportsComponentStorage) { - var owner = componentStorage.getStore(); - if (owner) return owner; - } - return null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3448,10 +3505,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, @@ -3614,7 +3694,7 @@ const setTimeoutOrImmediate = startWork(request); }, pull: function (controller) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), closeWithError(controller, request.fatalError); else if ( diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js index 2bbb0ad1f8c23..9afa158423241 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js @@ -347,6 +347,11 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + var owner = componentStorage.getStore(); + return owner ? owner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -544,6 +549,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -650,14 +704,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -684,7 +738,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -835,9 +889,8 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - request.completedHintChunks.push(code + model + "\n"); + code = serializeRowHeader("H" + code, id) + model + "\n"; + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -915,7 +968,7 @@ props, componentDebugInfo ); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1048,7 +1101,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1088,7 +1141,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1118,7 +1171,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1143,7 +1196,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1197,6 +1250,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); return id.toString(16) + ":" + request + "\n"; @@ -1241,7 +1297,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - processedChunk = importId.toString(16) + ":I" + json + "\n"; + processedChunk = serializeRowHeader("I", importId) + json + "\n"; request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName @@ -1393,9 +1449,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1489,7 +1545,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1769,33 +1825,14 @@ onFatalError(error); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1803,19 +1840,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; request.completedErrorChunks.push(id); } function emitSymbolChunk(request, id, name) { @@ -1837,7 +1869,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; request.completedRegularChunks.push(id); } function emitTypedArrayChunk(request, id, tag, typedArray) { @@ -2023,6 +2055,34 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2064,9 +2124,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2098,11 +2158,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2115,13 +2175,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2231,7 +2291,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); }) @@ -2251,7 +2311,7 @@ })); } function startFlowing(request, destination) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -2264,7 +2324,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2285,8 +2345,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3412,15 +3472,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - var owner = componentStorage.getStore(); - return owner ? owner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3461,10 +3517,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, diff --git a/packages/next/src/compiled/react-server-dom-turbopack/package.json b/packages/next/src/compiled/react-server-dom-turbopack/package.json index d95937760dc98..39134a80acb36 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack/package.json @@ -48,7 +48,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js index 023539e9df1a6..013fa4055ba21 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js @@ -1179,11 +1179,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1193,8 +1190,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1943,39 +1942,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -1983,122 +1982,72 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - var errorInfo = JSON.parse(buffer); - model = errorInfo.digest; - as = errorInfo.env; - errorInfo = buildFakeCallStack( + chunk = JSON.parse(buffer); + buffer = chunk.digest; + tag = chunk.env; + chunk = buildFakeCallStack( response, - errorInfo.stack, - as, + chunk.stack, + tag, Error.bind( null, - errorInfo.message || + chunk.message || "An error occurred in the Server Components render but no message was provided" ) ); - var rootTask = getRootTask(response, as); - errorInfo = null != rootTask ? rootTask.run(errorInfo) : errorInfo(); - errorInfo.digest = model; - errorInfo.environmentName = as; - model = response._chunks; - (as = model.get(id)) - ? triggerErrorOnChunk(as, errorInfo) - : model.set( + stringDecoder = getRootTask(response, tag); + chunk = null != stringDecoder ? stringDecoder.run(chunk) : chunk(); + chunk.digest = buffer; + chunk.environmentName = tag; + buffer = response._chunks; + (tag = buffer.get(id)) + ? triggerErrorOnChunk(tag, chunk) + : buffer.set( id, - new ReactPromise("rejected", null, errorInfo, response) + new ReactPromise("rejected", null, chunk, response) ); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); + buffer = JSON.parse(buffer, response._fromJSON); initializeFakeTask( response, - model, - void 0 === model.env ? response._rootEnvironmentName : model.env + buffer, + void 0 === buffer.env ? response._rootEnvironmentName : buffer.env ); - initializeFakeStack(response, model); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - a: if (response._replayConsole) { - stringDecoder = JSON.parse(buffer, response._fromJSON); - id = stringDecoder[0]; - buffer = stringDecoder[1]; - tag = stringDecoder[2]; - chunk = stringDecoder[3]; - stringDecoder = stringDecoder.slice(4); - row = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - currentOwnerInDEV = tag; - try { - b: { - i = 0; - switch (id) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind.apply( - console[id], - [console].concat(stringDecoder) - ); - break b; - case "assert": - i = 1; - } - as = stringDecoder.slice(0); - "string" === typeof as[i] - ? as.splice( - i, - 1, - "%c%s%c " + as[i], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ) - : as.splice( - i, - 0, - "%c%s%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ); - as.unshift(console); - model = bind.apply(console[id], as); - } - errorInfo = buildFakeCallStack(response, buffer, chunk, model); - if ( - null != tag && - ((rootTask = initializeFakeTask(response, tag, chunk)), - initializeFakeStack(response, tag), - null !== rootTask) - ) { - rootTask.run(errorInfo); - break a; - } - var rootTask$jscomp$0 = getRootTask(response, chunk); - null != rootTask$jscomp$0 - ? rootTask$jscomp$0.run(errorInfo) - : errorInfo(); - } finally { - ReactSharedInternals.getCurrentStack = row; - } - } + response._replayConsole && + ((stringDecoder = JSON.parse(buffer, response._fromJSON)), + (id = stringDecoder[0]), + (buffer = stringDecoder[1]), + (tag = stringDecoder[2]), + (chunk = stringDecoder[3]), + (stringDecoder = stringDecoder.slice(4)), + replayConsoleWithCallStackInDEV( + response, + id, + buffer, + tag, + chunk, + stringDecoder + )); break; case 82: startReadableStream(response, id, void 0); @@ -2118,26 +2067,26 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; case 80: - model = JSON.parse(buffer); - model = buildFakeCallStack( + buffer = JSON.parse(buffer); + buffer = buildFakeCallStack( response, - model.stack, - model.env, - Error.bind(null, model.reason || "") + buffer.stack, + buffer.env, + Error.bind(null, buffer.reason || "") ); - as = response._debugRootTask; - model = null != as ? as.run(model) : model(); - model.$$typeof = REACT_POSTPONE_TYPE; - as = response._chunks; - (errorInfo = as.get(id)) - ? triggerErrorOnChunk(errorInfo, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + tag = response._debugRootTask; + buffer = null != tag ? tag.run(buffer) : buffer(); + buffer.$$typeof = REACT_POSTPONE_TYPE; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2357,8 +2306,8 @@ var reader = stream.getReader(); reader.read().then(progress).catch(error); } - var ReactDOM = require("react-dom"), - React = require("react"), + var React = require("react"), + ReactDOM = require("react-dom"), decoderOptions = { stream: !0 }, bind = Function.prototype.bind, chunkCache = new Map(), @@ -2453,7 +2402,104 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), - currentOwnerInDEV = null; + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + a: { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + var JSCompiler_inline_result = bind.apply( + console[methodName], + [console].concat(args) + ); + break a; + case "assert": + offset = 1; + } + var newArgs = args.slice(0); + "string" === typeof newArgs[offset] + ? newArgs.splice( + offset, + 1, + "%c%s%c " + newArgs[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ) + : newArgs.splice( + offset, + 0, + "%c%s%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ); + newArgs.unshift(console); + JSCompiler_inline_result = bind.apply( + console[methodName], + newArgs + ); + } + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + JSCompiler_inline_result + ); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } + var rootTask = getRootTask(response, env); + null != rootTask ? rootTask.run(callStack) : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }, + replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[ + "react-stack-bottom-frame" + ].bind(replayConsoleWithCallStack); + (function (internals) { + if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled || !hook.supportsFlight) return !0; + try { + hook.inject(internals); + } catch (err) { + console.error("React instrumentation encountered an error: %s.", err); + } + return hook.checkDCE ? !0 : !1; + })({ + bundleType: 1, + version: "19.0.0-experimental-94e652d5-20240912", + rendererPackageName: "react-server-dom-webpack", + currentDispatcherRef: ReactSharedInternals, + reconcilerVersion: "19.0.0-experimental-94e652d5-20240912", + getCurrentComponentInfo: function () { + return currentOwnerInDEV; + } + }); exports.createFromFetch = function (promiseForResponse, options) { var response = createResponseFromOptions(options); promiseForResponse.then( diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.js index 49795db1d1f26..5caae01c843af 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.js @@ -758,10 +758,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -771,8 +769,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js index d6521fb32cfa6..f92a6c898775e 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js @@ -1383,11 +1383,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1397,8 +1394,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -2152,39 +2151,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -2192,122 +2191,72 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - var errorInfo = JSON.parse(buffer); - model = errorInfo.digest; - as = errorInfo.env; - errorInfo = buildFakeCallStack( + chunk = JSON.parse(buffer); + buffer = chunk.digest; + tag = chunk.env; + chunk = buildFakeCallStack( response, - errorInfo.stack, - as, + chunk.stack, + tag, Error.bind( null, - errorInfo.message || + chunk.message || "An error occurred in the Server Components render but no message was provided" ) ); - var rootTask = getRootTask(response, as); - errorInfo = null != rootTask ? rootTask.run(errorInfo) : errorInfo(); - errorInfo.digest = model; - errorInfo.environmentName = as; - model = response._chunks; - (as = model.get(id)) - ? triggerErrorOnChunk(as, errorInfo) - : model.set( + stringDecoder = getRootTask(response, tag); + chunk = null != stringDecoder ? stringDecoder.run(chunk) : chunk(); + chunk.digest = buffer; + chunk.environmentName = tag; + buffer = response._chunks; + (tag = buffer.get(id)) + ? triggerErrorOnChunk(tag, chunk) + : buffer.set( id, - new ReactPromise("rejected", null, errorInfo, response) + new ReactPromise("rejected", null, chunk, response) ); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); + buffer = JSON.parse(buffer, response._fromJSON); initializeFakeTask( response, - model, - void 0 === model.env ? response._rootEnvironmentName : model.env + buffer, + void 0 === buffer.env ? response._rootEnvironmentName : buffer.env ); - initializeFakeStack(response, model); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - a: if (response._replayConsole) { - stringDecoder = JSON.parse(buffer, response._fromJSON); - id = stringDecoder[0]; - buffer = stringDecoder[1]; - tag = stringDecoder[2]; - chunk = stringDecoder[3]; - stringDecoder = stringDecoder.slice(4); - row = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - currentOwnerInDEV = tag; - try { - b: { - i = 0; - switch (id) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind$1.apply( - console[id], - [console].concat(stringDecoder) - ); - break b; - case "assert": - i = 1; - } - as = stringDecoder.slice(0); - "string" === typeof as[i] - ? as.splice( - i, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + as[i], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ) - : as.splice( - i, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + chunk + " ", - "" - ); - as.unshift(console); - model = bind$1.apply(console[id], as); - } - errorInfo = buildFakeCallStack(response, buffer, chunk, model); - if ( - null != tag && - ((rootTask = initializeFakeTask(response, tag, chunk)), - initializeFakeStack(response, tag), - null !== rootTask) - ) { - rootTask.run(errorInfo); - break a; - } - var rootTask$jscomp$0 = getRootTask(response, chunk); - null != rootTask$jscomp$0 - ? rootTask$jscomp$0.run(errorInfo) - : errorInfo(); - } finally { - ReactSharedInternals.getCurrentStack = row; - } - } + response._replayConsole && + ((stringDecoder = JSON.parse(buffer, response._fromJSON)), + (id = stringDecoder[0]), + (buffer = stringDecoder[1]), + (tag = stringDecoder[2]), + (chunk = stringDecoder[3]), + (stringDecoder = stringDecoder.slice(4)), + replayConsoleWithCallStackInDEV( + response, + id, + buffer, + tag, + chunk, + stringDecoder + )); break; case 82: startReadableStream(response, id, void 0); @@ -2327,26 +2276,26 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; case 80: - model = JSON.parse(buffer); - model = buildFakeCallStack( + buffer = JSON.parse(buffer); + buffer = buildFakeCallStack( response, - model.stack, - model.env, - Error.bind(null, model.reason || "") + buffer.stack, + buffer.env, + Error.bind(null, buffer.reason || "") ); - as = response._debugRootTask; - model = null != as ? as.run(model) : model(); - model.$$typeof = REACT_POSTPONE_TYPE; - as = response._chunks; - (errorInfo = as.get(id)) - ? triggerErrorOnChunk(errorInfo, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + tag = response._debugRootTask; + buffer = null != tag ? tag.run(buffer) : buffer(); + buffer.$$typeof = REACT_POSTPONE_TYPE; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2662,7 +2611,84 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), - currentOwnerInDEV = null; + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + a: { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + var JSCompiler_inline_result = bind$1.apply( + console[methodName], + [console].concat(args) + ); + break a; + case "assert": + offset = 1; + } + var newArgs = args.slice(0); + "string" === typeof newArgs[offset] + ? newArgs.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + newArgs[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ) + : newArgs.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ); + newArgs.unshift(console); + JSCompiler_inline_result = bind$1.apply( + console[methodName], + newArgs + ); + } + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + JSCompiler_inline_result + ); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } + var rootTask = getRootTask(response, env); + null != rootTask ? rootTask.run(callStack) : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }, + replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[ + "react-stack-bottom-frame" + ].bind(replayConsoleWithCallStack); exports.createFromFetch = function (promiseForResponse, options) { var response = createResponseFromOptions(options); promiseForResponse.then( diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.js index 923501467f616..7d1248377cb4f 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.js @@ -916,10 +916,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -929,8 +927,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js index 61c78ce4a4546..7f8f4c09a31ff 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js @@ -1383,11 +1383,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1397,8 +1394,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -2155,39 +2154,39 @@ break; case 72: id = row[0]; - var model = row.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + row = row.slice(1); + response = JSON.parse(row, response._fromJSON); + row = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + row.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? row.C(response) + : row.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? row.L(id, tag, response[2]) + : row.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? row.m(response) + : row.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? row.X(response) + : row.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? row.S(response) + : row.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -2195,119 +2194,69 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? row.M(response) + : row.M(response[0], response[1]); } break; case 69: var errorInfo = JSON.parse(row); - model = errorInfo.digest; - as = errorInfo.env; + row = errorInfo.digest; + tag = errorInfo.env; errorInfo = buildFakeCallStack( response, errorInfo.stack, - as, + tag, Error.bind( null, errorInfo.message || "An error occurred in the Server Components render but no message was provided" ) ); - var rootTask = getRootTask(response, as); + var rootTask = getRootTask(response, tag); errorInfo = null != rootTask ? rootTask.run(errorInfo) : errorInfo(); - errorInfo.digest = model; - errorInfo.environmentName = as; - model = response._chunks; - (as = model.get(id)) - ? triggerErrorOnChunk(as, errorInfo) - : model.set( + errorInfo.digest = row; + errorInfo.environmentName = tag; + row = response._chunks; + (tag = row.get(id)) + ? triggerErrorOnChunk(tag, errorInfo) + : row.set( id, new ReactPromise("rejected", null, errorInfo, response) ); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(row) - : model.set(id, new ReactPromise("fulfilled", row, null, response)); + tag = response._chunks; + (errorInfo = tag.get(id)) && "pending" !== errorInfo.status + ? errorInfo.reason.enqueueValue(row) + : tag.set(id, new ReactPromise("fulfilled", row, null, response)); break; case 68: - model = JSON.parse(row, response._fromJSON); + row = JSON.parse(row, response._fromJSON); initializeFakeTask( response, - model, - void 0 === model.env ? response._rootEnvironmentName : model.env + row, + void 0 === row.env ? response._rootEnvironmentName : row.env ); - initializeFakeStack(response, model); + initializeFakeStack(response, row); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(row); break; case 87: - a: if (response._replayConsole) { - var payload = JSON.parse(row, response._fromJSON); - id = payload[0]; - row = payload[1]; - tag = payload[2]; - var env = payload[3]; - payload = payload.slice(4); - var prevStack = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - currentOwnerInDEV = tag; - try { - b: { - var offset = 0; - switch (id) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind$1.apply( - console[id], - [console].concat(payload) - ); - break b; - case "assert": - offset = 1; - } - as = payload.slice(0); - "string" === typeof as[offset] - ? as.splice( - offset, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + as[offset], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + env + " ", - "" - ) - : as.splice( - offset, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + env + " ", - "" - ); - as.unshift(console); - model = bind$1.apply(console[id], as); - } - errorInfo = buildFakeCallStack(response, row, env, model); - if ( - null != tag && - ((rootTask = initializeFakeTask(response, tag, env)), - initializeFakeStack(response, tag), - null !== rootTask) - ) { - rootTask.run(errorInfo); - break a; - } - var rootTask$jscomp$0 = getRootTask(response, env); - null != rootTask$jscomp$0 - ? rootTask$jscomp$0.run(errorInfo) - : errorInfo(); - } finally { - ReactSharedInternals.getCurrentStack = prevStack; - } - } + response._replayConsole && + ((rootTask = JSON.parse(row, response._fromJSON)), + (id = rootTask[0]), + (row = rootTask[1]), + (tag = rootTask[2]), + (errorInfo = rootTask[3]), + (rootTask = rootTask.slice(4)), + replayConsoleWithCallStackInDEV( + response, + id, + row, + tag, + errorInfo, + rootTask + )); break; case 82: startReadableStream(response, id, void 0); @@ -2327,26 +2276,26 @@ response.reason.close("" === row ? '"$undefined"' : row); break; case 80: - model = JSON.parse(row); - model = buildFakeCallStack( + row = JSON.parse(row); + row = buildFakeCallStack( response, - model.stack, - model.env, - Error.bind(null, model.reason || "") + row.stack, + row.env, + Error.bind(null, row.reason || "") ); - as = response._debugRootTask; - model = null != as ? as.run(model) : model(); - model.$$typeof = REACT_POSTPONE_TYPE; - as = response._chunks; - (errorInfo = as.get(id)) - ? triggerErrorOnChunk(errorInfo, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + tag = response._debugRootTask; + row = null != tag ? tag.run(row) : row(); + row.$$typeof = REACT_POSTPONE_TYPE; + tag = response._chunks; + (errorInfo = tag.get(id)) + ? triggerErrorOnChunk(errorInfo, row) + : tag.set(id, new ReactPromise("rejected", null, row, response)); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, row) - : model.set( + (tag = response._chunks), + (errorInfo = tag.get(id)) + ? resolveModelChunk(errorInfo, row) + : tag.set( id, new ReactPromise("resolved_model", row, null, response) ); @@ -2551,7 +2500,84 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), - currentOwnerInDEV = null; + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + a: { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + var JSCompiler_inline_result = bind$1.apply( + console[methodName], + [console].concat(args) + ); + break a; + case "assert": + offset = 1; + } + var newArgs = args.slice(0); + "string" === typeof newArgs[offset] + ? newArgs.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + newArgs[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ) + : newArgs.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ); + newArgs.unshift(console); + JSCompiler_inline_result = bind$1.apply( + console[methodName], + newArgs + ); + } + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + JSCompiler_inline_result + ); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } + var rootTask = getRootTask(response, env); + null != rootTask ? rootTask.run(callStack) : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }, + replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[ + "react-stack-bottom-frame" + ].bind(replayConsoleWithCallStack); exports.createFromNodeStream = function (stream, ssrManifest, options) { var response = new ResponseInstance( ssrManifest.moduleMap, diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js index 44c4da428b37c..4e2c5f1552c6e 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js @@ -917,10 +917,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -930,8 +928,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js index 23ce7e1d0e11f..4e8f612f507a1 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js @@ -1358,11 +1358,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1372,8 +1369,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -2130,39 +2129,39 @@ break; case 72: id = row[0]; - var model = row.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + row = row.slice(1); + response = JSON.parse(row, response._fromJSON); + row = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + row.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? row.C(response) + : row.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? row.L(id, tag, response[2]) + : row.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? row.m(response) + : row.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? row.X(response) + : row.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? row.S(response) + : row.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -2170,119 +2169,69 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? row.M(response) + : row.M(response[0], response[1]); } break; case 69: var errorInfo = JSON.parse(row); - model = errorInfo.digest; - as = errorInfo.env; + row = errorInfo.digest; + tag = errorInfo.env; errorInfo = buildFakeCallStack( response, errorInfo.stack, - as, + tag, Error.bind( null, errorInfo.message || "An error occurred in the Server Components render but no message was provided" ) ); - var rootTask = getRootTask(response, as); + var rootTask = getRootTask(response, tag); errorInfo = null != rootTask ? rootTask.run(errorInfo) : errorInfo(); - errorInfo.digest = model; - errorInfo.environmentName = as; - model = response._chunks; - (as = model.get(id)) - ? triggerErrorOnChunk(as, errorInfo) - : model.set( + errorInfo.digest = row; + errorInfo.environmentName = tag; + row = response._chunks; + (tag = row.get(id)) + ? triggerErrorOnChunk(tag, errorInfo) + : row.set( id, new ReactPromise("rejected", null, errorInfo, response) ); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(row) - : model.set(id, new ReactPromise("fulfilled", row, null, response)); + tag = response._chunks; + (errorInfo = tag.get(id)) && "pending" !== errorInfo.status + ? errorInfo.reason.enqueueValue(row) + : tag.set(id, new ReactPromise("fulfilled", row, null, response)); break; case 68: - model = JSON.parse(row, response._fromJSON); + row = JSON.parse(row, response._fromJSON); initializeFakeTask( response, - model, - void 0 === model.env ? response._rootEnvironmentName : model.env + row, + void 0 === row.env ? response._rootEnvironmentName : row.env ); - initializeFakeStack(response, model); + initializeFakeStack(response, row); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(row); break; case 87: - a: if (response._replayConsole) { - var payload = JSON.parse(row, response._fromJSON); - id = payload[0]; - row = payload[1]; - tag = payload[2]; - var env = payload[3]; - payload = payload.slice(4); - var prevStack = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - currentOwnerInDEV = tag; - try { - b: { - var offset = 0; - switch (id) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind$1.apply( - console[id], - [console].concat(payload) - ); - break b; - case "assert": - offset = 1; - } - as = payload.slice(0); - "string" === typeof as[offset] - ? as.splice( - offset, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + as[offset], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + env + " ", - "" - ) - : as.splice( - offset, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + env + " ", - "" - ); - as.unshift(console); - model = bind$1.apply(console[id], as); - } - errorInfo = buildFakeCallStack(response, row, env, model); - if ( - null != tag && - ((rootTask = initializeFakeTask(response, tag, env)), - initializeFakeStack(response, tag), - null !== rootTask) - ) { - rootTask.run(errorInfo); - break a; - } - var rootTask$jscomp$0 = getRootTask(response, env); - null != rootTask$jscomp$0 - ? rootTask$jscomp$0.run(errorInfo) - : errorInfo(); - } finally { - ReactSharedInternals.getCurrentStack = prevStack; - } - } + response._replayConsole && + ((rootTask = JSON.parse(row, response._fromJSON)), + (id = rootTask[0]), + (row = rootTask[1]), + (tag = rootTask[2]), + (errorInfo = rootTask[3]), + (rootTask = rootTask.slice(4)), + replayConsoleWithCallStackInDEV( + response, + id, + row, + tag, + errorInfo, + rootTask + )); break; case 82: startReadableStream(response, id, void 0); @@ -2302,26 +2251,26 @@ response.reason.close("" === row ? '"$undefined"' : row); break; case 80: - model = JSON.parse(row); - model = buildFakeCallStack( + row = JSON.parse(row); + row = buildFakeCallStack( response, - model.stack, - model.env, - Error.bind(null, model.reason || "") + row.stack, + row.env, + Error.bind(null, row.reason || "") ); - as = response._debugRootTask; - model = null != as ? as.run(model) : model(); - model.$$typeof = REACT_POSTPONE_TYPE; - as = response._chunks; - (errorInfo = as.get(id)) - ? triggerErrorOnChunk(errorInfo, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + tag = response._debugRootTask; + row = null != tag ? tag.run(row) : row(); + row.$$typeof = REACT_POSTPONE_TYPE; + tag = response._chunks; + (errorInfo = tag.get(id)) + ? triggerErrorOnChunk(errorInfo, row) + : tag.set(id, new ReactPromise("rejected", null, row, response)); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, row) - : model.set( + (tag = response._chunks), + (errorInfo = tag.get(id)) + ? resolveModelChunk(errorInfo, row) + : tag.set( id, new ReactPromise("resolved_model", row, null, response) ); @@ -2526,7 +2475,84 @@ createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" ].bind(createFakeJSXCallStack), - currentOwnerInDEV = null; + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + a: { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + var JSCompiler_inline_result = bind$1.apply( + console[methodName], + [console].concat(args) + ); + break a; + case "assert": + offset = 1; + } + var newArgs = args.slice(0); + "string" === typeof newArgs[offset] + ? newArgs.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + newArgs[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ) + : newArgs.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + env + " ", + "" + ); + newArgs.unshift(console); + JSCompiler_inline_result = bind$1.apply( + console[methodName], + newArgs + ); + } + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + JSCompiler_inline_result + ); + if (null != owner) { + var task = initializeFakeTask(response, owner, env); + initializeFakeStack(response, owner); + if (null !== task) { + task.run(callStack); + return; + } + } + var rootTask = getRootTask(response, env); + null != rootTask ? rootTask.run(callStack) : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }, + replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[ + "react-stack-bottom-frame" + ].bind(replayConsoleWithCallStack); exports.createFromNodeStream = function (stream, ssrManifest, options) { var response = new ResponseInstance( ssrManifest.moduleMap, diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.js index eb161f232fcc4..9bd60529c3603 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.js @@ -896,10 +896,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -909,8 +907,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json index 352747126cc0b..a54418de2c2d6 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json @@ -64,8 +64,8 @@ "webpack-sources": "^3.2.0" }, "peerDependencies": { - "react": "0.0.0-experimental-7771d3a7-20240827", - "react-dom": "0.0.0-experimental-7771d3a7-20240827", + "react": "0.0.0-experimental-94e652d5-20240912", + "react-dom": "0.0.0-experimental-94e652d5-20240912", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js index ccfc6dfdde067..86bbb55e0b5bf 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js @@ -22,6 +22,38 @@ : (obj[key] = value); return obj; } + function bindToConsole(methodName, args, badgeName) { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + return bind.apply(console[methodName], [console].concat(args)); + case "assert": + offset = 1; + } + args = args.slice(0); + "string" === typeof args[offset] + ? args.splice( + offset, + 1, + "%c%s%c " + args[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ) + : args.splice( + offset, + 0, + "%c%s%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ); + args.unshift(console); + return bind.apply(console[methodName], args); + } function resolveClientReference(bundlerConfig, metadata) { if (bundlerConfig) { var moduleExports = bundlerConfig[metadata[0]]; @@ -1156,11 +1188,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1170,8 +1199,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1672,6 +1703,34 @@ } return fn; } + function buildFakeCallStack(response, stack, environmentName, innerCall) { + for (var i = 0; i < stack.length; i++) { + var frame = stack[i], + frameKey = frame.join("-") + "-" + environmentName, + fn = fakeFunctionCache.get(frameKey); + if (void 0 === fn) { + fn = frame[0]; + var filename = frame[1], + line = frame[2]; + frame = frame[3]; + var findSourceMapURL = response._debugFindSourceMapURL; + findSourceMapURL = findSourceMapURL + ? findSourceMapURL(filename, environmentName) + : null; + fn = createFakeFunction( + fn, + filename, + findSourceMapURL, + line, + frame, + environmentName + ); + fakeFunctionCache.set(frameKey, fn); + } + innerCall = fn.bind(null, innerCall); + } + return innerCall; + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -1783,39 +1842,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -1823,117 +1882,70 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - tag = JSON.parse(buffer); - as = tag.digest; - buffer = tag.env; - model = Error( - tag.message || + stringDecoder = JSON.parse(buffer); + tag = stringDecoder.digest; + chunk = stringDecoder.env; + buffer = Error( + stringDecoder.message || "An error occurred in the Server Components render but no message was provided" ); - tag = tag.stack; - chunk = model.name + ": " + model.message; - if (tag) - for ( - stringDecoder = 0; - stringDecoder < tag.length; - stringDecoder++ - ) { - var frame = tag[stringDecoder]; - row = frame[0]; - i = frame[1]; - var line = frame[2]; + stringDecoder = stringDecoder.stack; + row = buffer.name + ": " + buffer.message; + if (stringDecoder) + for (i = 0; i < stringDecoder.length; i++) { + var frame = stringDecoder[i], + name = frame[0], + filename = frame[1], + line = frame[2]; frame = frame[3]; - chunk = row - ? chunk + + row = name + ? row + ("\n at " + - row + + name + " (" + - i + + filename + ":" + line + ":" + frame + ")") - : chunk + ("\n at " + i + ":" + line + ":" + frame); + : row + ("\n at " + filename + ":" + line + ":" + frame); } - model.stack = chunk; - model.digest = as; - model.environmentName = buffer; - as = response._chunks; - (buffer = as.get(id)) - ? triggerErrorOnChunk(buffer, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + buffer.stack = row; + buffer.digest = tag; + buffer.environmentName = chunk; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); - initializeFakeStack(response, model); + buffer = JSON.parse(buffer, response._fromJSON); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - if (response._replayConsole) { - buffer = JSON.parse(buffer, response._fromJSON); - response = buffer[0]; - id = buffer[3]; - buffer = buffer.slice(4); - tag = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - try { - a: { - chunk = 0; - switch (response) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind.apply( - console[response], - [console].concat(buffer) - ); - break a; - case "assert": - chunk = 1; - } - as = buffer.slice(0); - "string" === typeof as[chunk] - ? as.splice( - chunk, - 1, - "%c%s%c " + as[chunk], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ) - : as.splice( - chunk, - 0, - "%c%s%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ); - as.unshift(console); - model = bind.apply(console[response], as); - } - model(); - } finally { - ReactSharedInternals.getCurrentStack = tag; - } - } + response._replayConsole && + ((buffer = JSON.parse(buffer, response._fromJSON)), + (response = buffer[0]), + (id = buffer[3]), + (buffer = buffer.slice(4)), + bindToConsole(response, buffer, id)()); break; case 82: startReadableStream(response, id, void 0); @@ -1953,10 +1965,10 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2136,8 +2148,8 @@ var reader = stream.getReader(); reader.read().then(progress).catch(error); } - var ReactDOM = require("react-dom"), - React = require("react"), + var React = require("react"), + ReactDOM = require("react-dom"), decoderOptions = { stream: !0 }, bind = Function.prototype.bind, chunkCache = new Map(), @@ -2217,37 +2229,80 @@ stack, environmentName ) { - for (var callStack = fakeJSXCallSite, i = 0; i < stack.length; i++) { - var frame = stack[i], - frameKey = frame.join("-") + "-" + environmentName, - fn = fakeFunctionCache.get(frameKey); - if (void 0 === fn) { - fn = frame[0]; - var filename = frame[1], - line = frame[2]; - frame = frame[3]; - var findSourceMapURL = response._debugFindSourceMapURL; - findSourceMapURL = findSourceMapURL - ? findSourceMapURL(filename, environmentName) - : null; - fn = createFakeFunction( - fn, - filename, - findSourceMapURL, - line, - frame, - environmentName - ); - fakeFunctionCache.set(frameKey, fn); - } - callStack = fn.bind(null, callStack); - } - return callStack(); + return buildFakeCallStack( + response, + stack, + environmentName, + fakeJSXCallSite + )(); } }, createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" - ].bind(createFakeJSXCallStack); + ].bind(createFakeJSXCallStack), + currentOwnerInDEV = null, + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + currentOwnerInDEV = owner; + try { + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + bindToConsole(methodName, args, env) + ); + null != owner && initializeFakeStack(response, owner); + var rootTask = response._debugRootTask; + if (rootTask) + if (response._rootEnvironmentName !== env) { + var createTaskFn = console.createTask.bind( + console, + '"use ' + env.toLowerCase() + '"' + ); + var rootTask$jscomp$0 = rootTask.run(createTaskFn); + } else rootTask$jscomp$0 = rootTask; + else rootTask$jscomp$0 = null; + null != rootTask$jscomp$0 + ? rootTask$jscomp$0.run(callStack) + : callStack(); + } finally { + (currentOwnerInDEV = null), + (ReactSharedInternals.getCurrentStack = prevStack); + } + } + }; + replayConsoleWithCallStack["react-stack-bottom-frame"].bind( + replayConsoleWithCallStack + ); + (function (internals) { + if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled || !hook.supportsFlight) return !0; + try { + hook.inject(internals); + } catch (err) { + console.error("React instrumentation encountered an error: %s.", err); + } + return hook.checkDCE ? !0 : !1; + })({ + bundleType: 1, + version: "19.0.0-rc-94e652d5-20240912", + rendererPackageName: "react-server-dom-webpack", + currentDispatcherRef: ReactSharedInternals, + reconcilerVersion: "19.0.0-rc-94e652d5-20240912", + getCurrentComponentInfo: function () { + return currentOwnerInDEV; + } + }); exports.createFromFetch = function (promiseForResponse, options) { var response = createResponseFromOptions(options); promiseForResponse.then( diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js index 8e73cb9aed39c..3aeb36f755057 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js @@ -757,10 +757,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -770,8 +768,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js index b3507dee7ba45..9d572a7c97dac 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js @@ -22,6 +22,38 @@ : (obj[key] = value); return obj; } + function bindToConsole(methodName, args, badgeName) { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + return bind$1.apply(console[methodName], [console].concat(args)); + case "assert": + offset = 1; + } + args = args.slice(0); + "string" === typeof args[offset] + ? args.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + args[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ) + : args.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ); + args.unshift(console); + return bind$1.apply(console[methodName], args); + } function resolveClientReference(bundlerConfig, metadata) { if (bundlerConfig) { var moduleExports = bundlerConfig[metadata[0]]; @@ -1360,11 +1392,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1374,8 +1403,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1881,6 +1912,34 @@ } return fn; } + function buildFakeCallStack(response, stack, environmentName, innerCall) { + for (var i = 0; i < stack.length; i++) { + var frame = stack[i], + frameKey = frame.join("-") + "-" + environmentName, + fn = fakeFunctionCache.get(frameKey); + if (void 0 === fn) { + fn = frame[0]; + var filename = frame[1], + line = frame[2]; + frame = frame[3]; + var findSourceMapURL = response._debugFindSourceMapURL; + findSourceMapURL = findSourceMapURL + ? findSourceMapURL(filename, environmentName) + : null; + fn = createFakeFunction( + fn, + filename, + findSourceMapURL, + line, + frame, + environmentName + ); + fakeFunctionCache.set(frameKey, fn); + } + innerCall = fn.bind(null, innerCall); + } + return innerCall; + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -1992,39 +2051,39 @@ break; case 72: id = buffer[0]; - var model = buffer.slice(1); - response = JSON.parse(model, response._fromJSON); - model = ReactDOMSharedInternals.d; + buffer = buffer.slice(1); + response = JSON.parse(buffer, response._fromJSON); + buffer = ReactDOMSharedInternals.d; switch (id) { case "D": - model.D(response); + buffer.D(response); break; case "C": "string" === typeof response - ? model.C(response) - : model.C(response[0], response[1]); + ? buffer.C(response) + : buffer.C(response[0], response[1]); break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? model.L(id, as, response[2]) - : model.L(id, as); + ? buffer.L(id, tag, response[2]) + : buffer.L(id, tag); break; case "m": "string" === typeof response - ? model.m(response) - : model.m(response[0], response[1]); + ? buffer.m(response) + : buffer.m(response[0], response[1]); break; case "X": "string" === typeof response - ? model.X(response) - : model.X(response[0], response[1]); + ? buffer.X(response) + : buffer.X(response[0], response[1]); break; case "S": "string" === typeof response - ? model.S(response) - : model.S( + ? buffer.S(response) + : buffer.S( response[0], 0 === response[1] ? void 0 : response[1], 3 === response.length ? response[2] : void 0 @@ -2032,117 +2091,70 @@ break; case "M": "string" === typeof response - ? model.M(response) - : model.M(response[0], response[1]); + ? buffer.M(response) + : buffer.M(response[0], response[1]); } break; case 69: - tag = JSON.parse(buffer); - as = tag.digest; - buffer = tag.env; - model = Error( - tag.message || + stringDecoder = JSON.parse(buffer); + tag = stringDecoder.digest; + chunk = stringDecoder.env; + buffer = Error( + stringDecoder.message || "An error occurred in the Server Components render but no message was provided" ); - tag = tag.stack; - chunk = model.name + ": " + model.message; - if (tag) - for ( - stringDecoder = 0; - stringDecoder < tag.length; - stringDecoder++ - ) { - var frame = tag[stringDecoder]; - row = frame[0]; - i = frame[1]; - var line = frame[2]; + stringDecoder = stringDecoder.stack; + row = buffer.name + ": " + buffer.message; + if (stringDecoder) + for (i = 0; i < stringDecoder.length; i++) { + var frame = stringDecoder[i], + name = frame[0], + filename = frame[1], + line = frame[2]; frame = frame[3]; - chunk = row - ? chunk + + row = name + ? row + ("\n at " + - row + + name + " (" + - i + + filename + ":" + line + ":" + frame + ")") - : chunk + ("\n at " + i + ":" + line + ":" + frame); + : row + ("\n at " + filename + ":" + line + ":" + frame); } - model.stack = chunk; - model.digest = as; - model.environmentName = buffer; - as = response._chunks; - (buffer = as.get(id)) - ? triggerErrorOnChunk(buffer, model) - : as.set(id, new ReactPromise("rejected", null, model, response)); + buffer.stack = row; + buffer.digest = tag; + buffer.environmentName = chunk; + tag = response._chunks; + (chunk = tag.get(id)) + ? triggerErrorOnChunk(chunk, buffer) + : tag.set(id, new ReactPromise("rejected", null, buffer, response)); break; case 84: - model = response._chunks; - (as = model.get(id)) && "pending" !== as.status - ? as.reason.enqueueValue(buffer) - : model.set( + tag = response._chunks; + (chunk = tag.get(id)) && "pending" !== chunk.status + ? chunk.reason.enqueueValue(buffer) + : tag.set( id, new ReactPromise("fulfilled", buffer, null, response) ); break; case 68: - model = JSON.parse(buffer, response._fromJSON); - initializeFakeStack(response, model); + buffer = JSON.parse(buffer, response._fromJSON); + initializeFakeStack(response, buffer); response = getChunk(response, id); - (response._debugInfo || (response._debugInfo = [])).push(model); + (response._debugInfo || (response._debugInfo = [])).push(buffer); break; case 87: - if (response._replayConsole) { - buffer = JSON.parse(buffer, response._fromJSON); - response = buffer[0]; - id = buffer[3]; - buffer = buffer.slice(4); - tag = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - try { - a: { - chunk = 0; - switch (response) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - model = bind$1.apply( - console[response], - [console].concat(buffer) - ); - break a; - case "assert": - chunk = 1; - } - as = buffer.slice(0); - "string" === typeof as[chunk] - ? as.splice( - chunk, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + as[chunk], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ) - : as.splice( - chunk, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ); - as.unshift(console); - model = bind$1.apply(console[response], as); - } - model(); - } finally { - ReactSharedInternals.getCurrentStack = tag; - } - } + response._replayConsole && + ((buffer = JSON.parse(buffer, response._fromJSON)), + (response = buffer[0]), + (id = buffer[3]), + (buffer = buffer.slice(4)), + bindToConsole(response, buffer, id)()); break; case 82: startReadableStream(response, id, void 0); @@ -2162,10 +2174,10 @@ response.reason.close("" === buffer ? '"$undefined"' : buffer); break; default: - (model = response._chunks), - (as = model.get(id)) - ? resolveModelChunk(as, buffer) - : model.set( + (tag = response._chunks), + (chunk = tag.get(id)) + ? resolveModelChunk(chunk, buffer) + : tag.set( id, new ReactPromise("resolved_model", buffer, null, response) ); @@ -2426,37 +2438,57 @@ stack, environmentName ) { - for (var callStack = fakeJSXCallSite, i = 0; i < stack.length; i++) { - var frame = stack[i], - frameKey = frame.join("-") + "-" + environmentName, - fn = fakeFunctionCache.get(frameKey); - if (void 0 === fn) { - fn = frame[0]; - var filename = frame[1], - line = frame[2]; - frame = frame[3]; - var findSourceMapURL = response._debugFindSourceMapURL; - findSourceMapURL = findSourceMapURL - ? findSourceMapURL(filename, environmentName) - : null; - fn = createFakeFunction( - fn, - filename, - findSourceMapURL, - line, - frame, - environmentName - ); - fakeFunctionCache.set(frameKey, fn); - } - callStack = fn.bind(null, callStack); - } - return callStack(); + return buildFakeCallStack( + response, + stack, + environmentName, + fakeJSXCallSite + )(); } }, createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" - ].bind(createFakeJSXCallStack); + ].bind(createFakeJSXCallStack), + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + try { + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + bindToConsole(methodName, args, env) + ); + null != owner && initializeFakeStack(response, owner); + var rootTask = response._debugRootTask; + if (rootTask) + if (response._rootEnvironmentName !== env) { + var createTaskFn = console.createTask.bind( + console, + '"use ' + env.toLowerCase() + '"' + ); + var rootTask$jscomp$0 = rootTask.run(createTaskFn); + } else rootTask$jscomp$0 = rootTask; + else rootTask$jscomp$0 = null; + null != rootTask$jscomp$0 + ? rootTask$jscomp$0.run(callStack) + : callStack(); + } finally { + ReactSharedInternals.getCurrentStack = prevStack; + } + } + }; + replayConsoleWithCallStack["react-stack-bottom-frame"].bind( + replayConsoleWithCallStack + ); exports.createFromFetch = function (promiseForResponse, options) { var response = createResponseFromOptions(options); promiseForResponse.then( diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js index 85eccbcc86b53..d932b5ec40950 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js @@ -915,10 +915,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -928,8 +926,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js index a1d4eadf7e03a..a243f0c31af77 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js @@ -22,6 +22,38 @@ : (obj[key] = value); return obj; } + function bindToConsole(methodName, args, badgeName) { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + return bind$1.apply(console[methodName], [console].concat(args)); + case "assert": + offset = 1; + } + args = args.slice(0); + "string" === typeof args[offset] + ? args.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + args[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ) + : args.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ); + args.unshift(console); + return bind$1.apply(console[methodName], args); + } function resolveClientReference(bundlerConfig, metadata) { if (bundlerConfig) { var moduleExports = bundlerConfig[metadata[0]]; @@ -1360,11 +1392,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1374,8 +1403,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1881,6 +1912,34 @@ } return fn; } + function buildFakeCallStack(response, stack, environmentName, innerCall) { + for (var i = 0; i < stack.length; i++) { + var frame = stack[i], + frameKey = frame.join("-") + "-" + environmentName, + fn = fakeFunctionCache.get(frameKey); + if (void 0 === fn) { + fn = frame[0]; + var filename = frame[1], + line = frame[2]; + frame = frame[3]; + var findSourceMapURL = response._debugFindSourceMapURL; + findSourceMapURL = findSourceMapURL + ? findSourceMapURL(filename, environmentName) + : null; + fn = createFakeFunction( + fn, + filename, + findSourceMapURL, + line, + frame, + environmentName + ); + fakeFunctionCache.set(frameKey, fn); + } + innerCall = fn.bind(null, innerCall); + } + return innerCall; + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -2009,10 +2068,10 @@ break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? row.L(id, as, response[2]) - : row.L(id, as); + ? row.L(id, tag, response[2]) + : row.L(id, tag); break; case "m": "string" === typeof response @@ -2040,18 +2099,18 @@ } break; case 69: - tag = JSON.parse(row); - as = tag.digest; - var env = tag.env; + var errorInfo = JSON.parse(row); + tag = errorInfo.digest; + var env = errorInfo.env; row = Error( - tag.message || + errorInfo.message || "An error occurred in the Server Components render but no message was provided" ); - tag = tag.stack; + errorInfo = errorInfo.stack; var v8StyleStack = row.name + ": " + row.message; - if (tag) - for (var i = 0; i < tag.length; i++) { - var frame = tag[i], + if (errorInfo) + for (var i = 0; i < errorInfo.length; i++) { + var frame = errorInfo[i], name = frame[0], filename = frame[1], line = frame[2]; @@ -2071,18 +2130,18 @@ ("\n at " + filename + ":" + line + ":" + frame); } row.stack = v8StyleStack; - row.digest = as; + row.digest = tag; row.environmentName = env; - as = response._chunks; - (env = as.get(id)) + tag = response._chunks; + (env = tag.get(id)) ? triggerErrorOnChunk(env, row) - : as.set(id, new ReactPromise("rejected", null, row, response)); + : tag.set(id, new ReactPromise("rejected", null, row, response)); break; case 84: - as = response._chunks; - (env = as.get(id)) && "pending" !== env.status + tag = response._chunks; + (env = tag.get(id)) && "pending" !== env.status ? env.reason.enqueueValue(row) - : as.set(id, new ReactPromise("fulfilled", row, null, response)); + : tag.set(id, new ReactPromise("fulfilled", row, null, response)); break; case 68: row = JSON.parse(row, response._fromJSON); @@ -2091,52 +2150,12 @@ (response._debugInfo || (response._debugInfo = [])).push(row); break; case 87: - if (response._replayConsole) { - row = JSON.parse(row, response._fromJSON); - response = row[0]; - id = row[3]; - row = row.slice(4); - tag = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - try { - b: { - v8StyleStack = 0; - switch (response) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - as = bind$1.apply(console[response], [console].concat(row)); - break b; - case "assert": - v8StyleStack = 1; - } - env = row.slice(0); - "string" === typeof env[v8StyleStack] - ? env.splice( - v8StyleStack, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + env[v8StyleStack], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ) - : env.splice( - v8StyleStack, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ); - env.unshift(console); - as = bind$1.apply(console[response], env); - } - as(); - } finally { - ReactSharedInternals.getCurrentStack = tag; - } - } + response._replayConsole && + ((row = JSON.parse(row, response._fromJSON)), + (response = row[0]), + (id = row[3]), + (row = row.slice(4)), + bindToConsole(response, row, id)()); break; case 82: startReadableStream(response, id, void 0); @@ -2156,10 +2175,10 @@ response.reason.close("" === row ? '"$undefined"' : row); break; default: - (as = response._chunks), - (env = as.get(id)) + (tag = response._chunks), + (env = tag.get(id)) ? resolveModelChunk(env, row) - : as.set( + : tag.set( id, new ReactPromise("resolved_model", row, null, response) ); @@ -2309,37 +2328,57 @@ stack, environmentName ) { - for (var callStack = fakeJSXCallSite, i = 0; i < stack.length; i++) { - var frame = stack[i], - frameKey = frame.join("-") + "-" + environmentName, - fn = fakeFunctionCache.get(frameKey); - if (void 0 === fn) { - fn = frame[0]; - var filename = frame[1], - line = frame[2]; - frame = frame[3]; - var findSourceMapURL = response._debugFindSourceMapURL; - findSourceMapURL = findSourceMapURL - ? findSourceMapURL(filename, environmentName) - : null; - fn = createFakeFunction( - fn, - filename, - findSourceMapURL, - line, - frame, - environmentName - ); - fakeFunctionCache.set(frameKey, fn); - } - callStack = fn.bind(null, callStack); - } - return callStack(); + return buildFakeCallStack( + response, + stack, + environmentName, + fakeJSXCallSite + )(); } }, createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" - ].bind(createFakeJSXCallStack); + ].bind(createFakeJSXCallStack), + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + try { + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + bindToConsole(methodName, args, env) + ); + null != owner && initializeFakeStack(response, owner); + var rootTask = response._debugRootTask; + if (rootTask) + if (response._rootEnvironmentName !== env) { + var createTaskFn = console.createTask.bind( + console, + '"use ' + env.toLowerCase() + '"' + ); + var rootTask$jscomp$0 = rootTask.run(createTaskFn); + } else rootTask$jscomp$0 = rootTask; + else rootTask$jscomp$0 = null; + null != rootTask$jscomp$0 + ? rootTask$jscomp$0.run(callStack) + : callStack(); + } finally { + ReactSharedInternals.getCurrentStack = prevStack; + } + } + }; + replayConsoleWithCallStack["react-stack-bottom-frame"].bind( + replayConsoleWithCallStack + ); exports.createFromNodeStream = function (stream, ssrManifest, options) { var response = new ResponseInstance( ssrManifest.moduleMap, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js index ddc2b0efe26fc..dba982993db33 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js @@ -916,10 +916,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -929,8 +927,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js index 1bdda3644fffc..6a0b3c9e0278a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js @@ -22,6 +22,38 @@ : (obj[key] = value); return obj; } + function bindToConsole(methodName, args, badgeName) { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + return bind$1.apply(console[methodName], [console].concat(args)); + case "assert": + offset = 1; + } + args = args.slice(0); + "string" === typeof args[offset] + ? args.splice( + offset, + 1, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + args[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ) + : args.splice( + offset, + 0, + "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ); + args.unshift(console); + return bind$1.apply(console[methodName], args); + } function resolveClientReference(bundlerConfig, metadata) { var moduleExports = bundlerConfig[metadata[0]]; if ((bundlerConfig = moduleExports[metadata[2]])) @@ -1335,11 +1367,8 @@ } switch (id.status) { case "fulfilled": - for (var value = id.value, i = 1; i < reference.length; i++) - if ( - ((value = value[reference[i]]), - value.$$typeof === REACT_LAZY_TYPE) - ) + for (var value = id.value, i = 1; i < reference.length; i++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -1349,8 +1378,10 @@ key, response, map, - reference.slice(i) + reference.slice(i - 1) ); + value = value[reference[i]]; + } response = map(response, value); id._debugInfo && ("object" !== typeof response || @@ -1856,6 +1887,34 @@ } return fn; } + function buildFakeCallStack(response, stack, environmentName, innerCall) { + for (var i = 0; i < stack.length; i++) { + var frame = stack[i], + frameKey = frame.join("-") + "-" + environmentName, + fn = fakeFunctionCache.get(frameKey); + if (void 0 === fn) { + fn = frame[0]; + var filename = frame[1], + line = frame[2]; + frame = frame[3]; + var findSourceMapURL = response._debugFindSourceMapURL; + findSourceMapURL = findSourceMapURL + ? findSourceMapURL(filename, environmentName) + : null; + fn = createFakeFunction( + fn, + filename, + findSourceMapURL, + line, + frame, + environmentName + ); + fakeFunctionCache.set(frameKey, fn); + } + innerCall = fn.bind(null, innerCall); + } + return innerCall; + } function fakeJSXCallSite() { return Error("react-stack-top-frame"); } @@ -1984,10 +2043,10 @@ break; case "L": id = response[0]; - var as = response[1]; + tag = response[1]; 3 === response.length - ? row.L(id, as, response[2]) - : row.L(id, as); + ? row.L(id, tag, response[2]) + : row.L(id, tag); break; case "m": "string" === typeof response @@ -2015,18 +2074,18 @@ } break; case 69: - tag = JSON.parse(row); - as = tag.digest; - var env = tag.env; + var errorInfo = JSON.parse(row); + tag = errorInfo.digest; + var env = errorInfo.env; row = Error( - tag.message || + errorInfo.message || "An error occurred in the Server Components render but no message was provided" ); - tag = tag.stack; + errorInfo = errorInfo.stack; var v8StyleStack = row.name + ": " + row.message; - if (tag) - for (var i = 0; i < tag.length; i++) { - var frame = tag[i], + if (errorInfo) + for (var i = 0; i < errorInfo.length; i++) { + var frame = errorInfo[i], name = frame[0], filename = frame[1], line = frame[2]; @@ -2046,18 +2105,18 @@ ("\n at " + filename + ":" + line + ":" + frame); } row.stack = v8StyleStack; - row.digest = as; + row.digest = tag; row.environmentName = env; - as = response._chunks; - (env = as.get(id)) + tag = response._chunks; + (env = tag.get(id)) ? triggerErrorOnChunk(env, row) - : as.set(id, new ReactPromise("rejected", null, row, response)); + : tag.set(id, new ReactPromise("rejected", null, row, response)); break; case 84: - as = response._chunks; - (env = as.get(id)) && "pending" !== env.status + tag = response._chunks; + (env = tag.get(id)) && "pending" !== env.status ? env.reason.enqueueValue(row) - : as.set(id, new ReactPromise("fulfilled", row, null, response)); + : tag.set(id, new ReactPromise("fulfilled", row, null, response)); break; case 68: row = JSON.parse(row, response._fromJSON); @@ -2066,52 +2125,12 @@ (response._debugInfo || (response._debugInfo = [])).push(row); break; case 87: - if (response._replayConsole) { - row = JSON.parse(row, response._fromJSON); - response = row[0]; - id = row[3]; - row = row.slice(4); - tag = ReactSharedInternals.getCurrentStack; - ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; - try { - b: { - v8StyleStack = 0; - switch (response) { - case "dir": - case "dirxml": - case "groupEnd": - case "table": - as = bind$1.apply(console[response], [console].concat(row)); - break b; - case "assert": - v8StyleStack = 1; - } - env = row.slice(0); - "string" === typeof env[v8StyleStack] - ? env.splice( - v8StyleStack, - 1, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c " + env[v8StyleStack], - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ) - : env.splice( - v8StyleStack, - 0, - "\u001b[0m\u001b[7m%c%s\u001b[0m%c ", - "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", - " " + id + " ", - "" - ); - env.unshift(console); - as = bind$1.apply(console[response], env); - } - as(); - } finally { - ReactSharedInternals.getCurrentStack = tag; - } - } + response._replayConsole && + ((row = JSON.parse(row, response._fromJSON)), + (response = row[0]), + (id = row[3]), + (row = row.slice(4)), + bindToConsole(response, row, id)()); break; case 82: startReadableStream(response, id, void 0); @@ -2131,10 +2150,10 @@ response.reason.close("" === row ? '"$undefined"' : row); break; default: - (as = response._chunks), - (env = as.get(id)) + (tag = response._chunks), + (env = tag.get(id)) ? resolveModelChunk(env, row) - : as.set( + : tag.set( id, new ReactPromise("resolved_model", row, null, response) ); @@ -2284,37 +2303,57 @@ stack, environmentName ) { - for (var callStack = fakeJSXCallSite, i = 0; i < stack.length; i++) { - var frame = stack[i], - frameKey = frame.join("-") + "-" + environmentName, - fn = fakeFunctionCache.get(frameKey); - if (void 0 === fn) { - fn = frame[0]; - var filename = frame[1], - line = frame[2]; - frame = frame[3]; - var findSourceMapURL = response._debugFindSourceMapURL; - findSourceMapURL = findSourceMapURL - ? findSourceMapURL(filename, environmentName) - : null; - fn = createFakeFunction( - fn, - filename, - findSourceMapURL, - line, - frame, - environmentName - ); - fakeFunctionCache.set(frameKey, fn); - } - callStack = fn.bind(null, callStack); - } - return callStack(); + return buildFakeCallStack( + response, + stack, + environmentName, + fakeJSXCallSite + )(); } }, createFakeJSXCallStackInDEV = createFakeJSXCallStack[ "react-stack-bottom-frame" - ].bind(createFakeJSXCallStack); + ].bind(createFakeJSXCallStack), + replayConsoleWithCallStack = { + "react-stack-bottom-frame": function ( + response, + methodName, + stackTrace, + owner, + env, + args + ) { + var prevStack = ReactSharedInternals.getCurrentStack; + ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; + try { + var callStack = buildFakeCallStack( + response, + stackTrace, + env, + bindToConsole(methodName, args, env) + ); + null != owner && initializeFakeStack(response, owner); + var rootTask = response._debugRootTask; + if (rootTask) + if (response._rootEnvironmentName !== env) { + var createTaskFn = console.createTask.bind( + console, + '"use ' + env.toLowerCase() + '"' + ); + var rootTask$jscomp$0 = rootTask.run(createTaskFn); + } else rootTask$jscomp$0 = rootTask; + else rootTask$jscomp$0 = null; + null != rootTask$jscomp$0 + ? rootTask$jscomp$0.run(callStack) + : callStack(); + } finally { + ReactSharedInternals.getCurrentStack = prevStack; + } + } + }; + replayConsoleWithCallStack["react-stack-bottom-frame"].bind( + replayConsoleWithCallStack + ); exports.createFromNodeStream = function (stream, ssrManifest, options) { var response = new ResponseInstance( ssrManifest.moduleMap, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js index 1e35ed74f19fc..4a9d065c2846b 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js @@ -895,10 +895,8 @@ function getOutlinedModel(response, reference, parentObject, key, map) { switch (id.status) { case "fulfilled": var value = id.value; - for (id = 1; id < reference.length; id++) - if ( - ((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) - ) + for (id = 1; id < reference.length; id++) { + for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), "fulfilled" === value.status)) value = value.value; else @@ -908,8 +906,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) { key, response, map, - reference.slice(id) + reference.slice(id - 1) ); + value = value[reference[id]]; + } return map(response, value); case "pending": case "blocked": diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js index 0f6d80d7ebd73..25797e2f8a0a2 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js @@ -324,6 +324,9 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + return currentOwner ? currentOwner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -521,6 +524,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = currentRequest ? currentRequest : null; + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -622,14 +674,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -656,7 +708,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -807,10 +859,9 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - model = stringToChunk(code + model + "\n"); - request.completedHintChunks.push(model); + code = serializeRowHeader("H" + code, id) + model + "\n"; + code = stringToChunk(code); + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -882,7 +933,7 @@ } prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); props = callComponentInDEV(Component, props, componentDebugInfo); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1015,7 +1066,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1055,7 +1106,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1085,7 +1136,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1110,7 +1161,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1164,6 +1215,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); id = id.toString(16) + ":" + request + "\n"; @@ -1209,7 +1263,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - row = importId.toString(16) + ":I" + json + "\n", + row = serializeRowHeader("I", importId) + json + "\n", processedChunk = stringToChunk(row); request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); @@ -1362,9 +1416,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1458,7 +1512,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1732,33 +1786,14 @@ null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1766,19 +1801,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; id = stringToChunk(id); request.completedErrorChunks.push(id); } @@ -1802,7 +1832,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; id = stringToChunk(id); request.completedRegularChunks.push(id); } @@ -1994,6 +2024,35 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + id = stringToChunk(id); + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2035,9 +2094,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2069,11 +2128,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2086,13 +2145,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2201,7 +2260,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -2222,7 +2281,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2243,8 +2302,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3366,13 +3425,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - return currentOwner ? currentOwner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3413,10 +3470,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, @@ -3576,7 +3656,7 @@ startWork(request); }, pull: function (controller) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), closeWithError(controller, request.fatalError); else if ( diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js index c5eabf83b8a58..33e21c07b0e7a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js @@ -320,6 +320,14 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + if (supportsComponentStorage) { + var owner = componentStorage.getStore(); + if (owner) return owner; + } + return null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -517,6 +525,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -626,14 +683,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -660,7 +717,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -811,10 +868,9 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - model = stringToChunk(code + model + "\n"); - request.completedHintChunks.push(model); + code = serializeRowHeader("H" + code, id) + model + "\n"; + code = stringToChunk(code); + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -894,7 +950,7 @@ componentDebugInfo ) : callComponentInDEV(Component, props, componentDebugInfo); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1027,7 +1083,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1067,7 +1123,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1097,7 +1153,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1122,7 +1178,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1176,6 +1232,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); id = id.toString(16) + ":" + request + "\n"; @@ -1221,7 +1280,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - row = importId.toString(16) + ":I" + json + "\n", + row = serializeRowHeader("I", importId) + json + "\n", processedChunk = stringToChunk(row); request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); @@ -1374,9 +1433,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1470,7 +1529,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1755,33 +1814,14 @@ null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1789,19 +1829,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; id = stringToChunk(id); request.completedErrorChunks.push(id); } @@ -1825,7 +1860,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; id = stringToChunk(id); request.completedRegularChunks.push(id); } @@ -2017,6 +2052,35 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + id = stringToChunk(id); + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2058,9 +2122,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2092,11 +2156,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2109,13 +2173,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2224,7 +2288,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? supportsRequestStorage ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); @@ -2253,7 +2317,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2274,8 +2338,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3397,18 +3461,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - if (supportsComponentStorage) { - var owner = componentStorage.getStore(); - if (owner) return owner; - } - return null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3449,10 +3506,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, @@ -3615,7 +3695,7 @@ const setTimeoutOrImmediate = startWork(request); }, pull: function (controller) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), closeWithError(controller, request.fatalError); else if ( diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js index 87fb8b4e46712..4f59bff1c89d8 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js @@ -347,6 +347,11 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + var owner = componentStorage.getStore(); + return owner ? owner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -544,6 +549,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -650,14 +704,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -684,7 +738,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -835,9 +889,8 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - request.completedHintChunks.push(code + model + "\n"); + code = serializeRowHeader("H" + code, id) + model + "\n"; + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -915,7 +968,7 @@ props, componentDebugInfo ); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1048,7 +1101,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1088,7 +1141,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1118,7 +1171,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1143,7 +1196,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1197,6 +1250,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); return id.toString(16) + ":" + request + "\n"; @@ -1241,7 +1297,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - processedChunk = importId.toString(16) + ":I" + json + "\n"; + processedChunk = serializeRowHeader("I", importId) + json + "\n"; request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName @@ -1393,9 +1449,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1489,7 +1545,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1769,33 +1825,14 @@ onFatalError(error); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1803,19 +1840,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; request.completedErrorChunks.push(id); } function emitSymbolChunk(request, id, name) { @@ -1837,7 +1869,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; request.completedRegularChunks.push(id); } function emitTypedArrayChunk(request, id, tag, typedArray) { @@ -2023,6 +2055,34 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2064,9 +2124,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2098,11 +2158,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2115,13 +2175,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2231,7 +2291,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); }) @@ -2251,7 +2311,7 @@ })); } function startFlowing(request, destination) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -2264,7 +2324,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2285,8 +2345,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3413,15 +3473,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - var owner = componentStorage.getStore(); - return owner ? owner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3462,10 +3518,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js index 56fe8a4040e4e..ff55e31013a32 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js @@ -347,6 +347,11 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + var owner = componentStorage.getStore(); + return owner ? owner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -544,6 +549,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -650,14 +704,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -684,7 +738,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -835,9 +889,8 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - request.completedHintChunks.push(code + model + "\n"); + code = serializeRowHeader("H" + code, id) + model + "\n"; + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -915,7 +968,7 @@ props, componentDebugInfo ); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1048,7 +1101,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1088,7 +1141,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1118,7 +1171,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1143,7 +1196,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1197,6 +1250,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); return id.toString(16) + ":" + request + "\n"; @@ -1241,7 +1297,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - processedChunk = importId.toString(16) + ":I" + json + "\n"; + processedChunk = serializeRowHeader("I", importId) + json + "\n"; request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName @@ -1393,9 +1449,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1489,7 +1545,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1769,33 +1825,14 @@ onFatalError(error); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1803,19 +1840,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; request.completedErrorChunks.push(id); } function emitSymbolChunk(request, id, name) { @@ -1837,7 +1869,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; request.completedRegularChunks.push(id); } function emitTypedArrayChunk(request, id, tag, typedArray) { @@ -2023,6 +2055,34 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2064,9 +2124,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2098,11 +2158,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2115,13 +2175,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2231,7 +2291,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); }) @@ -2251,7 +2311,7 @@ })); } function startFlowing(request, destination) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -2264,7 +2324,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2285,8 +2345,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3378,15 +3438,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - var owner = componentStorage.getStore(); - return owner ? owner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3427,10 +3483,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, diff --git a/packages/next/src/compiled/react-server-dom-webpack/package.json b/packages/next/src/compiled/react-server-dom-webpack/package.json index 4d1d9dfc69f72..e344f6d806630 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack/package.json @@ -64,8 +64,8 @@ "webpack-sources": "^3.2.0" }, "peerDependencies": { - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827", + "react": "19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react/cjs/react.development.js b/packages/next/src/compiled/react/cjs/react.development.js index 7126d341e05ed..5fd997fd69566 100644 --- a/packages/next/src/compiled/react/cjs/react.development.js +++ b/packages/next/src/compiled/react/cjs/react.development.js @@ -1517,7 +1517,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react/cjs/react.production.js b/packages/next/src/compiled/react/cjs/react.production.js index 2a9081477239c..894251838087b 100644 --- a/packages/next/src/compiled/react/cjs/react.production.js +++ b/packages/next/src/compiled/react/cjs/react.production.js @@ -536,4 +536,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/react/cjs/react.react-server.development.js b/packages/next/src/compiled/react/cjs/react.react-server.development.js index 5129867cd65f2..683a1c5d0fc8c 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.development.js @@ -1113,5 +1113,5 @@ exports.useMemo = function (create, deps) { return resolveDispatcher().useMemo(create, deps); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-94e652d5-20240912"; })(); diff --git a/packages/next/src/compiled/react/cjs/react.react-server.production.js b/packages/next/src/compiled/react/cjs/react.react-server.production.js index 17974fedf0a07..d52b64d3d74be 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.production.js @@ -424,4 +424,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-94e652d5-20240912"; diff --git a/packages/next/src/compiled/unistore/unistore.js b/packages/next/src/compiled/unistore/unistore.js index ecfa6bcdddea5..74d41eef8e514 100644 --- a/packages/next/src/compiled/unistore/unistore.js +++ b/packages/next/src/compiled/unistore/unistore.js @@ -1 +1 @@ -(()=>{var t={583:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a{var t={110:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a=18'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@types/react': optional: true @@ -5923,8 +5923,8 @@ packages: babel-plugin-react-compiler@0.0.0-experimental-c23de8d-20240515: resolution: {integrity: sha512-0XN2gmpT55QtAz5n7d5g91y1AuO9tRhWBaLgCRyc4ExHrlr7+LfxW+YTb3mOwxngkkiggwM8HyYsaEK9MqhnlQ==} - babel-plugin-react-compiler@0.0.0-experimental-fe484b5-20240911: - resolution: {integrity: sha512-68t0K1tr9/q7rs2o2RAMvU+ytI4DaqFEEnfhGD++8JCnGQhl2FZKMPi5u9BcWPYPhSCOSuWYabpj4q5owQWwNA==} + babel-plugin-react-compiler@0.0.0-experimental-fe484b5-20240912: + resolution: {integrity: sha512-iGtEbwQeiLXba8o8ESTjogmQ8rTP6xHi+w3JIxR8HmKAb+SYZ3cljRhpOEsrxZIXuk3L9w9o98BJFIcxaVyFag==} babel-plugin-transform-async-to-promises@0.8.15: resolution: {integrity: sha512-fDXP68ZqcinZO2WCiimCL9zhGjGXOnn3D33zvbh+yheZ/qOrNVVDDIBtAaM3Faz8TRvQzHiRKsu3hfrBAhEncQ==} @@ -10368,7 +10368,7 @@ packages: lucide-react@0.383.0: resolution: {integrity: sha512-13xlG0CQCJtzjSQYwwJ3WRqMHtRj3EXmLlorrARt7y+IHnxUCp3XyFNL1DfaGySWxHObDvnu1u1dV+0VMKHUSg==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} @@ -12604,28 +12604,28 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - react-dom@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-lgOBiTipHJIKgJyiaV/YhL28X0vdt30fuHQxiW73/3WSu/ePSO/hV8uSefpiPhqMTq4TUKKylOBHhcG1/fy3Jw==} + react-dom@0.0.0-experimental-94e652d5-20240912: + resolution: {integrity: sha512-7BrMUk+lZJu7tGXx/T1E+FGvqYYx5JxrddNfsaeTJSTg9pnP3t2FAKssqYq4jzbLxxId5WISGQVLNSn1diDoTw==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 react-dom@17.0.2: resolution: {integrity: sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 - react-dom@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-EMgZJX6EEQEr+pso+9ySkrEMPv3N7zF2fbi0f6uB+X7r8E+O2GqPRcIHtFigMdW8uS0XCVFHAocMnIc4yPULYQ==} + react-dom@19.0.0-rc-94e652d5-20240912: + resolution: {integrity: sha512-LlW996oHhRlCcBJOe6yCUtfWvOs2uRYePEHmUlOHt3CqH9+oP9ttexDtshC9RUD8R8bnfMNRfIYy4nRhhzRNQA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 react-dom@19.0.0-rc-f90a6bcc-20240827: resolution: {integrity: sha512-oUa/reDvGtjRcxi8u+GYHaDHanudaO28+G+Wvxm50CItW1xwIFN2Nn7foJxxDS9lFLGdRWZvjxldZEPAUSuXbg==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 - react-is@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-vy9RwFmrhsGQAJEbFQyTskRWXVm39Ax2Ikao51VX2GBXoV2XOQ17vdhyhltCOa+yuoNj0p3X2C90+bxG+w2u0Q==} + react-is@19.0.0-rc-94e652d5-20240912: + resolution: {integrity: sha512-oUUVt/Hgf7+yNA4JPSjFLKgdYFFFBidYe8mYVcMK+y9uY7FMH2MHSKF4PmIi2Xu7Ov3Wyry9i0RvQarrLO13xA==} react-is@19.0.0-rc-f90a6bcc-20240827: resolution: {integrity: sha512-1tXoLFzVbqHAQeY3CwpyF5IYbkwgSoNHhrhS8qOrfiZIh2461h/C1BP/JVIxwyL51wHhUgLsAc/M8g0OcEhV1A==} @@ -12636,8 +12636,8 @@ packages: react-number-format@5.4.0: resolution: {integrity: sha512-NWdICrqLhI7rAS8yUeLVd6Wr4cN7UjJ9IBTS0f/a9i7UB4x4Ti70kGnksBtZ7o4Z7YRbvCMMR/jQmkoOBa/4fg==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912 react-refresh@0.12.0: resolution: {integrity: sha512-suLIhrU2IHKL5JEKR/fAwJv7bbeq4kJ+pJopf77jHwuR+HmJS/HbrPIGsTBUVfw7tXPOmYv7UJ7PCaN49e8x4A==} @@ -12648,7 +12648,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@types/react': optional: true @@ -12658,58 +12658,58 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@types/react': optional: true - react-server-dom-turbopack@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-5j6sur5W5Oj7XZfS8EjvwmnbvaW42HHPY00ur0/HCvUxZNEPsTg7Ri4y3WlP4ebZTKdubCU5hD/Nt5/GkxvnuQ==} + react-server-dom-turbopack@0.0.0-experimental-94e652d5-20240912: + resolution: {integrity: sha512-VXkcm1UQcQMDhrjqsPgG8V1UZsUBNTiAUM5JUcoddtfuhfabAr46p5SpHSMnRfTjisENymPLxvfW+PWbNdSG3Q==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912 - react-server-dom-turbopack@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-KkipAuYaTTQivseV0DNwRS8K6o8K5YuohXlXS5NY9QPXAyyk/Q2LSFUayMrk9ICAmty+Fs5xVjN4UAIpi1gmOQ==} + react-server-dom-turbopack@19.0.0-rc-94e652d5-20240912: + resolution: {integrity: sha512-rD+syfpMi68O6yjvI/FTzt2ZjWeHujkw4YYM5hTuF9sivafpoNaY0EnkZOqq1Bfk6ITJw5NjkebwUPLir0RVpQ==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912 - react-server-dom-webpack@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-swlsAzmGKLEp+afolIWJo8jIwt0GLux2j4IQzqVRRw1j/1nn7aO6a5po/rveOMR6XT/ktsE307vre8rEBungxQ==} + react-server-dom-webpack@0.0.0-experimental-94e652d5-20240912: + resolution: {integrity: sha512-TBIQlHmXfWIATH0gFXpJ4M7+SD5GzP5x2ThxOaDTDD398ph2uGkqHkdCIrcTDYGY9Pj0oxAHdFE2gAZNks16FQ==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912 webpack: 5.90.0 - react-server-dom-webpack@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-2r7481kcNjYtQ97f9fuVnT6YSPk4b6RCno+4UoBSKYDq1nCU/Ybj0b1O/68BqYGdpu5fYI0UVDrfI3ywWVuvbg==} + react-server-dom-webpack@19.0.0-rc-94e652d5-20240912: + resolution: {integrity: sha512-v7E3IfaB50LnCRa/O3Y+40hX2ZR0zZ60md38mX3XovxPHplQ/bi1rYbmcav/nMBLbdxaJfrjj3/4+DdLq8zGsQ==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912 webpack: 5.90.0 react-shallow-renderer@16.15.0: resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 react-ssr-prepass@1.0.8: resolution: {integrity: sha512-O0gfRA1SaK+9ITKxqfnXsej2jF+OHGP/+GxD4unROQaM/0/UczGF9fuF+wTboxaQoKdIf4FvS3h/OigWh704VA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-is: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-is: 19.0.0-rc-94e652d5-20240912 react-style-singleton@2.2.1: resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@types/react': optional: true @@ -12717,30 +12717,30 @@ packages: react-test-renderer@18.2.0: resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 react-textarea-autosize@8.5.3: resolution: {integrity: sha512-XT1024o2pqCuZSuBt9FwHlaDeNtVrtCXu0Rnz88t1jUGheCLa3PhjE1GH8Ctm2axEtvdCl5SUHYschyQ0L5QHQ==} engines: {node: '>=10'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 react-virtualized@9.22.3: resolution: {integrity: sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912 - react@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-Jh40juQIRyTl4q5yH53JzVLCP5h5CcnDBgfcz8hYQTLvvKoxWFr5dR78mUIrc8IPInn8bcOconodGJaXYVqTSQ==} + react@0.0.0-experimental-94e652d5-20240912: + resolution: {integrity: sha512-Q9UqXzRoL3Vw3xFG89M4B0WmABO/ReDv5n2FOdW6Y8Ysx4YpnafwwiSgHoX2cXhegLFIWIcbj2fkOrDhvqTCBA==} engines: {node: '>=0.10.0'} react@17.0.2: resolution: {integrity: sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==} engines: {node: '>=0.10.0'} - react@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-Xg6LoxgPpT4efYHzRB2gUUQCoNXu2df3sOBRgiUvzTVT1qQNOV611/w80JiOmnTWlIyCaUfSkNrMG8OUO/D+AA==} + react@19.0.0-rc-94e652d5-20240912: + resolution: {integrity: sha512-PHwCc7F7ADVvakVLoipa+XKUBn0kpDUAjpwePALeeTfzh1YU4XGk6FsRWPq4bAjm1r2ySRaAZQfnqeoaMG68+A==} engines: {node: '>=0.10.0'} react@19.0.0-rc-f90a6bcc-20240827: @@ -13266,11 +13266,11 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - scheduler@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-/5YtUIFqGx1aHcSLqT9VBmzJ1nX8XOYkooipvfwH4ZRYuGptkHypXx+FUO4caZoN0O29dI3yUBUk3msVp6wMyg==} + scheduler@0.0.0-experimental-94e652d5-20240912: + resolution: {integrity: sha512-NVFklGum1CNeA6cR0m4q+uUPLIcmQHlo+1B/qlLgH+/2z9J3lWmnT3Fep8qbfxsYCzOVXfx6QdHX3Z04+fxgPQ==} - scheduler@0.25.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-n4nHmAoerbIOSrH24w0+fcdCUwQ4Npm7yXfsrn09FL01OWIaxpuo4P0rj3qPyLFgsJDbn18sWvLVB/e/KPnR+A==} + scheduler@0.25.0-rc-94e652d5-20240912: + resolution: {integrity: sha512-9GaWEeTUr3cpnzrBQaQrBThAzGdwH6up2pAx2NPoyB2HmFZ/EEJ3uOCfcCcoCWzwDV4UmtHWWstM9ASFO8zupA==} schema-utils@2.7.1: resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} @@ -13844,8 +13844,8 @@ packages: engines: {node: '>= 16'} peerDependencies: babel-plugin-styled-components: '>= 2' - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: babel-plugin-styled-components: optional: true @@ -13859,7 +13859,7 @@ packages: peerDependencies: '@babel/core': '*' babel-plugin-macros: '*' - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@babel/core': optional: true @@ -13936,7 +13936,7 @@ packages: swr@2.2.4: resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 symbol-observable@1.0.1: resolution: {integrity: sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==} @@ -14674,7 +14674,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@types/react': optional: true @@ -14682,13 +14682,13 @@ packages: use-composed-ref@1.3.0: resolution: {integrity: sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 use-isomorphic-layout-effect@1.1.2: resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@types/react': optional: true @@ -14697,7 +14697,7 @@ packages: resolution: {integrity: sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@types/react': optional: true @@ -14707,7 +14707,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 peerDependenciesMeta: '@types/react': optional: true @@ -14715,7 +14715,7 @@ packages: use-sync-external-store@1.2.0: resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 use@3.1.1: resolution: {integrity: sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==} @@ -17103,17 +17103,17 @@ snapshots: '@emotion/memoize@0.8.1': {} - '@emotion/react@11.11.1(react@19.0.0-rc-7771d3a7-20240827)(types-react@19.0.0-rc.0)': + '@emotion/react@11.11.1(react@19.0.0-rc-94e652d5-20240912)(types-react@19.0.0-rc.0)': dependencies: '@babel/runtime': 7.22.5 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-7771d3a7-20240827) + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-94e652d5-20240912) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 hoist-non-react-statics: 3.3.2 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 optionalDependencies: '@types/react': types-react@19.0.0-rc.0 @@ -17129,9 +17129,9 @@ snapshots: '@emotion/unitless@0.8.1': {} - '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-7771d3a7-20240827)': + '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-94e652d5-20240912)': dependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 '@emotion/utils@1.2.1': {} @@ -18491,11 +18491,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@mdx-js/react@2.2.1(react@19.0.0-rc-7771d3a7-20240827)': + '@mdx-js/react@2.2.1(react@19.0.0-rc-94e652d5-20240912)': dependencies: '@types/mdx': 2.0.3 '@types/react': types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 '@mdx-js/react@2.2.1(react@19.0.0-rc-f90a6bcc-20240827)': dependencies: @@ -19314,13 +19314,13 @@ snapshots: '@types/jest': 29.5.5 jest: 29.7.0(@types/node@20.12.3)(babel-plugin-macros@3.1.0) - '@testing-library/react@15.0.7(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(types-react@19.0.0-rc.0)': + '@testing-library/react@15.0.7(react-dom@19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912))(react@19.0.0-rc-94e652d5-20240912)(types-react@19.0.0-rc.0)': dependencies: '@babel/runtime': 7.22.5 '@testing-library/dom': 10.1.0 '@types/react-dom': types-react-dom@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912) optionalDependencies: '@types/react': types-react@19.0.0-rc.0 @@ -20578,7 +20578,7 @@ snapshots: zod: 3.23.8 zod-validation-error: 2.1.0(zod@3.23.8) - babel-plugin-react-compiler@0.0.0-experimental-fe484b5-20240911: + babel-plugin-react-compiler@0.0.0-experimental-fe484b5-20240912: dependencies: '@babel/generator': 7.2.0 '@babel/types': 7.22.5 @@ -24247,7 +24247,7 @@ snapshots: hoist-non-react-statics@3.3.2: dependencies: - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-94e652d5-20240912 homedir-polyfill@1.0.3: dependencies: @@ -28686,25 +28686,25 @@ snapshots: '@jest/types': 24.9.0 ansi-regex: 4.1.0 ansi-styles: 3.2.1 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-94e652d5-20240912 pretty-format@27.5.1: dependencies: ansi-regex: 5.0.1 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-94e652d5-20240912 pretty-format@29.5.0: dependencies: '@jest/schemas': 29.4.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-94e652d5-20240912 pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-94e652d5-20240912 pretty-ms@7.0.0: dependencies: @@ -28761,7 +28761,7 @@ snapshots: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-94e652d5-20240912 property-information@5.6.0: dependencies: @@ -28933,29 +28933,29 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-dom@0.0.0-experimental-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827): + react-dom@0.0.0-experimental-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912): dependencies: - react: 19.0.0-rc-7771d3a7-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + scheduler: 0.25.0-rc-94e652d5-20240912 - react-dom@17.0.2(react@19.0.0-rc-7771d3a7-20240827): + react-dom@17.0.2(react@19.0.0-rc-94e652d5-20240912): dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react: 19.0.0-rc-7771d3a7-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + scheduler: 0.25.0-rc-94e652d5-20240912 - react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827): + react-dom@19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912): dependencies: - react: 19.0.0-rc-7771d3a7-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + scheduler: 0.25.0-rc-94e652d5-20240912 react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827): dependencies: react: 19.0.0-rc-f90a6bcc-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + scheduler: 0.25.0-rc-94e652d5-20240912 - react-is@19.0.0-rc-7771d3a7-20240827: {} + react-is@19.0.0-rc-94e652d5-20240912: {} react-is@19.0.0-rc-f90a6bcc-20240827: {} @@ -28988,48 +28988,48 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - react-server-dom-turbopack@0.0.0-experimental-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827): + react-server-dom-turbopack@0.0.0-experimental-94e652d5-20240912(react-dom@19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912))(react@19.0.0-rc-94e652d5-20240912): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912) - react-server-dom-turbopack@19.0.0-rc-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827): + react-server-dom-turbopack@19.0.0-rc-94e652d5-20240912(react-dom@19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912))(react@19.0.0-rc-94e652d5-20240912): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912) - react-server-dom-webpack@0.0.0-experimental-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): + react-server-dom-webpack@0.0.0-experimental-94e652d5-20240912(react-dom@19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912))(react@19.0.0-rc-94e652d5-20240912)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912) webpack: 5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-server-dom-webpack@19.0.0-rc-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): + react-server-dom-webpack@19.0.0-rc-94e652d5-20240912(react-dom@19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912))(react@19.0.0-rc-94e652d5-20240912)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912) webpack: 5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-shallow-renderer@16.15.0(react@19.0.0-rc-7771d3a7-20240827): + react-shallow-renderer@16.15.0(react@19.0.0-rc-94e652d5-20240912): dependencies: object-assign: 4.1.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-is: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-is: 19.0.0-rc-94e652d5-20240912 - react-ssr-prepass@1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-7771d3a7-20240827): + react-ssr-prepass@1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-94e652d5-20240912): dependencies: object-is: 1.0.2 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 react-is: 19.0.0-rc-f90a6bcc-20240827 react-style-singleton@2.2.1(react@19.0.0-rc-f90a6bcc-20240827)(types-react@19.0.0-rc.0): @@ -29041,12 +29041,12 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - react-test-renderer@18.2.0(react@19.0.0-rc-7771d3a7-20240827): + react-test-renderer@18.2.0(react@19.0.0-rc-94e652d5-20240912): dependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-is: 19.0.0-rc-7771d3a7-20240827 - react-shallow-renderer: 16.15.0(react@19.0.0-rc-7771d3a7-20240827) - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 + react-is: 19.0.0-rc-94e652d5-20240912 + react-shallow-renderer: 16.15.0(react@19.0.0-rc-94e652d5-20240912) + scheduler: 0.25.0-rc-94e652d5-20240912 react-textarea-autosize@8.5.3(react@19.0.0-rc-f90a6bcc-20240827)(types-react@19.0.0-rc.0): dependencies: @@ -29057,25 +29057,25 @@ snapshots: transitivePeerDependencies: - '@types/react' - react-virtualized@9.22.3(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827): + react-virtualized@9.22.3(react-dom@19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912))(react@19.0.0-rc-94e652d5-20240912): dependencies: '@babel/runtime': 7.22.5 clsx: 1.1.1 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912) react-lifecycles-compat: 3.0.4 - react@0.0.0-experimental-7771d3a7-20240827: {} + react@0.0.0-experimental-94e652d5-20240912: {} react@17.0.2: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react@19.0.0-rc-7771d3a7-20240827: {} + react@19.0.0-rc-94e652d5-20240912: {} react@19.0.0-rc-f90a6bcc-20240827: {} @@ -29765,9 +29765,9 @@ snapshots: dependencies: xmlchars: 2.2.0 - scheduler@0.0.0-experimental-7771d3a7-20240827: {} + scheduler@0.0.0-experimental-94e652d5-20240912: {} - scheduler@0.25.0-rc-7771d3a7-20240827: {} + scheduler@0.25.0-rc-94e652d5-20240912: {} schema-utils@2.7.1: dependencies: @@ -30419,7 +30419,7 @@ snapshots: dependencies: inline-style-parser: 0.1.1 - styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827): + styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912))(react@19.0.0-rc-94e652d5-20240912): dependencies: '@babel/cli': 7.21.5(@babel/core@7.22.5) '@babel/core': 7.22.5 @@ -30434,8 +30434,8 @@ snapshots: '@emotion/unitless': 0.8.1 css-to-react-native: 3.2.0 postcss: 8.4.31 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-94e652d5-20240912 + react-dom: 19.0.0-rc-94e652d5-20240912(react@19.0.0-rc-94e652d5-20240912) shallowequal: 1.1.0 stylis: 4.2.0 tslib: 2.5.3 @@ -30447,10 +30447,10 @@ snapshots: postcss: 7.0.32 postcss-load-plugins: 2.3.0 - styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7771d3a7-20240827): + styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-94e652d5-20240912): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 optionalDependencies: '@babel/core': 7.22.5 babel-plugin-macros: 3.1.0 @@ -30540,11 +30540,11 @@ snapshots: picocolors: 1.0.1 stable: 0.1.8 - swr@2.2.4(react@19.0.0-rc-7771d3a7-20240827): + swr@2.2.4(react@19.0.0-rc-94e652d5-20240912): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-7771d3a7-20240827 - use-sync-external-store: 1.2.0(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-94e652d5-20240912 + use-sync-external-store: 1.2.0(react@19.0.0-rc-94e652d5-20240912) symbol-observable@1.0.1: {} @@ -31229,9 +31229,9 @@ snapshots: unist-util-is: 5.2.0 unist-util-visit-parents: 5.1.3 - unistore@3.4.1(react@19.0.0-rc-7771d3a7-20240827): + unistore@3.4.1(react@19.0.0-rc-94e652d5-20240912): optionalDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 universal-github-app-jwt@1.1.1: dependencies: @@ -31356,9 +31356,9 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - use-sync-external-store@1.2.0(react@19.0.0-rc-7771d3a7-20240827): + use-sync-external-store@1.2.0(react@19.0.0-rc-94e652d5-20240912): dependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-94e652d5-20240912 use@3.1.1: {} diff --git a/run-tests.js b/run-tests.js index f1f00f88e64c1..ee818300d59f2 100644 --- a/run-tests.js +++ b/run-tests.js @@ -20,7 +20,7 @@ const { getTestFilter } = require('./test/get-test-filter') // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-7771d3a7-20240827"; +const nextjsReactPeerVersion = "19.0.0-rc-94e652d5-20240912"; let argv = require('yargs/yargs')(process.argv.slice(2)) .string('type') diff --git a/test/.stats-app/package.json b/test/.stats-app/package.json index 58cf2ed6c29fd..2903e214199d0 100644 --- a/test/.stats-app/package.json +++ b/test/.stats-app/package.json @@ -4,8 +4,8 @@ "license": "MIT", "dependencies": { "next": "latest", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912" }, "engines": { "node": ">=18.18.0" diff --git a/test/e2e/next-test/first-time-setup-js/package.json b/test/e2e/next-test/first-time-setup-js/package.json index a135b40a27c11..63d8004af1690 100644 --- a/test/e2e/next-test/first-time-setup-js/package.json +++ b/test/e2e/next-test/first-time-setup-js/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912" } } diff --git a/test/e2e/next-test/first-time-setup-ts/package.json b/test/e2e/next-test/first-time-setup-ts/package.json index 107dfe0c5b5f7..fb969f4a58fcb 100644 --- a/test/e2e/next-test/first-time-setup-ts/package.json +++ b/test/e2e/next-test/first-time-setup-ts/package.json @@ -8,8 +8,8 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-94e652d5-20240912", + "react-dom": "19.0.0-rc-94e652d5-20240912" }, "devDependencies": { "@types/react": "^18", diff --git a/test/lib/next-modes/base.ts b/test/lib/next-modes/base.ts index 2797fa63a0cc9..752959e92b681 100644 --- a/test/lib/next-modes/base.ts +++ b/test/lib/next-modes/base.ts @@ -51,7 +51,7 @@ type OmitFirstArgument = F extends ( // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-7771d3a7-20240827"; +const nextjsReactPeerVersion = "19.0.0-rc-94e652d5-20240912"; export class NextInstance { protected files: FileRef | { [filename: string]: string | FileRef }