From 716cd41764ba2edc35f07b7cdbff8caf7fa2959c Mon Sep 17 00:00:00 2001 From: sebmarkbage Date: Thu, 5 Sep 2024 18:04:06 -0700 Subject: [PATCH] [Fiber] Move runWithFiberInDEV from CommitWork to CommitEffects (#30882) Stacked on #30881. Move `runWithFiberInDEV` from the recursive part of the commit phase and instead wrap each call into user space. These should really map 1:1 with where we're using `try/catch` since that's where we're calling into user space. The goal of this is to avoid the extra stack frames added by `enableOwnerStacks` in the recursive parts to avoid stack overflow. This way we only have a couple of extra at the end of the stack instead of a couple of extra at every depth of the tree. DiffTrain build for [a03254bc60b06c535c37e43c53b1fd40757b2ef4](https://github.com/facebook/react/commit/a03254bc60b06c535c37e43c53b1fd40757b2ef4) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- compiled/facebook-www/React-dev.classic.js | 2 +- compiled/facebook-www/React-dev.modern.js | 2 +- compiled/facebook-www/React-prod.classic.js | 2 +- compiled/facebook-www/React-prod.modern.js | 2 +- .../facebook-www/React-profiling.classic.js | 2 +- .../facebook-www/React-profiling.modern.js | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 1398 ++++++------ compiled/facebook-www/ReactART-dev.modern.js | 1375 ++++++------ .../facebook-www/ReactART-prod.classic.js | 38 +- compiled/facebook-www/ReactART-prod.modern.js | 38 +- compiled/facebook-www/ReactDOM-dev.classic.js | 1883 +++++++++-------- compiled/facebook-www/ReactDOM-dev.modern.js | 1871 ++++++++-------- .../facebook-www/ReactDOM-prod.classic.js | 40 +- compiled/facebook-www/ReactDOM-prod.modern.js | 40 +- .../ReactDOM-profiling.classic.js | 102 +- .../facebook-www/ReactDOM-profiling.modern.js | 102 +- .../ReactDOMServer-dev.classic.js | 2 +- .../facebook-www/ReactDOMServer-dev.modern.js | 2 +- .../ReactDOMServer-prod.classic.js | 2 +- .../ReactDOMServer-prod.modern.js | 2 +- .../ReactDOMTesting-dev.classic.js | 1883 +++++++++-------- .../ReactDOMTesting-dev.modern.js | 1871 ++++++++-------- .../ReactDOMTesting-prod.classic.js | 40 +- .../ReactDOMTesting-prod.modern.js | 40 +- .../ReactReconciler-dev.classic.js | 1277 +++++------ .../ReactReconciler-dev.modern.js | 1263 +++++------ .../ReactReconciler-prod.classic.js | 30 +- .../ReactReconciler-prod.modern.js | 30 +- .../ReactTestRenderer-dev.classic.js | 1522 ++++++------- .../ReactTestRenderer-dev.modern.js | 1522 ++++++------- compiled/facebook-www/VERSION_CLASSIC | 2 +- compiled/facebook-www/VERSION_MODERN | 2 +- 34 files changed, 8462 insertions(+), 7931 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index cd0fdc27ef..9556f1355b 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -fe03c56d1e51379a18676b04cf185e76f04cd457 +a03254bc60b06c535c37e43c53b1fd40757b2ef4 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index cd0fdc27ef..9556f1355b 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -fe03c56d1e51379a18676b04cf185e76f04cd457 +a03254bc60b06c535c37e43c53b1fd40757b2ef4 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index f19c7a5be4..9cd5d0f43d 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -2001,7 +2001,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-classic-fe03c56d-20240905"; + exports.version = "19.0.0-www-classic-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 0f280555d3..bc832ec1c6 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -1981,7 +1981,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-modern-fe03c56d-20240905"; + exports.version = "19.0.0-www-modern-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 87fab3517b..9276b9a995 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-fe03c56d-20240905"; +exports.version = "19.0.0-www-classic-a03254bc-20240905"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 2fb1199824..aea602c68a 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -665,4 +665,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-fe03c56d-20240905"; +exports.version = "19.0.0-www-modern-a03254bc-20240905"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index cf33859f44..a50efbc8d7 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-fe03c56d-20240905"; +exports.version = "19.0.0-www-classic-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index 582ddb76cc..be1de5bc11 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -669,7 +669,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-fe03c56d-20240905"; +exports.version = "19.0.0-www-modern-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 5f1f70d56e..2f295b3fea 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -1253,11 +1253,33 @@ __DEV__ && instance.draw(string, props.font, props.alignment, props.path), (instance._currentString = string); } + function resetTextContent() {} function shouldSetTextContent(type, props) { return ( "string" === typeof props.children || "number" === typeof props.children ); } + function removeChild(parentInstance, child) { + destroyEventListeners(child); + child.eject(); + } + function removeChildFromContainer(parentInstance, child) { + destroyEventListeners(child); + child.eject(); + } + function commitTextUpdate() {} + function commitMount() {} + function commitUpdate(instance, type, oldProps, newProps) { + instance._applyProps(instance, newProps, oldProps); + } + function hideInstance(instance) { + instance.hide(); + } + function hideTextInstance() {} + function unhideInstance(instance, props) { + (null == props.visible || props.visible) && instance.show(); + } + function unhideTextInstance() {} function getInstanceFromNode() { return null; } @@ -2568,6 +2590,16 @@ __DEV__ && ); 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) @@ -9642,7 +9674,11 @@ __DEV__ && (lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -9678,8 +9714,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -9721,7 +9764,13 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -9770,7 +9819,12 @@ __DEV__ && function commitClassDidMount(finishedWork) { var instance = finishedWork.stateNode; "function" === typeof instance.componentDidMount && - callComponentDidMountInDEV(finishedWork, instance); + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + instance + ); } function commitClassCallbacks(finishedWork) { var updateQueue = finishedWork.updateQueue; @@ -9790,12 +9844,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -9809,50 +9916,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -9865,11 +9979,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -9881,16 +9996,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -9899,31 +10037,35 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } + } function isHostParent(fiber) { return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; } @@ -9982,6 +10124,43 @@ __DEV__ && insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); } + function commitPlacement(finishedWork) { + 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: + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && (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." + ); + } + } function shouldProfile(current) { return ( 0 !== (current.mode & 2) && @@ -10002,8 +10181,68 @@ __DEV__ && (firstChild.return = root), (nextEffect = firstChild); else for (; null !== nextEffect; ) { - root = nextEffect; - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); + firstChild = root = nextEffect; + i = firstChild.alternate; + var flags = firstChild.flags; + if ( + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle + ) { + var JSCompiler_temp; + if ((JSCompiler_temp = 13 === firstChild.tag)) + a: { + if ( + null !== i && + ((JSCompiler_temp = i.memoizedState), + null === JSCompiler_temp || + null !== JSCompiler_temp.dehydrated) + ) { + JSCompiler_temp = firstChild.memoizedState; + JSCompiler_temp = + null !== JSCompiler_temp && + null === JSCompiler_temp.dehydrated; + break a; + } + JSCompiler_temp = !1; + } + JSCompiler_temp && + doesFiberContain(firstChild, focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + } + switch (firstChild.tag) { + case 0: + if ( + 0 !== (flags & 4) && + ((firstChild = firstChild.updateQueue), + (firstChild = null !== firstChild ? firstChild.events : null), + null !== firstChild) + ) + for (i = 0; i < firstChild.length; i++) + (flags = firstChild[i]), (flags.ref.impl = flags.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== i && + commitClassSnapshot(firstChild, i); + break; + case 3: + 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." + ); + } firstChild = root.sibling; if (null !== firstChild) { firstChild.return = root.return; @@ -10018,108 +10257,6 @@ __DEV__ && focusedInstanceHandle = null; return root; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - } - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (var ii = 0; ii < finishedWork.length; ii++) - (current = finishedWork[ii]), - (current.ref.impl = current.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - JSCompiler_temp = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 { - (ii = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (flags = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== ii || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = ii); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - 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 commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) switch (finishedWork.tag) { @@ -10152,97 +10289,95 @@ __DEV__ && } } } - 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -10258,7 +10393,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -10271,19 +10411,12 @@ __DEV__ && case 26: case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -10305,23 +10438,22 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 22: if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { - var newOffscreenSubtreeIsHidden = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || + offscreenSubtreeIsHidden), + !prevProps) + ) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -10329,31 +10461,18 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } - } else - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -10611,9 +10730,12 @@ __DEV__ && if (null !== hostParent) if (hostParentIsContainer) try { - var child = deletedFiber.stateNode; - destroyEventListeners(child); - child.eject(); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -10623,9 +10745,12 @@ __DEV__ && } else try { - var child$jscomp$0 = deletedFiber.stateNode; - destroyEventListeners(child$jscomp$0); - child$jscomp$0.eject(); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -10653,8 +10778,8 @@ __DEV__ && : clearSuspenseBoundary()); break; case 4: - child = hostParent; - child$jscomp$0 = hostParentIsContainer; + _prevHostParent = hostParent; + _prevHostParentIsContainer = hostParentIsContainer; hostParent = deletedFiber.stateNode.containerInfo; hostParentIsContainer = !0; recursivelyTraverseDeletionEffects( @@ -10662,8 +10787,8 @@ __DEV__ && nearestMountedAncestor, deletedFiber ); - hostParent = child; - hostParentIsContainer = child$jscomp$0; + hostParent = _prevHostParent; + hostParentIsContainer = _prevHostParentIsContainer; break; case 0: case 11: @@ -10671,44 +10796,52 @@ __DEV__ && case 15: if ( !offscreenSubtreeWasHidden && - ((child = deletedFiber.updateQueue), - null !== child && ((child = child.lastEffect), null !== child)) + ((_prevHostParent = deletedFiber.updateQueue), + null !== _prevHostParent && + ((_prevHostParent = _prevHostParent.lastEffect), + null !== _prevHostParent)) ) { - child$jscomp$0 = child = child.next; + _prevHostParentIsContainer = _prevHostParent = _prevHostParent.next; do { - _prevHostParent = child$jscomp$0.tag; - _prevHostParentIsContainer = child$jscomp$0.inst; - var destroy = _prevHostParentIsContainer.destroy; + var tag = _prevHostParentIsContainer.tag, + inst = _prevHostParentIsContainer.inst, + destroy = inst.destroy; void 0 !== destroy && - ((_prevHostParent & Insertion) !== NoFlags - ? ((_prevHostParentIsContainer.destroy = void 0), - callDestroyInDEV( + ((tag & Insertion) !== NoFlags + ? ((inst.destroy = void 0), + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy )) - : (_prevHostParent & Layout) !== NoFlags && + : (tag & Layout) !== NoFlags && (enableSchedulingProfiler && markComponentLayoutEffectUnmountStarted(deletedFiber), shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), - (_prevHostParentIsContainer.destroy = void 0), - callDestroyInDEV( + (inst.destroy = void 0), + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) - : ((_prevHostParentIsContainer.destroy = void 0), - callDestroyInDEV( + : ((inst.destroy = void 0), + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy )), enableSchedulingProfiler && markComponentLayoutEffectUnmountStopped())); - child$jscomp$0 = child$jscomp$0.next; - } while (child$jscomp$0 !== child); + _prevHostParentIsContainer = _prevHostParentIsContainer.next; + } while (_prevHostParentIsContainer !== _prevHostParent); } recursivelyTraverseDeletionEffects( finishedRoot, @@ -10719,12 +10852,12 @@ __DEV__ && case 1: offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), - (child = deletedFiber.stateNode), - "function" === typeof child.componentWillUnmount && + (_prevHostParent = deletedFiber.stateNode), + "function" === typeof _prevHostParent.componentWillUnmount && safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - child + _prevHostParent )); recursivelyTraverseDeletionEffects( finishedRoot, @@ -10744,14 +10877,14 @@ __DEV__ && safelyDetachRef(deletedFiber, nearestMountedAncestor); disableLegacyMode || deletedFiber.mode & 1 ? ((offscreenSubtreeWasHidden = - (child = offscreenSubtreeWasHidden) || + (_prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState), recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ), - (offscreenSubtreeWasHidden = child)) + (offscreenSubtreeWasHidden = _prevHostParent)) : recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -10836,20 +10969,10 @@ __DEV__ && 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++) { @@ -10889,16 +11012,10 @@ __DEV__ && } 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) { @@ -10906,7 +11023,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -10930,42 +11047,54 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if ( - flags & 64 && + flags & 64 && offscreenSubtreeIsHidden && ((finishedWork = finishedWork.updateQueue), null !== finishedWork && - ((flags = finishedWork.callbacks), null !== flags)) - ) { - var existingHiddenCallbacks = finishedWork.shared.hiddenCallbacks; - finishedWork.shared.hiddenCallbacks = - null === existingHiddenCallbacks - ? flags - : existingHiddenCallbacks.concat(flags); - } + ((flags = finishedWork.callbacks), + null !== flags && + ((current = finishedWork.shared.hiddenCallbacks), + (finishedWork.shared.hiddenCallbacks = + null === current ? flags : current.concat(flags))))); break; case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4 && null != finishedWork.stateNode) { - existingHiddenCallbacks = finishedWork.memoizedProps; - var oldProps = - null !== current - ? current.memoizedProps - : existingHiddenCallbacks; + if (finishedWork.flags & 32) { + var instance = finishedWork.stateNode; try { - var instance = finishedWork.stateNode; - instance._applyProps(instance, existingHiddenCallbacks, oldProps); + runWithFiberInDEV(finishedWork, resetTextContent, instance); + } catch (error$24) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$24 + ); + } + } + if (flags & 4 && null != finishedWork.stateNode) { + instance = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : instance; + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + current, + instance, + finishedWork + ); } catch (error$22) { captureCommitPhaseError( finishedWork, @@ -10981,32 +11110,51 @@ __DEV__ && ); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4 && 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." - ); + 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.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + instance, + current, + flags + ); + } catch (error$23) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$23 + ); + } + } break; case 3: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; case 4: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && - ((existingHiddenCallbacks = null !== finishedWork.memoizedState), - (oldProps = null !== current && null !== current.memoizedState), + ((instance = null !== finishedWork.memoizedState), + (current = null !== current && null !== current.memoizedState), alwaysThrottleRetries - ? existingHiddenCallbacks !== oldProps && - (globalMostRecentFallbackTime = now$1()) - : existingHiddenCallbacks && - !oldProps && + ? instance !== current && (globalMostRecentFallbackTime = now$1()) + : instance && + !current && (globalMostRecentFallbackTime = now$1())); if (flags & 4) { try { @@ -11037,18 +11185,19 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - instance = null !== finishedWork.memoizedState; - suspenseCallback = null !== current && null !== current.memoizedState; + suspenseCallback = null !== finishedWork.memoizedState; + retryQueue = null !== current && null !== current.memoizedState; if (disableLegacyMode || finishedWork.mode & 1) { - retryQueue = offscreenSubtreeIsHidden; - var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = retryQueue || instance; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || suspenseCallback; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = retryQueue; - } else recursivelyTraverseMutationEffects(root, finishedWork, lanes); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + } else recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -11056,13 +11205,13 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = instance + ((root._visibility = suspenseCallback ? root._visibility & -2 : root._visibility | 1), - instance && + suspenseCallback && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - suspenseCallback || + retryQueue || root || ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && recursivelyTraverseDisappearLayoutEffects(finishedWork))), @@ -11072,20 +11221,51 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag) { if (null === current) { - lanes = current = root; + retryQueue = current = root; try { - (existingHiddenCallbacks = lanes.stateNode), - instance - ? existingHiddenCallbacks.hide() - : ((oldProps = lanes.memoizedProps), - (null == oldProps.visible || oldProps.visible) && - lanes.stateNode.show()); + (instance = retryQueue.stateNode), + suspenseCallback + ? runWithFiberInDEV(retryQueue, hideInstance, instance) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps + ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$25 + ); + } + } + } else if (6 === root.tag) { + if (null === current) { + retryQueue = root; + try { + var instance$jscomp$0 = retryQueue.stateNode; + suspenseCallback + ? runWithFiberInDEV( + retryQueue, + hideTextInstance, + instance$jscomp$0 + ) + : runWithFiberInDEV( + retryQueue, + unhideTextInstance, + instance$jscomp$0, + retryQueue.memoizedProps + ); + } catch (error$26) { + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$26 + ); } } } else if ( - 6 !== root.tag && ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || root === finishedWork) && @@ -11109,16 +11289,13 @@ __DEV__ && flags & 4 && ((flags = finishedWork.updateQueue), null !== flags && - ((existingHiddenCallbacks = flags.retryQueue), - null !== existingHiddenCallbacks && + ((current = flags.retryQueue), + null !== current && ((flags.retryQueue = null), - attachSuspenseRetryListeners( - finishedWork, - existingHiddenCallbacks - )))); + attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -11127,7 +11304,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -11136,7 +11313,7 @@ __DEV__ && flags & 4 && prepareScopeUpdate(); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -11144,41 +11321,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && (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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -11189,27 +11332,13 @@ __DEV__ && 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) { @@ -11293,18 +11422,16 @@ __DEV__ && includeWorkInProgressEffects ); commitClassDidMount(finishedWork); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error$14) { captureCommitPhaseError( finishedWork, @@ -11326,6 +11453,10 @@ __DEV__ && finishedWork, includeWorkInProgressEffects ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -11394,9 +11525,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -11478,21 +11607,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -11501,9 +11615,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -11627,9 +11739,7 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & 1 ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((nextCache._visibility |= 4), recursivelyTraversePassiveMountEffects( @@ -11701,9 +11811,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -11763,9 +11871,7 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & 1 ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( @@ -11828,70 +11934,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -11959,11 +12041,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -12007,7 +12085,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -12034,116 +12112,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - if (null !== sibling) { - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, + current, instance, offscreenFiber, null, - !1 - ))); + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function invokeLayoutEffectMountInDEV(fiber) { @@ -13562,8 +13631,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (lanes = 0; lanes < transitions.length; lanes++) @@ -14579,14 +14648,13 @@ __DEV__ && a: if (parentComponent) { parentComponent = parentComponent._reactInternals; b: { - if ( - getNearestMountedFiber(parentComponent) !== parentComponent || - 1 !== parentComponent.tag - ) + var parentContext = + getNearestMountedFiber(parentComponent) === parentComponent; + if (!parentContext || 1 !== parentComponent.tag) throw Error( "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue." ); - var parentContext = parentComponent; + parentContext = parentComponent; do { switch (parentContext.tag) { case 3: @@ -16890,11 +16958,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-www-classic-fe03c56d-20240905", + version: "19.0.0-www-classic-a03254bc-20240905", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16928,7 +16996,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.0.0-www-classic-fe03c56d-20240905"; + exports.version = "19.0.0-www-classic-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index df51157942..7ecf67a9d1 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -1236,11 +1236,33 @@ __DEV__ && instance.draw(string, props.font, props.alignment, props.path), (instance._currentString = string); } + function resetTextContent() {} function shouldSetTextContent(type, props) { return ( "string" === typeof props.children || "number" === typeof props.children ); } + function removeChild(parentInstance, child) { + destroyEventListeners(child); + child.eject(); + } + function removeChildFromContainer(parentInstance, child) { + destroyEventListeners(child); + child.eject(); + } + function commitTextUpdate() {} + function commitMount() {} + function commitUpdate(instance, type, oldProps, newProps) { + instance._applyProps(instance, newProps, oldProps); + } + function hideInstance(instance) { + instance.hide(); + } + function hideTextInstance() {} + function unhideInstance(instance, props) { + (null == props.visible || props.visible) && instance.show(); + } + function unhideTextInstance() {} function getInstanceFromNode() { return null; } @@ -2453,6 +2475,16 @@ __DEV__ && ); 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) @@ -9274,7 +9306,11 @@ __DEV__ && (lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -9310,8 +9346,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -9353,7 +9396,13 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -9417,12 +9466,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -9436,50 +9538,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -9492,11 +9601,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -9508,16 +9618,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -9526,31 +9659,35 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } + } function isHostParent(fiber) { return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; } @@ -9609,6 +9746,43 @@ __DEV__ && insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); } + function commitPlacement(finishedWork) { + 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: + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && (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." + ); + } + } function shouldProfile(current) { return ( 0 !== (current.mode & 2) && @@ -9629,8 +9803,68 @@ __DEV__ && (firstChild.return = root), (nextEffect = firstChild); else for (; null !== nextEffect; ) { - root = nextEffect; - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); + firstChild = root = nextEffect; + i = firstChild.alternate; + var flags = firstChild.flags; + if ( + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle + ) { + var JSCompiler_temp; + if ((JSCompiler_temp = 13 === firstChild.tag)) + a: { + if ( + null !== i && + ((JSCompiler_temp = i.memoizedState), + null === JSCompiler_temp || + null !== JSCompiler_temp.dehydrated) + ) { + JSCompiler_temp = firstChild.memoizedState; + JSCompiler_temp = + null !== JSCompiler_temp && + null === JSCompiler_temp.dehydrated; + break a; + } + JSCompiler_temp = !1; + } + JSCompiler_temp && + doesFiberContain(firstChild, focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + } + switch (firstChild.tag) { + case 0: + if ( + 0 !== (flags & 4) && + ((firstChild = firstChild.updateQueue), + (firstChild = null !== firstChild ? firstChild.events : null), + null !== firstChild) + ) + for (i = 0; i < firstChild.length; i++) + (flags = firstChild[i]), (flags.ref.impl = flags.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== i && + commitClassSnapshot(firstChild, i); + break; + case 3: + 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." + ); + } firstChild = root.sibling; if (null !== firstChild) { firstChild.return = root.return; @@ -9645,108 +9879,6 @@ __DEV__ && focusedInstanceHandle = null; return root; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - } - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (var ii = 0; ii < finishedWork.length; ii++) - (current = finishedWork[ii]), - (current.ref.impl = current.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - JSCompiler_temp = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 { - (ii = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (flags = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== ii || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = ii); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - 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 commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) switch (finishedWork.tag) { @@ -9779,97 +9911,95 @@ __DEV__ && } } } - 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -9885,7 +10015,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -9898,19 +10033,12 @@ __DEV__ && case 26: case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -9932,22 +10060,18 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 22: - var newOffscreenSubtreeIsHidden = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -9955,11 +10079,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -9969,11 +10089,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -10231,9 +10347,12 @@ __DEV__ && if (null !== hostParent) if (hostParentIsContainer) try { - var child = deletedFiber.stateNode; - destroyEventListeners(child); - child.eject(); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -10243,9 +10362,12 @@ __DEV__ && } else try { - var child$jscomp$0 = deletedFiber.stateNode; - destroyEventListeners(child$jscomp$0); - child$jscomp$0.eject(); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -10273,8 +10395,8 @@ __DEV__ && : clearSuspenseBoundary()); break; case 4: - child = hostParent; - child$jscomp$0 = hostParentIsContainer; + _prevHostParent = hostParent; + _prevHostParentIsContainer = hostParentIsContainer; hostParent = deletedFiber.stateNode.containerInfo; hostParentIsContainer = !0; recursivelyTraverseDeletionEffects( @@ -10282,8 +10404,8 @@ __DEV__ && nearestMountedAncestor, deletedFiber ); - hostParent = child; - hostParentIsContainer = child$jscomp$0; + hostParent = _prevHostParent; + hostParentIsContainer = _prevHostParentIsContainer; break; case 0: case 11: @@ -10291,44 +10413,52 @@ __DEV__ && case 15: if ( !offscreenSubtreeWasHidden && - ((child = deletedFiber.updateQueue), - null !== child && ((child = child.lastEffect), null !== child)) + ((_prevHostParent = deletedFiber.updateQueue), + null !== _prevHostParent && + ((_prevHostParent = _prevHostParent.lastEffect), + null !== _prevHostParent)) ) { - child$jscomp$0 = child = child.next; + _prevHostParentIsContainer = _prevHostParent = _prevHostParent.next; do { - _prevHostParent = child$jscomp$0.tag; - _prevHostParentIsContainer = child$jscomp$0.inst; - var destroy = _prevHostParentIsContainer.destroy; + var tag = _prevHostParentIsContainer.tag, + inst = _prevHostParentIsContainer.inst, + destroy = inst.destroy; void 0 !== destroy && - ((_prevHostParent & Insertion) !== NoFlags - ? ((_prevHostParentIsContainer.destroy = void 0), - callDestroyInDEV( + ((tag & Insertion) !== NoFlags + ? ((inst.destroy = void 0), + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy )) - : (_prevHostParent & Layout) !== NoFlags && + : (tag & Layout) !== NoFlags && (enableSchedulingProfiler && markComponentLayoutEffectUnmountStarted(deletedFiber), shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), - (_prevHostParentIsContainer.destroy = void 0), - callDestroyInDEV( + (inst.destroy = void 0), + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) - : ((_prevHostParentIsContainer.destroy = void 0), - callDestroyInDEV( + : ((inst.destroy = void 0), + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy )), enableSchedulingProfiler && markComponentLayoutEffectUnmountStopped())); - child$jscomp$0 = child$jscomp$0.next; - } while (child$jscomp$0 !== child); + _prevHostParentIsContainer = _prevHostParentIsContainer.next; + } while (_prevHostParentIsContainer !== _prevHostParent); } recursivelyTraverseDeletionEffects( finishedRoot, @@ -10339,12 +10469,12 @@ __DEV__ && case 1: offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), - (child = deletedFiber.stateNode), - "function" === typeof child.componentWillUnmount && + (_prevHostParent = deletedFiber.stateNode), + "function" === typeof _prevHostParent.componentWillUnmount && safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - child + _prevHostParent )); recursivelyTraverseDeletionEffects( finishedRoot, @@ -10363,14 +10493,14 @@ __DEV__ && case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); offscreenSubtreeWasHidden = - (child = offscreenSubtreeWasHidden) || + (_prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - offscreenSubtreeWasHidden = child; + offscreenSubtreeWasHidden = _prevHostParent; break; default: recursivelyTraverseDeletionEffects( @@ -10450,20 +10580,10 @@ __DEV__ && 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++) { @@ -10503,16 +10623,10 @@ __DEV__ && } 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) { @@ -10520,7 +10634,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -10544,42 +10658,54 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if ( - flags & 64 && + flags & 64 && offscreenSubtreeIsHidden && ((finishedWork = finishedWork.updateQueue), null !== finishedWork && - ((flags = finishedWork.callbacks), null !== flags)) - ) { - var existingHiddenCallbacks = finishedWork.shared.hiddenCallbacks; - finishedWork.shared.hiddenCallbacks = - null === existingHiddenCallbacks - ? flags - : existingHiddenCallbacks.concat(flags); - } + ((flags = finishedWork.callbacks), + null !== flags && + ((current = finishedWork.shared.hiddenCallbacks), + (finishedWork.shared.hiddenCallbacks = + null === current ? flags : current.concat(flags))))); break; case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4 && null != finishedWork.stateNode) { - existingHiddenCallbacks = finishedWork.memoizedProps; - var oldProps = - null !== current - ? current.memoizedProps - : existingHiddenCallbacks; + if (finishedWork.flags & 32) { + var instance = finishedWork.stateNode; try { - var instance = finishedWork.stateNode; - instance._applyProps(instance, existingHiddenCallbacks, oldProps); + runWithFiberInDEV(finishedWork, resetTextContent, instance); + } catch (error$24) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$24 + ); + } + } + if (flags & 4 && null != finishedWork.stateNode) { + instance = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : instance; + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + current, + instance, + finishedWork + ); } catch (error$22) { captureCommitPhaseError( finishedWork, @@ -10595,32 +10721,51 @@ __DEV__ && ); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4 && 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." - ); + 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.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + instance, + current, + flags + ); + } catch (error$23) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$23 + ); + } + } break; case 3: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; case 4: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && - ((existingHiddenCallbacks = null !== finishedWork.memoizedState), - (oldProps = null !== current && null !== current.memoizedState), + ((instance = null !== finishedWork.memoizedState), + (current = null !== current && null !== current.memoizedState), alwaysThrottleRetries - ? existingHiddenCallbacks !== oldProps && - (globalMostRecentFallbackTime = now$1()) - : existingHiddenCallbacks && - !oldProps && + ? instance !== current && (globalMostRecentFallbackTime = now$1()) + : instance && + !current && (globalMostRecentFallbackTime = now$1())); if (flags & 4) { try { @@ -10651,16 +10796,17 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - instance = null !== finishedWork.memoizedState; - suspenseCallback = null !== current && null !== current.memoizedState; - retryQueue = offscreenSubtreeIsHidden; - var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = retryQueue || instance; + suspenseCallback = null !== finishedWork.memoizedState; + retryQueue = null !== current && null !== current.memoizedState; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || suspenseCallback; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = retryQueue; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -10668,13 +10814,13 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = instance + ((root._visibility = suspenseCallback ? root._visibility & -2 : root._visibility | 1), - instance && + suspenseCallback && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - suspenseCallback || + retryQueue || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -10683,20 +10829,51 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag) { if (null === current) { - lanes = current = root; + retryQueue = current = root; try { - (existingHiddenCallbacks = lanes.stateNode), - instance - ? existingHiddenCallbacks.hide() - : ((oldProps = lanes.memoizedProps), - (null == oldProps.visible || oldProps.visible) && - lanes.stateNode.show()); + (instance = retryQueue.stateNode), + suspenseCallback + ? runWithFiberInDEV(retryQueue, hideInstance, instance) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps + ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$25 + ); + } + } + } else if (6 === root.tag) { + if (null === current) { + retryQueue = root; + try { + var instance$jscomp$0 = retryQueue.stateNode; + suspenseCallback + ? runWithFiberInDEV( + retryQueue, + hideTextInstance, + instance$jscomp$0 + ) + : runWithFiberInDEV( + retryQueue, + unhideTextInstance, + instance$jscomp$0, + retryQueue.memoizedProps + ); + } catch (error$26) { + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$26 + ); } } } else if ( - 6 !== root.tag && ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || root === finishedWork) && @@ -10720,16 +10897,13 @@ __DEV__ && flags & 4 && ((flags = finishedWork.updateQueue), null !== flags && - ((existingHiddenCallbacks = flags.retryQueue), - null !== existingHiddenCallbacks && + ((current = flags.retryQueue), + null !== current && ((flags.retryQueue = null), - attachSuspenseRetryListeners( - finishedWork, - existingHiddenCallbacks - )))); + attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -10738,7 +10912,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -10747,7 +10921,7 @@ __DEV__ && flags & 4 && prepareScopeUpdate(); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -10755,41 +10929,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && (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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -10800,27 +10940,13 @@ __DEV__ && 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) { @@ -10905,19 +11031,22 @@ __DEV__ && ); current = finishedWork.stateNode; "function" === typeof current.componentDidMount && - callComponentDidMountInDEV(finishedWork, current); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error$14) { captureCommitPhaseError( finishedWork, @@ -10939,6 +11068,10 @@ __DEV__ && finishedWork, includeWorkInProgressEffects ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -11007,9 +11140,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -11091,21 +11222,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -11114,9 +11230,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -11239,9 +11353,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( @@ -11306,9 +11418,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -11367,9 +11477,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( @@ -11424,70 +11532,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -11555,11 +11639,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -11603,7 +11683,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -11630,116 +11710,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - if (null !== sibling) { - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, + current, instance, offscreenFiber, null, - !1 - ))); + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function isConcurrentActEnvironment() { @@ -13102,8 +13173,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (lanes = 0; lanes < transitions.length; lanes++) @@ -16333,11 +16404,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-www-modern-fe03c56d-20240905", + version: "19.0.0-www-modern-a03254bc-20240905", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16371,7 +16442,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.0.0-www-modern-fe03c56d-20240905"; + exports.version = "19.0.0-www-modern-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 1f9f1a36aa..aa70b56f23 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -7280,22 +7280,28 @@ function commitBeforeMutationEffects(root, firstChild) { break; case 1: if (0 !== (i & 1024) && null !== firstChild) { - i = root; - JSCompiler_temp = firstChild.memoizedProps; + i = void 0; + JSCompiler_temp = root; + var prevProps = firstChild.memoizedProps; firstChild = firstChild.memoizedState; - var instance = i.stateNode; + var instance = JSCompiler_temp.stateNode; try { - var snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - i.type, - JSCompiler_temp, - i.elementType === i.type - ), + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + prevProps, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + i = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, firstChild ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + instance.__reactInternalSnapshotBeforeUpdate = i; } catch (error) { - captureCommitPhaseError(i, i.return, error); + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } } break; @@ -7320,10 +7326,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10769,13 +10775,13 @@ var slice = Array.prototype.slice, })(React.Component); var internals$jscomp$inline_1420 = { bundleType: 0, - version: "19.0.0-www-classic-fe03c56d-20240905", + version: "19.0.0-www-classic-a03254bc-20240905", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: function () { return null; }, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1421 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -10801,4 +10807,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.0.0-www-classic-fe03c56d-20240905"; +exports.version = "19.0.0-www-classic-a03254bc-20240905"; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index e31d58203b..63c70cd15d 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -6889,22 +6889,28 @@ function commitBeforeMutationEffects(root, firstChild) { break; case 1: if (0 !== (i & 1024) && null !== firstChild) { - i = root; - JSCompiler_temp = firstChild.memoizedProps; + i = void 0; + JSCompiler_temp = root; + var prevProps = firstChild.memoizedProps; firstChild = firstChild.memoizedState; - var instance = i.stateNode; + var instance = JSCompiler_temp.stateNode; try { - var snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - i.type, - JSCompiler_temp, - i.elementType === i.type - ), + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + prevProps, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + i = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, firstChild ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + instance.__reactInternalSnapshotBeforeUpdate = i; } catch (error) { - captureCommitPhaseError(i, i.return, error); + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } } break; @@ -6929,10 +6935,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10283,13 +10289,13 @@ var slice = Array.prototype.slice, })(React.Component); var internals$jscomp$inline_1412 = { bundleType: 0, - version: "19.0.0-www-modern-fe03c56d-20240905", + version: "19.0.0-www-modern-a03254bc-20240905", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: function () { return null; }, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1413 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -10315,4 +10321,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.0.0-www-modern-fe03c56d-20240905"; +exports.version = "19.0.0-www-modern-a03254bc-20240905"; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index e9896a20e2..5695dfce88 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -4343,6 +4343,16 @@ __DEV__ && ); 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) @@ -9167,32 +9177,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2467; - var JSCompiler_object_inline_stack_2468 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2417; + var JSCompiler_object_inline_stack_2418 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2469 = !1; + var JSCompiler_object_inline_componentStack_2419 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2467 = didSuspend) || - (JSCompiler_object_inline_digest_2467 = + (JSCompiler_object_inline_digest_2417 = didSuspend) || + (JSCompiler_object_inline_digest_2417 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2467 && - ((JSCompiler_object_inline_componentStack_2469 = !0), + JSCompiler_object_inline_digest_2417 && + ((JSCompiler_object_inline_componentStack_2419 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2467 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2417 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2469 + JSCompiler_object_inline_componentStack_2419 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2466 = nextHydratableInstance; + var JSCompiler_object_inline_message_2416 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2466)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2416)) { c: { - var instance = JSCompiler_object_inline_message_2466; + var instance = JSCompiler_object_inline_message_2416; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9233,19 +9243,19 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2466 + JSCompiler_object_inline_message_2416 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2466 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2416 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2466 && - ((JSCompiler_object_inline_message_2466 = - JSCompiler_object_inline_message_2466.dehydrated), - null !== JSCompiler_object_inline_message_2466) + null !== JSCompiler_object_inline_message_2416 && + ((JSCompiler_object_inline_message_2416 = + JSCompiler_object_inline_message_2416.dehydrated), + null !== JSCompiler_object_inline_message_2416) ) return ( - JSCompiler_object_inline_message_2466.data === + JSCompiler_object_inline_message_2416.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -9253,27 +9263,27 @@ __DEV__ && ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2466 = - JSCompiler_object_inline_stack_2468.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2468.fallback; - if (JSCompiler_object_inline_componentStack_2469) + JSCompiler_object_inline_message_2416 = + JSCompiler_object_inline_stack_2418.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2418.fallback; + if (JSCompiler_object_inline_componentStack_2419) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2468 = + (JSCompiler_object_inline_stack_2418 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2466, + JSCompiler_object_inline_message_2416, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2469 = + (JSCompiler_object_inline_componentStack_2419 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2469.memoizedState = + (JSCompiler_object_inline_componentStack_2419.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2469.childLanes = + (JSCompiler_object_inline_componentStack_2419.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2467, + JSCompiler_object_inline_digest_2417, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9286,9 +9296,9 @@ __DEV__ && ? markerInstanceStack.current : null), (current = - JSCompiler_object_inline_componentStack_2469.updateQueue), + JSCompiler_object_inline_componentStack_2419.updateQueue), null === current - ? (JSCompiler_object_inline_componentStack_2469.updateQueue = + ? (JSCompiler_object_inline_componentStack_2419.updateQueue = { transitions: workInProgress, markerInstances: renderLanes, @@ -9296,46 +9306,46 @@ __DEV__ && }) : ((current.transitions = workInProgress), (current.markerInstances = renderLanes)))), - JSCompiler_object_inline_stack_2468 + JSCompiler_object_inline_stack_2418 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2468.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2418.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2468 = + (JSCompiler_object_inline_stack_2418 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2466, + JSCompiler_object_inline_message_2416, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2469 = + (JSCompiler_object_inline_componentStack_2419 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2469.memoizedState = + (JSCompiler_object_inline_componentStack_2419.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2469.childLanes = + (JSCompiler_object_inline_componentStack_2419.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2467, + JSCompiler_object_inline_digest_2417, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2468 + JSCompiler_object_inline_stack_2418 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2466 + JSCompiler_object_inline_message_2416 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2466 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2466) + ((JSCompiler_object_inline_message_2416 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2416) ) { if (didSuspend) workInProgress.flags & 256 @@ -9352,32 +9362,32 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2469 = - JSCompiler_object_inline_stack_2468.fallback), - (JSCompiler_object_inline_message_2466 = workInProgress.mode), - (JSCompiler_object_inline_stack_2468 = createFiberFromOffscreen( + (JSCompiler_object_inline_componentStack_2419 = + JSCompiler_object_inline_stack_2418.fallback), + (JSCompiler_object_inline_message_2416 = workInProgress.mode), + (JSCompiler_object_inline_stack_2418 = createFiberFromOffscreen( { mode: "visible", - children: JSCompiler_object_inline_stack_2468.children + children: JSCompiler_object_inline_stack_2418.children }, - JSCompiler_object_inline_message_2466, + JSCompiler_object_inline_message_2416, 0, null )), - (JSCompiler_object_inline_componentStack_2469 = + (JSCompiler_object_inline_componentStack_2419 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2469, - JSCompiler_object_inline_message_2466, + JSCompiler_object_inline_componentStack_2419, + JSCompiler_object_inline_message_2416, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2469.flags |= 2), - (JSCompiler_object_inline_stack_2468.return = workInProgress), - (JSCompiler_object_inline_componentStack_2469.return = + (JSCompiler_object_inline_componentStack_2419.flags |= 2), + (JSCompiler_object_inline_stack_2418.return = workInProgress), + (JSCompiler_object_inline_componentStack_2419.return = workInProgress), - (JSCompiler_object_inline_stack_2468.sibling = - JSCompiler_object_inline_componentStack_2469), - (workInProgress.child = JSCompiler_object_inline_stack_2468), + (JSCompiler_object_inline_stack_2418.sibling = + JSCompiler_object_inline_componentStack_2419), + (workInProgress.child = JSCompiler_object_inline_stack_2418), (disableLegacyMode || (workInProgress.mode & ConcurrentMode) !== NoMode) && reconcileChildFibers( @@ -9386,63 +9396,63 @@ __DEV__ && null, renderLanes ), - (JSCompiler_object_inline_stack_2468 = workInProgress.child), - (JSCompiler_object_inline_stack_2468.memoizedState = + (JSCompiler_object_inline_stack_2418 = workInProgress.child), + (JSCompiler_object_inline_stack_2418.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2468.childLanes = + (JSCompiler_object_inline_stack_2418.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2467, + JSCompiler_object_inline_digest_2417, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2469)); + JSCompiler_object_inline_componentStack_2419)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2466.data === + JSCompiler_object_inline_message_2416.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2467 = - JSCompiler_object_inline_message_2466.nextSibling && - JSCompiler_object_inline_message_2466.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2467) { - JSCompiler_temp = JSCompiler_object_inline_digest_2467.dgst; - var message = JSCompiler_object_inline_digest_2467.msg; - instance = JSCompiler_object_inline_digest_2467.stck; - var componentStack = JSCompiler_object_inline_digest_2467.cstck; + JSCompiler_object_inline_digest_2417 = + JSCompiler_object_inline_message_2416.nextSibling && + JSCompiler_object_inline_message_2416.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2417) { + JSCompiler_temp = JSCompiler_object_inline_digest_2417.dgst; + var message = JSCompiler_object_inline_digest_2417.msg; + instance = JSCompiler_object_inline_digest_2417.stck; + var componentStack = JSCompiler_object_inline_digest_2417.cstck; } - JSCompiler_object_inline_message_2466 = message; - JSCompiler_object_inline_digest_2467 = JSCompiler_temp; - JSCompiler_object_inline_stack_2468 = instance; - JSCompiler_object_inline_componentStack_2469 = componentStack; - JSCompiler_object_inline_message_2466 = - JSCompiler_object_inline_message_2466 - ? Error(JSCompiler_object_inline_message_2466) + JSCompiler_object_inline_message_2416 = message; + JSCompiler_object_inline_digest_2417 = JSCompiler_temp; + JSCompiler_object_inline_stack_2418 = instance; + JSCompiler_object_inline_componentStack_2419 = componentStack; + JSCompiler_object_inline_message_2416 = + JSCompiler_object_inline_message_2416 + ? Error(JSCompiler_object_inline_message_2416) : 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_2466.stack = - JSCompiler_object_inline_stack_2468 || ""; - JSCompiler_object_inline_message_2466.digest = - JSCompiler_object_inline_digest_2467; - JSCompiler_object_inline_digest_2467 = - void 0 === JSCompiler_object_inline_componentStack_2469 + JSCompiler_object_inline_message_2416.stack = + JSCompiler_object_inline_stack_2418 || ""; + JSCompiler_object_inline_message_2416.digest = + JSCompiler_object_inline_digest_2417; + JSCompiler_object_inline_digest_2417 = + void 0 === JSCompiler_object_inline_componentStack_2419 ? null - : JSCompiler_object_inline_componentStack_2469; - "string" === typeof JSCompiler_object_inline_digest_2467 && + : JSCompiler_object_inline_componentStack_2419; + "string" === typeof JSCompiler_object_inline_digest_2417 && CapturedStacks.set( - JSCompiler_object_inline_message_2466, - JSCompiler_object_inline_digest_2467 + JSCompiler_object_inline_message_2416, + JSCompiler_object_inline_digest_2417 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2466, + value: JSCompiler_object_inline_message_2416, source: null, - stack: JSCompiler_object_inline_digest_2467 + stack: JSCompiler_object_inline_digest_2417 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9457,25 +9467,25 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2467 = + (JSCompiler_object_inline_digest_2417 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2467) + didReceiveUpdate || JSCompiler_object_inline_digest_2417) ) { - JSCompiler_object_inline_digest_2467 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2467) { - JSCompiler_object_inline_stack_2468 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2468 & 42)) - JSCompiler_object_inline_stack_2468 = 1; + JSCompiler_object_inline_digest_2417 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2417) { + JSCompiler_object_inline_stack_2418 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2418 & 42)) + JSCompiler_object_inline_stack_2418 = 1; else - switch (JSCompiler_object_inline_stack_2468) { + switch (JSCompiler_object_inline_stack_2418) { case 2: - JSCompiler_object_inline_stack_2468 = 1; + JSCompiler_object_inline_stack_2418 = 1; break; case 8: - JSCompiler_object_inline_stack_2468 = 4; + JSCompiler_object_inline_stack_2418 = 4; break; case 32: - JSCompiler_object_inline_stack_2468 = 16; + JSCompiler_object_inline_stack_2418 = 16; break; case 128: case 256: @@ -9496,40 +9506,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2468 = 64; + JSCompiler_object_inline_stack_2418 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2468 = 134217728; + JSCompiler_object_inline_stack_2418 = 134217728; break; default: - JSCompiler_object_inline_stack_2468 = 0; + JSCompiler_object_inline_stack_2418 = 0; } - JSCompiler_object_inline_stack_2468 = + JSCompiler_object_inline_stack_2418 = 0 !== - (JSCompiler_object_inline_stack_2468 & - (JSCompiler_object_inline_digest_2467.suspendedLanes | + (JSCompiler_object_inline_stack_2418 & + (JSCompiler_object_inline_digest_2417.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2468; + : JSCompiler_object_inline_stack_2418; if ( - 0 !== JSCompiler_object_inline_stack_2468 && - JSCompiler_object_inline_stack_2468 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2418 && + JSCompiler_object_inline_stack_2418 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2468), + ((prevState.retryLane = JSCompiler_object_inline_stack_2418), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2468 + JSCompiler_object_inline_stack_2418 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2467, + JSCompiler_object_inline_digest_2417, current, - JSCompiler_object_inline_stack_2468 + JSCompiler_object_inline_stack_2418 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2466.data === + JSCompiler_object_inline_message_2416.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9537,7 +9547,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2466.data === + JSCompiler_object_inline_message_2416.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9545,12 +9555,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2466._reactRetry = + (JSCompiler_object_inline_message_2416._reactRetry = workInProgress), (workInProgress = null)) : ((renderLanes = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2466.nextSibling + JSCompiler_object_inline_message_2416.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9568,73 +9578,73 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2468.children + JSCompiler_object_inline_stack_2418.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2469) + if (JSCompiler_object_inline_componentStack_2419) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2469 = - JSCompiler_object_inline_stack_2468.fallback), - (JSCompiler_object_inline_message_2466 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2419 = + JSCompiler_object_inline_stack_2418.fallback), + (JSCompiler_object_inline_message_2416 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), (componentStack = { mode: "hidden", - children: JSCompiler_object_inline_stack_2468.children + children: JSCompiler_object_inline_stack_2418.children }), disableLegacyMode || - (JSCompiler_object_inline_message_2466 & ConcurrentMode) !== NoMode || + (JSCompiler_object_inline_message_2416 & ConcurrentMode) !== NoMode || workInProgress.child === JSCompiler_temp - ? ((JSCompiler_object_inline_stack_2468 = createWorkInProgress( + ? ((JSCompiler_object_inline_stack_2418 = createWorkInProgress( JSCompiler_temp, componentStack )), - (JSCompiler_object_inline_stack_2468.subtreeFlags = + (JSCompiler_object_inline_stack_2418.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)) - : ((JSCompiler_object_inline_stack_2468 = workInProgress.child), - (JSCompiler_object_inline_stack_2468.childLanes = 0), - (JSCompiler_object_inline_stack_2468.pendingProps = + : ((JSCompiler_object_inline_stack_2418 = workInProgress.child), + (JSCompiler_object_inline_stack_2418.childLanes = 0), + (JSCompiler_object_inline_stack_2418.pendingProps = componentStack), workInProgress.mode & ProfileMode && - ((JSCompiler_object_inline_stack_2468.actualDuration = 0), - (JSCompiler_object_inline_stack_2468.actualStartTime = -1), - (JSCompiler_object_inline_stack_2468.selfBaseDuration = + ((JSCompiler_object_inline_stack_2418.actualDuration = 0), + (JSCompiler_object_inline_stack_2418.actualStartTime = -1), + (JSCompiler_object_inline_stack_2418.selfBaseDuration = JSCompiler_temp.selfBaseDuration), - (JSCompiler_object_inline_stack_2468.treeBaseDuration = + (JSCompiler_object_inline_stack_2418.treeBaseDuration = JSCompiler_temp.treeBaseDuration)), (workInProgress.deletions = null)), null !== instance - ? (JSCompiler_object_inline_componentStack_2469 = + ? (JSCompiler_object_inline_componentStack_2419 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2469 + JSCompiler_object_inline_componentStack_2419 )) - : ((JSCompiler_object_inline_componentStack_2469 = + : ((JSCompiler_object_inline_componentStack_2419 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2469, - JSCompiler_object_inline_message_2466, + JSCompiler_object_inline_componentStack_2419, + JSCompiler_object_inline_message_2416, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2469.flags |= 2)), - (JSCompiler_object_inline_componentStack_2469.return = + (JSCompiler_object_inline_componentStack_2419.flags |= 2)), + (JSCompiler_object_inline_componentStack_2419.return = workInProgress), - (JSCompiler_object_inline_stack_2468.return = workInProgress), - (JSCompiler_object_inline_stack_2468.sibling = - JSCompiler_object_inline_componentStack_2469), - (workInProgress.child = JSCompiler_object_inline_stack_2468), - (JSCompiler_object_inline_stack_2468 = - JSCompiler_object_inline_componentStack_2469), - (JSCompiler_object_inline_componentStack_2469 = workInProgress.child), - (JSCompiler_object_inline_message_2466 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2466 - ? (JSCompiler_object_inline_message_2466 = + (JSCompiler_object_inline_stack_2418.return = workInProgress), + (JSCompiler_object_inline_stack_2418.sibling = + JSCompiler_object_inline_componentStack_2419), + (workInProgress.child = JSCompiler_object_inline_stack_2418), + (JSCompiler_object_inline_stack_2418 = + JSCompiler_object_inline_componentStack_2419), + (JSCompiler_object_inline_componentStack_2419 = workInProgress.child), + (JSCompiler_object_inline_message_2416 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2416 + ? (JSCompiler_object_inline_message_2416 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2466.cachePool), + JSCompiler_object_inline_message_2416.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9642,34 +9652,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2466 = { + (JSCompiler_object_inline_message_2416 = { baseLanes: - JSCompiler_object_inline_message_2466.baseLanes | renderLanes, + JSCompiler_object_inline_message_2416.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2469.memoizedState = - JSCompiler_object_inline_message_2466), + (JSCompiler_object_inline_componentStack_2419.memoizedState = + JSCompiler_object_inline_message_2416), enableTransitionTracing && - ((JSCompiler_object_inline_message_2466 = enableTransitionTracing + ((JSCompiler_object_inline_message_2416 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2466 && + null !== JSCompiler_object_inline_message_2416 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2469.updateQueue), + JSCompiler_object_inline_componentStack_2419.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2469.updateQueue = { - transitions: JSCompiler_object_inline_message_2466, + ? (JSCompiler_object_inline_componentStack_2419.updateQueue = { + transitions: JSCompiler_object_inline_message_2416, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2469.updateQueue = + ? (JSCompiler_object_inline_componentStack_2419.updateQueue = { - transitions: JSCompiler_object_inline_message_2466, + transitions: JSCompiler_object_inline_message_2416, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9677,41 +9687,41 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2466), + JSCompiler_object_inline_message_2416), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2469.childLanes = + (JSCompiler_object_inline_componentStack_2419.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2467, + JSCompiler_object_inline_digest_2417, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2468 + JSCompiler_object_inline_stack_2418 ); pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_object_inline_digest_2467 = current.child; - current = JSCompiler_object_inline_digest_2467.sibling; - JSCompiler_object_inline_digest_2467 = createWorkInProgress( - JSCompiler_object_inline_digest_2467, + JSCompiler_object_inline_digest_2417 = current.child; + current = JSCompiler_object_inline_digest_2417.sibling; + JSCompiler_object_inline_digest_2417 = createWorkInProgress( + JSCompiler_object_inline_digest_2417, { mode: "visible", - children: JSCompiler_object_inline_stack_2468.children + children: JSCompiler_object_inline_stack_2418.children } ); disableLegacyMode || (workInProgress.mode & ConcurrentMode) !== NoMode || - (JSCompiler_object_inline_digest_2467.lanes = renderLanes); - JSCompiler_object_inline_digest_2467.return = workInProgress; - JSCompiler_object_inline_digest_2467.sibling = null; + (JSCompiler_object_inline_digest_2417.lanes = renderLanes); + JSCompiler_object_inline_digest_2417.return = workInProgress; + JSCompiler_object_inline_digest_2417.sibling = null; null !== current && ((renderLanes = workInProgress.deletions), null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) : renderLanes.push(current)); - workInProgress.child = JSCompiler_object_inline_digest_2467; + workInProgress.child = JSCompiler_object_inline_digest_2417; workInProgress.memoizedState = null; - return JSCompiler_object_inline_digest_2467; + return JSCompiler_object_inline_digest_2417; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { primaryChildren = createFiberFromOffscreen( @@ -12340,7 +12350,11 @@ __DEV__ && (lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -12376,8 +12390,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -12419,7 +12440,13 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -12468,7 +12495,12 @@ __DEV__ && function commitClassDidMount(finishedWork) { var instance = finishedWork.stateNode; "function" === typeof instance.componentDidMount && - callComponentDidMountInDEV(finishedWork, instance); + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + instance + ); } function commitClassCallbacks(finishedWork) { var updateQueue = finishedWork.updateQueue; @@ -12488,12 +12520,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -12507,50 +12592,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -12563,11 +12655,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -12579,16 +12672,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -12597,27 +12713,14 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } @@ -12627,27 +12730,29 @@ __DEV__ && 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); - } + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); } catch (error$21) { captureCommitPhaseError(finishedWork, finishedWork.return, error$21); } } function commitHostUpdate(finishedWork, newProps, oldProps) { try { - var domElement = finishedWork.stateNode; - updateProperties(domElement, finishedWork.type, oldProps, newProps); - domElement[internalPropsKey] = newProps; + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); } catch (error$22) { captureCommitPhaseError(finishedWork, finishedWork.return, error$22); } @@ -12724,6 +12829,50 @@ __DEV__ && 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." + ); + } + } + } function shouldProfile(current) { return ( (current.mode & ProfileMode) !== NoMode && @@ -12819,23 +12968,82 @@ __DEV__ && ) (anchorOffset = root[JSCompiler_temp]), doesFiberContain(anchorOffset, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - anchorOffset - ), - (_enabled = !1)); + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(anchorOffset)); root = firstChild.child; if (0 !== (firstChild.subtreeFlags & 9236) && null !== root) (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + if ( + (focusNode = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((focusNode = 13 === root.tag)) + a: { + if ( + null !== JSCompiler_temp && + ((focusNode = JSCompiler_temp.memoizedState), + null === focusNode || null !== focusNode.dehydrated) + ) { + focusNode = root.memoizedState; + focusNode = + null !== focusNode && null === focusNode.dehydrated; + break a; + } + focusNode = !1; + } + focusNode = + focusNode && doesFiberContain(root, focusedInstanceHandle); + } + focusNode && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(root)); + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.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: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; + case 3: + 0 !== (anchorOffset & 1024) && + clearContainer(root.stateNode.containerInfo); + 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; @@ -12850,115 +13058,6 @@ __DEV__ && focusedInstanceHandle = null; return firstChild; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - finishedWork - ), - (_enabled = !1)); - } - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (var ii = 0; ii < finishedWork.length; ii++) - (current = finishedWork[ii]), - (current.ref.impl = current.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - JSCompiler_temp = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 { - (ii = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (flags = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== ii || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = ii); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - 0 !== (flags & 1024) && - clearContainer(finishedWork.stateNode.containerInfo); - 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 commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) switch (finishedWork.tag) { @@ -12991,97 +13090,95 @@ __DEV__ && } } } - 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -13097,7 +13194,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -13108,29 +13210,17 @@ __DEV__ && } 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 - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -13152,11 +13242,7 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; @@ -13165,15 +13251,18 @@ __DEV__ && disableLegacyMode || (finishedWork.mode & ConcurrentMode) !== NoMode ) { - var newOffscreenSubtreeIsHidden = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || + offscreenSubtreeIsHidden), + !prevProps) + ) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -13181,31 +13270,18 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } - } else - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -13487,24 +13563,25 @@ __DEV__ && offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParentIsContainer = hostParent; - var _prevHostParentIsContainer = hostParentIsContainer; + prevHostParent = hostParent; + prevHostParentIsContainer = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParentIsContainer; - hostParentIsContainer = _prevHostParentIsContainer; + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; if (null !== hostParent) if (hostParentIsContainer) try { - (finishedRoot = hostParent), - (prevHostParent = deletedFiber.stateNode), - finishedRoot.nodeType === COMMENT_NODE - ? finishedRoot.parentNode.removeChild(prevHostParent) - : finishedRoot.removeChild(prevHostParent); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -13514,7 +13591,12 @@ __DEV__ && } else try { - hostParent.removeChild(deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -13527,8 +13609,8 @@ __DEV__ && finishedRoot = finishedRoot.hydrationCallbacks; if (null !== finishedRoot) try { - (prevHostParentIsContainer = finishedRoot.onDeleted) && - prevHostParentIsContainer(deletedFiber.stateNode); + (prevHostParent = finishedRoot.onDeleted) && + prevHostParent(deletedFiber.stateNode); } catch (error$33) { captureCommitPhaseError( deletedFiber, @@ -13576,31 +13658,37 @@ __DEV__ && ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - _prevHostParentIsContainer = prevHostParentIsContainer.tag; - var inst = prevHostParentIsContainer.inst, + var tag = prevHostParentIsContainer.tag, + inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - ((_prevHostParentIsContainer & Insertion) !== NoFlags + ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy )) - : (_prevHostParentIsContainer & Layout) !== NoFlags && + : (tag & Layout) !== NoFlags && (enableSchedulingProfiler && markComponentLayoutEffectUnmountStarted(deletedFiber), 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 @@ -13676,7 +13764,11 @@ __DEV__ && ((current = current.dehydrated), null !== current)) ) { try { - retryIfBlockedOn(current); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + current + ); } catch (error$31) { captureCommitPhaseError( finishedWork, @@ -13770,20 +13862,10 @@ __DEV__ && 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++) { @@ -13823,16 +13905,10 @@ __DEV__ && } 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) { @@ -13840,7 +13916,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -13864,7 +13940,7 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13881,7 +13957,7 @@ __DEV__ && break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13921,15 +13997,16 @@ __DEV__ && flags = currentResource; break a; case "link": - var maybeNodes = getHydratableHoistableCache( - "link", - "href", - hoistableRoot - ).get(flags + (current.href || "")); - if (maybeNodes) - for (var i = 0; i < maybeNodes.length; i++) + if ( + (root = getHydratableHoistableCache( + "link", + "href", + hoistableRoot + ).get(flags + (current.href || ""))) + ) + for (var i = 0; i < root.length; i++) if ( - ((currentResource = maybeNodes[i]), + ((currentResource = root[i]), currentResource.getAttribute("href") === (null == current.href ? null : current.href) && currentResource.getAttribute("rel") === @@ -13943,7 +14020,7 @@ __DEV__ && ? null : current.crossOrigin)) ) { - maybeNodes.splice(i, 1); + root.splice(i, 1); break b; } currentResource = hoistableRoot.createElement(flags); @@ -13952,15 +14029,15 @@ __DEV__ && break; case "meta": if ( - (maybeNodes = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < maybeNodes.length; i++) + for (i = 0; i < root.length; i++) if ( - ((currentResource = maybeNodes[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" @@ -13986,7 +14063,7 @@ __DEV__ && ? null : current.charSet)) ) { - maybeNodes.splice(i, 1); + root.splice(i, 1); break b; } currentResource = hoistableRoot.createElement(flags); @@ -14049,48 +14126,27 @@ __DEV__ && hoistableRoot = finishedWork.stateNode; currentResource = finishedWork.memoizedProps; try { - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || + 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" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; } - var type = finishedWork.type; - if (getInstanceFromNode(hoistableRoot)) { - var tagName = hoistableRoot.tagName.toLowerCase(); - error$jscomp$0( - "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: - error$jscomp$0( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); - } - for ( - var attributes = hoistableRoot.attributes; - attributes.length; - - ) - hoistableRoot.removeAttributeNode(attributes[0]); - setInitialProperties(hoistableRoot, type, currentResource); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = currentResource; + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); } catch (error$32) { captureCommitPhaseError( finishedWork, @@ -14100,7 +14156,7 @@ __DEV__ && } } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -14108,7 +14164,7 @@ __DEV__ && if (finishedWork.flags & 32) { hoistableRoot = finishedWork.stateNode; try { - setTextContent(hoistableRoot, ""); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); } catch (error$24) { captureCommitPhaseError( finishedWork, @@ -14133,7 +14189,7 @@ __DEV__ && )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) @@ -14141,9 +14197,16 @@ __DEV__ && "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); flags = finishedWork.memoizedProps; - current = finishedWork.stateNode; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - current.nodeValue = flags; + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + hoistableRoot, + current, + flags + ); } catch (error$23) { captureCommitPhaseError( finishedWork, @@ -14157,7 +14220,7 @@ __DEV__ && tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -14166,7 +14229,11 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); } catch (error$30) { captureCommitPhaseError( finishedWork, @@ -14182,12 +14249,12 @@ __DEV__ && 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 && ((hoistableRoot = null !== finishedWork.memoizedState), @@ -14227,17 +14294,17 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - node = null !== finishedWork.memoizedState; + i = null !== finishedWork.memoizedState; nextNode = null !== current && null !== current.memoizedState; disableLegacyMode || finishedWork.mode & ConcurrentMode ? ((nodeName = offscreenSubtreeIsHidden), - (type = offscreenSubtreeWasHidden), - (offscreenSubtreeIsHidden = nodeName || node), - (offscreenSubtreeWasHidden = type || nextNode), - recursivelyTraverseMutationEffects(root, finishedWork, lanes), - (offscreenSubtreeWasHidden = type), + (suspenseCallback = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = nodeName || i), + (offscreenSubtreeWasHidden = suspenseCallback || nextNode), + recursivelyTraverseMutationEffects(root, finishedWork), + (offscreenSubtreeWasHidden = suspenseCallback), (offscreenSubtreeIsHidden = nodeName)) - : recursivelyTraverseMutationEffects(root, finishedWork, lanes); + : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -14245,10 +14312,10 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = node + ((root._visibility = i ? root._visibility & -2 : root._visibility | 1), - node && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || nextNode || @@ -14262,42 +14329,52 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - lanes = current = root; + nextNode = current = root; try { - if (((hoistableRoot = lanes.stateNode), node)) - (currentResource = hoistableRoot.style), - "function" === typeof currentResource.setProperty - ? currentResource.setProperty( - "display", - "none", - "important" - ) - : (currentResource.display = "none"); - else { - maybeNodes = lanes.stateNode; - i = lanes.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(); - } + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + nextNode, + nextNode.return, + error$25 + ); } } } else if (6 === root.tag) { if (null === current) { - lanes = root; + nextNode = root; try { - lanes.stateNode.nodeValue = node ? "" : lanes.memoizedProps; + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); } catch (error$26) { - captureCommitPhaseError(lanes, lanes.return, error$26); + captureCommitPhaseError( + nextNode, + nextNode.return, + error$26 + ); } } } else if ( @@ -14330,7 +14407,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -14339,7 +14416,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -14349,7 +14426,7 @@ __DEV__ && (finishedWork.stateNode[internalInstanceKey] = finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -14357,52 +14434,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - 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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -14422,27 +14454,13 @@ __DEV__ && 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) { @@ -14526,18 +14544,16 @@ __DEV__ && includeWorkInProgressEffects ); commitClassDidMount(finishedWork); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error$14) { captureCommitPhaseError( finishedWork, @@ -14634,9 +14650,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -14718,21 +14732,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -14741,9 +14740,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -14867,9 +14864,7 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & ConcurrentMode ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((nextCache._visibility |= 4), recursivelyTraversePassiveMountEffects( @@ -14941,9 +14936,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -15003,9 +14996,7 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & ConcurrentMode ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( @@ -15068,70 +15059,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -15208,11 +15175,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -15256,7 +15219,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -15283,116 +15246,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - if (null !== sibling) { - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, + current, instance, offscreenFiber, null, - !1 - ))); + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function invokeLayoutEffectMountInDEV(fiber) { @@ -16896,8 +16850,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (lanes = 0; lanes < transitions.length; lanes++) @@ -21910,6 +21864,14 @@ __DEV__ && ? HostContextNamespaceNone : parentNamespace; } + function beforeActiveInstanceBlur(internalInstanceHandle) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("beforeblur", !0); + event._detachedInterceptFiber = internalInstanceHandle; + target.dispatchEvent(event); + _enabled = !1; + } function shouldSetTextContent(type, props) { return ( "textarea" === type || @@ -21941,21 +21903,48 @@ __DEV__ && 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 createEvent(type, bubbles) { var event = document.createEvent("Event"); event.initEvent(type, bubbles, !1); return event; } - function dispatchBeforeDetachedBlur(target, internalInstanceHandle) { - var event = createEvent("beforeblur", !0); - event._detachedInterceptFiber = internalInstanceHandle; - target.dispatchEvent(event); - } function dispatchAfterDetachedBlur(target) { var event = createEvent("afterblur", !1); event.relatedTarget = target; document.dispatchEvent(event); } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + container.nodeType === COMMENT_NODE + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -21979,6 +21968,27 @@ __DEV__ && } 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 clearContainer(container) { var nodeType = container.nodeType; if (nodeType === DOCUMENT_NODE) clearContainerSparingly(container); @@ -22193,6 +22203,12 @@ __DEV__ && } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function requestPostPaintCallback(callback) { localRequestAnimationFrame(function () { localRequestAnimationFrame(function (time) { @@ -22238,6 +22254,37 @@ __DEV__ && ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + error$jscomp$0( + "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: + error$jscomp$0( + "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() @@ -27648,11 +27695,11 @@ __DEV__ && : flushSyncErrorInBuildsThatSupportLegacyMode; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-classic-fe03c56d-20240905" !== isomorphicReactPackageVersion) + if ("19.0.0-www-classic-a03254bc-20240905" !== 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-www-classic-fe03c56d-20240905\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-classic-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27696,11 +27743,11 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.0.0-www-classic-fe03c56d-20240905", + version: "19.0.0-www-classic-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -28353,7 +28400,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-classic-fe03c56d-20240905"; + exports.version = "19.0.0-www-classic-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 0b3ea388e1..643c39f72f 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -4210,6 +4210,16 @@ __DEV__ && ); 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) @@ -8852,32 +8862,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2487; - var JSCompiler_object_inline_stack_2488 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2438; + var JSCompiler_object_inline_stack_2439 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2489 = !1; + var JSCompiler_object_inline_componentStack_2440 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2487 = didSuspend) || - (JSCompiler_object_inline_digest_2487 = + (JSCompiler_object_inline_digest_2438 = didSuspend) || + (JSCompiler_object_inline_digest_2438 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2487 && - ((JSCompiler_object_inline_componentStack_2489 = !0), + JSCompiler_object_inline_digest_2438 && + ((JSCompiler_object_inline_componentStack_2440 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2487 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2438 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2489 + JSCompiler_object_inline_componentStack_2440 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2486 = nextHydratableInstance; + var JSCompiler_object_inline_message_2437 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2486)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2437)) { c: { - var instance = JSCompiler_object_inline_message_2486; + var instance = JSCompiler_object_inline_message_2437; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -8918,19 +8928,19 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2486 + JSCompiler_object_inline_message_2437 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2486 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2437 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2486 && - ((JSCompiler_object_inline_message_2486 = - JSCompiler_object_inline_message_2486.dehydrated), - null !== JSCompiler_object_inline_message_2486) + null !== JSCompiler_object_inline_message_2437 && + ((JSCompiler_object_inline_message_2437 = + JSCompiler_object_inline_message_2437.dehydrated), + null !== JSCompiler_object_inline_message_2437) ) return ( - JSCompiler_object_inline_message_2486.data === + JSCompiler_object_inline_message_2437.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8938,27 +8948,27 @@ __DEV__ && ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2486 = - JSCompiler_object_inline_stack_2488.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2488.fallback; - if (JSCompiler_object_inline_componentStack_2489) + JSCompiler_object_inline_message_2437 = + JSCompiler_object_inline_stack_2439.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2439.fallback; + if (JSCompiler_object_inline_componentStack_2440) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2488 = + (JSCompiler_object_inline_stack_2439 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2486, + JSCompiler_object_inline_message_2437, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2489 = + (JSCompiler_object_inline_componentStack_2440 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2489.memoizedState = + (JSCompiler_object_inline_componentStack_2440.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2489.childLanes = + (JSCompiler_object_inline_componentStack_2440.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2487, + JSCompiler_object_inline_digest_2438, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -8971,9 +8981,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2489.updateQueue), + JSCompiler_object_inline_componentStack_2440.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2489.updateQueue = + ? (JSCompiler_object_inline_componentStack_2440.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -8981,46 +8991,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2488 + JSCompiler_object_inline_stack_2439 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2488.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2439.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2488 = + (JSCompiler_object_inline_stack_2439 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2486, + JSCompiler_object_inline_message_2437, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2489 = + (JSCompiler_object_inline_componentStack_2440 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2489.memoizedState = + (JSCompiler_object_inline_componentStack_2440.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2489.childLanes = + (JSCompiler_object_inline_componentStack_2440.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2487, + JSCompiler_object_inline_digest_2438, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2488 + JSCompiler_object_inline_stack_2439 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2486 + JSCompiler_object_inline_message_2437 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2486 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2486) + ((JSCompiler_object_inline_message_2437 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2437) ) { if (didSuspend) workInProgress.flags & 256 @@ -9037,94 +9047,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2489 = - JSCompiler_object_inline_stack_2488.fallback), - (JSCompiler_object_inline_message_2486 = workInProgress.mode), - (JSCompiler_object_inline_stack_2488 = + (JSCompiler_object_inline_componentStack_2440 = + JSCompiler_object_inline_stack_2439.fallback), + (JSCompiler_object_inline_message_2437 = workInProgress.mode), + (JSCompiler_object_inline_stack_2439 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2488.children + children: JSCompiler_object_inline_stack_2439.children }, - JSCompiler_object_inline_message_2486 + JSCompiler_object_inline_message_2437 )), - (JSCompiler_object_inline_componentStack_2489 = + (JSCompiler_object_inline_componentStack_2440 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2489, - JSCompiler_object_inline_message_2486, + JSCompiler_object_inline_componentStack_2440, + JSCompiler_object_inline_message_2437, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2489.flags |= 2), - (JSCompiler_object_inline_stack_2488.return = workInProgress), - (JSCompiler_object_inline_componentStack_2489.return = + (JSCompiler_object_inline_componentStack_2440.flags |= 2), + (JSCompiler_object_inline_stack_2439.return = workInProgress), + (JSCompiler_object_inline_componentStack_2440.return = workInProgress), - (JSCompiler_object_inline_stack_2488.sibling = - JSCompiler_object_inline_componentStack_2489), - (workInProgress.child = JSCompiler_object_inline_stack_2488), + (JSCompiler_object_inline_stack_2439.sibling = + JSCompiler_object_inline_componentStack_2440), + (workInProgress.child = JSCompiler_object_inline_stack_2439), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2488 = workInProgress.child), - (JSCompiler_object_inline_stack_2488.memoizedState = + (JSCompiler_object_inline_stack_2439 = workInProgress.child), + (JSCompiler_object_inline_stack_2439.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2488.childLanes = + (JSCompiler_object_inline_stack_2439.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2487, + JSCompiler_object_inline_digest_2438, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2489)); + JSCompiler_object_inline_componentStack_2440)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2486.data === + JSCompiler_object_inline_message_2437.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2487 = - JSCompiler_object_inline_message_2486.nextSibling && - JSCompiler_object_inline_message_2486.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2487) { - JSCompiler_temp = JSCompiler_object_inline_digest_2487.dgst; - var message = JSCompiler_object_inline_digest_2487.msg; - instance = JSCompiler_object_inline_digest_2487.stck; - var componentStack = JSCompiler_object_inline_digest_2487.cstck; + JSCompiler_object_inline_digest_2438 = + JSCompiler_object_inline_message_2437.nextSibling && + JSCompiler_object_inline_message_2437.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2438) { + JSCompiler_temp = JSCompiler_object_inline_digest_2438.dgst; + var message = JSCompiler_object_inline_digest_2438.msg; + instance = JSCompiler_object_inline_digest_2438.stck; + var componentStack = JSCompiler_object_inline_digest_2438.cstck; } - JSCompiler_object_inline_message_2486 = message; - JSCompiler_object_inline_digest_2487 = JSCompiler_temp; - JSCompiler_object_inline_stack_2488 = instance; - JSCompiler_object_inline_componentStack_2489 = componentStack; - JSCompiler_object_inline_message_2486 = - JSCompiler_object_inline_message_2486 - ? Error(JSCompiler_object_inline_message_2486) + JSCompiler_object_inline_message_2437 = message; + JSCompiler_object_inline_digest_2438 = JSCompiler_temp; + JSCompiler_object_inline_stack_2439 = instance; + JSCompiler_object_inline_componentStack_2440 = componentStack; + JSCompiler_object_inline_message_2437 = + JSCompiler_object_inline_message_2437 + ? Error(JSCompiler_object_inline_message_2437) : 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_2486.stack = - JSCompiler_object_inline_stack_2488 || ""; - JSCompiler_object_inline_message_2486.digest = - JSCompiler_object_inline_digest_2487; - JSCompiler_object_inline_digest_2487 = - void 0 === JSCompiler_object_inline_componentStack_2489 + JSCompiler_object_inline_message_2437.stack = + JSCompiler_object_inline_stack_2439 || ""; + JSCompiler_object_inline_message_2437.digest = + JSCompiler_object_inline_digest_2438; + JSCompiler_object_inline_digest_2438 = + void 0 === JSCompiler_object_inline_componentStack_2440 ? null - : JSCompiler_object_inline_componentStack_2489; - "string" === typeof JSCompiler_object_inline_digest_2487 && + : JSCompiler_object_inline_componentStack_2440; + "string" === typeof JSCompiler_object_inline_digest_2438 && CapturedStacks.set( - JSCompiler_object_inline_message_2486, - JSCompiler_object_inline_digest_2487 + JSCompiler_object_inline_message_2437, + JSCompiler_object_inline_digest_2438 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2486, + value: JSCompiler_object_inline_message_2437, source: null, - stack: JSCompiler_object_inline_digest_2487 + stack: JSCompiler_object_inline_digest_2438 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9139,25 +9149,25 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2487 = + (JSCompiler_object_inline_digest_2438 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2487) + didReceiveUpdate || JSCompiler_object_inline_digest_2438) ) { - JSCompiler_object_inline_digest_2487 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2487) { - JSCompiler_object_inline_stack_2488 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2488 & 42)) - JSCompiler_object_inline_stack_2488 = 1; + JSCompiler_object_inline_digest_2438 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2438) { + JSCompiler_object_inline_stack_2439 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2439 & 42)) + JSCompiler_object_inline_stack_2439 = 1; else - switch (JSCompiler_object_inline_stack_2488) { + switch (JSCompiler_object_inline_stack_2439) { case 2: - JSCompiler_object_inline_stack_2488 = 1; + JSCompiler_object_inline_stack_2439 = 1; break; case 8: - JSCompiler_object_inline_stack_2488 = 4; + JSCompiler_object_inline_stack_2439 = 4; break; case 32: - JSCompiler_object_inline_stack_2488 = 16; + JSCompiler_object_inline_stack_2439 = 16; break; case 128: case 256: @@ -9178,40 +9188,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2488 = 64; + JSCompiler_object_inline_stack_2439 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2488 = 134217728; + JSCompiler_object_inline_stack_2439 = 134217728; break; default: - JSCompiler_object_inline_stack_2488 = 0; + JSCompiler_object_inline_stack_2439 = 0; } - JSCompiler_object_inline_stack_2488 = + JSCompiler_object_inline_stack_2439 = 0 !== - (JSCompiler_object_inline_stack_2488 & - (JSCompiler_object_inline_digest_2487.suspendedLanes | + (JSCompiler_object_inline_stack_2439 & + (JSCompiler_object_inline_digest_2438.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2488; + : JSCompiler_object_inline_stack_2439; if ( - 0 !== JSCompiler_object_inline_stack_2488 && - JSCompiler_object_inline_stack_2488 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2439 && + JSCompiler_object_inline_stack_2439 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2488), + ((prevState.retryLane = JSCompiler_object_inline_stack_2439), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2488 + JSCompiler_object_inline_stack_2439 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2487, + JSCompiler_object_inline_digest_2438, current, - JSCompiler_object_inline_stack_2488 + JSCompiler_object_inline_stack_2439 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2486.data === + JSCompiler_object_inline_message_2437.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9219,7 +9229,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2486.data === + JSCompiler_object_inline_message_2437.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9227,12 +9237,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2486._reactRetry = + (JSCompiler_object_inline_message_2437._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2486.nextSibling + JSCompiler_object_inline_message_2437.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9250,57 +9260,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2488.children + JSCompiler_object_inline_stack_2439.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2489) + if (JSCompiler_object_inline_componentStack_2440) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2489 = - JSCompiler_object_inline_stack_2488.fallback), - (JSCompiler_object_inline_message_2486 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2440 = + JSCompiler_object_inline_stack_2439.fallback), + (JSCompiler_object_inline_message_2437 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2488 = createWorkInProgress( + (JSCompiler_object_inline_stack_2439 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2488.children + children: JSCompiler_object_inline_stack_2439.children } )), - (JSCompiler_object_inline_stack_2488.subtreeFlags = + (JSCompiler_object_inline_stack_2439.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2489 = + ? (JSCompiler_object_inline_componentStack_2440 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2489 + JSCompiler_object_inline_componentStack_2440 )) - : ((JSCompiler_object_inline_componentStack_2489 = + : ((JSCompiler_object_inline_componentStack_2440 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2489, - JSCompiler_object_inline_message_2486, + JSCompiler_object_inline_componentStack_2440, + JSCompiler_object_inline_message_2437, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2489.flags |= 2)), - (JSCompiler_object_inline_componentStack_2489.return = + (JSCompiler_object_inline_componentStack_2440.flags |= 2)), + (JSCompiler_object_inline_componentStack_2440.return = workInProgress), - (JSCompiler_object_inline_stack_2488.return = workInProgress), - (JSCompiler_object_inline_stack_2488.sibling = - JSCompiler_object_inline_componentStack_2489), - (workInProgress.child = JSCompiler_object_inline_stack_2488), - (JSCompiler_object_inline_stack_2488 = - JSCompiler_object_inline_componentStack_2489), - (JSCompiler_object_inline_componentStack_2489 = workInProgress.child), - (JSCompiler_object_inline_message_2486 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2486 - ? (JSCompiler_object_inline_message_2486 = + (JSCompiler_object_inline_stack_2439.return = workInProgress), + (JSCompiler_object_inline_stack_2439.sibling = + JSCompiler_object_inline_componentStack_2440), + (workInProgress.child = JSCompiler_object_inline_stack_2439), + (JSCompiler_object_inline_stack_2439 = + JSCompiler_object_inline_componentStack_2440), + (JSCompiler_object_inline_componentStack_2440 = workInProgress.child), + (JSCompiler_object_inline_message_2437 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2437 + ? (JSCompiler_object_inline_message_2437 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2486.cachePool), + JSCompiler_object_inline_message_2437.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9308,34 +9318,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2486 = { + (JSCompiler_object_inline_message_2437 = { baseLanes: - JSCompiler_object_inline_message_2486.baseLanes | renderLanes, + JSCompiler_object_inline_message_2437.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2489.memoizedState = - JSCompiler_object_inline_message_2486), + (JSCompiler_object_inline_componentStack_2440.memoizedState = + JSCompiler_object_inline_message_2437), enableTransitionTracing && - ((JSCompiler_object_inline_message_2486 = enableTransitionTracing + ((JSCompiler_object_inline_message_2437 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2486 && + null !== JSCompiler_object_inline_message_2437 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2489.updateQueue), + JSCompiler_object_inline_componentStack_2440.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2489.updateQueue = { - transitions: JSCompiler_object_inline_message_2486, + ? (JSCompiler_object_inline_componentStack_2440.updateQueue = { + transitions: JSCompiler_object_inline_message_2437, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2489.updateQueue = + ? (JSCompiler_object_inline_componentStack_2440.updateQueue = { - transitions: JSCompiler_object_inline_message_2486, + transitions: JSCompiler_object_inline_message_2437, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9343,32 +9353,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2486), + JSCompiler_object_inline_message_2437), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2489.childLanes = + (JSCompiler_object_inline_componentStack_2440.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2487, + JSCompiler_object_inline_digest_2438, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2488 + JSCompiler_object_inline_stack_2439 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2488.children + children: JSCompiler_object_inline_stack_2439.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2487 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2487 + ((JSCompiler_object_inline_digest_2438 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2438 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2487.push(current)); + : JSCompiler_object_inline_digest_2438.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11902,7 +11912,11 @@ __DEV__ && (lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -11938,8 +11952,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -11981,7 +12002,13 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -12045,12 +12072,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -12064,50 +12144,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -12120,11 +12207,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -12136,16 +12224,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -12154,27 +12265,14 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } @@ -12184,27 +12282,29 @@ __DEV__ && 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); - } + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); } catch (error$21) { captureCommitPhaseError(finishedWork, finishedWork.return, error$21); } } function commitHostUpdate(finishedWork, newProps, oldProps) { try { - var domElement = finishedWork.stateNode; - updateProperties(domElement, finishedWork.type, oldProps, newProps); - domElement[internalPropsKey] = newProps; + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); } catch (error$22) { captureCommitPhaseError(finishedWork, finishedWork.return, error$22); } @@ -12281,6 +12381,50 @@ __DEV__ && 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." + ); + } + } + } function shouldProfile(current) { return ( (current.mode & ProfileMode) !== NoMode && @@ -12376,23 +12520,97 @@ __DEV__ && ) (anchorOffset = root[JSCompiler_temp]), doesFiberContain(anchorOffset, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - anchorOffset - ), - (_enabled = !1)); + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(anchorOffset)); root = firstChild.child; if (0 !== (firstChild.subtreeFlags & 9236) && null !== root) (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + if ( + (focusNode = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((focusNode = 13 === root.tag)) + a: { + if ( + null !== JSCompiler_temp && + ((focusNode = JSCompiler_temp.memoizedState), + null === focusNode || null !== focusNode.dehydrated) + ) { + focusNode = root.memoizedState; + focusNode = + null !== focusNode && null === focusNode.dehydrated; + break a; + } + focusNode = !1; + } + focusNode = + focusNode && doesFiberContain(root, focusedInstanceHandle); + } + focusNode && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(root)); + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.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: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; + case 3: + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + JSCompiler_temp === DOCUMENT_NODE) + ) + 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; @@ -12407,130 +12625,6 @@ __DEV__ && focusedInstanceHandle = null; return firstChild; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - finishedWork - ), - (_enabled = !1)); - } - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (var ii = 0; ii < finishedWork.length; ii++) - (current = finishedWork[ii]), - (current.ref.impl = current.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - JSCompiler_temp = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 { - (ii = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (flags = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== ii || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = ii); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (ii = finishedWork.nodeType), - ii === DOCUMENT_NODE) - ) - clearContainerSparingly(finishedWork); - else if (1 === ii) - 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 commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) switch (finishedWork.tag) { @@ -12563,97 +12657,95 @@ __DEV__ && } } } - 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -12669,7 +12761,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -12680,29 +12777,17 @@ __DEV__ && } 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 - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -12724,24 +12809,20 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - var newOffscreenSubtreeIsHidden = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -12749,11 +12830,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -12763,11 +12840,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -13049,24 +13122,25 @@ __DEV__ && offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParentIsContainer = hostParent; - var _prevHostParentIsContainer = hostParentIsContainer; + prevHostParent = hostParent; + prevHostParentIsContainer = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParentIsContainer; - hostParentIsContainer = _prevHostParentIsContainer; + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; if (null !== hostParent) if (hostParentIsContainer) try { - (finishedRoot = hostParent), - (prevHostParent = deletedFiber.stateNode), - finishedRoot.nodeType === COMMENT_NODE - ? finishedRoot.parentNode.removeChild(prevHostParent) - : finishedRoot.removeChild(prevHostParent); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -13076,7 +13150,12 @@ __DEV__ && } else try { - hostParent.removeChild(deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -13089,8 +13168,8 @@ __DEV__ && finishedRoot = finishedRoot.hydrationCallbacks; if (null !== finishedRoot) try { - (prevHostParentIsContainer = finishedRoot.onDeleted) && - prevHostParentIsContainer(deletedFiber.stateNode); + (prevHostParent = finishedRoot.onDeleted) && + prevHostParent(deletedFiber.stateNode); } catch (error$33) { captureCommitPhaseError( deletedFiber, @@ -13138,31 +13217,37 @@ __DEV__ && ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - _prevHostParentIsContainer = prevHostParentIsContainer.tag; - var inst = prevHostParentIsContainer.inst, + var tag = prevHostParentIsContainer.tag, + inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - ((_prevHostParentIsContainer & Insertion) !== NoFlags + ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy )) - : (_prevHostParentIsContainer & Layout) !== NoFlags && + : (tag & Layout) !== NoFlags && (enableSchedulingProfiler && markComponentLayoutEffectUnmountStarted(deletedFiber), 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 @@ -13232,7 +13317,11 @@ __DEV__ && ((current = current.dehydrated), null !== current)) ) { try { - retryIfBlockedOn(current); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + current + ); } catch (error$31) { captureCommitPhaseError( finishedWork, @@ -13326,20 +13415,10 @@ __DEV__ && 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++) { @@ -13379,16 +13458,10 @@ __DEV__ && } 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) { @@ -13396,7 +13469,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -13420,7 +13493,7 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13437,7 +13510,7 @@ __DEV__ && break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13477,15 +13550,16 @@ __DEV__ && flags = currentResource; break a; case "link": - var maybeNodes = getHydratableHoistableCache( - "link", - "href", - hoistableRoot - ).get(flags + (current.href || "")); - if (maybeNodes) - for (var i = 0; i < maybeNodes.length; i++) + if ( + (root = getHydratableHoistableCache( + "link", + "href", + hoistableRoot + ).get(flags + (current.href || ""))) + ) + for (var i = 0; i < root.length; i++) if ( - ((currentResource = maybeNodes[i]), + ((currentResource = root[i]), currentResource.getAttribute("href") === (null == current.href ? null : current.href) && currentResource.getAttribute("rel") === @@ -13499,7 +13573,7 @@ __DEV__ && ? null : current.crossOrigin)) ) { - maybeNodes.splice(i, 1); + root.splice(i, 1); break b; } currentResource = hoistableRoot.createElement(flags); @@ -13508,15 +13582,15 @@ __DEV__ && break; case "meta": if ( - (maybeNodes = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < maybeNodes.length; i++) + for (i = 0; i < root.length; i++) if ( - ((currentResource = maybeNodes[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" @@ -13542,7 +13616,7 @@ __DEV__ && ? null : current.charSet)) ) { - maybeNodes.splice(i, 1); + root.splice(i, 1); break b; } currentResource = hoistableRoot.createElement(flags); @@ -13605,48 +13679,27 @@ __DEV__ && hoistableRoot = finishedWork.stateNode; currentResource = finishedWork.memoizedProps; try { - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || + 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" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; } - var type = finishedWork.type; - if (getInstanceFromNode(hoistableRoot)) { - var tagName = hoistableRoot.tagName.toLowerCase(); - error$jscomp$0( - "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: - error$jscomp$0( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); - } - for ( - var attributes = hoistableRoot.attributes; - attributes.length; - - ) - hoistableRoot.removeAttributeNode(attributes[0]); - setInitialProperties(hoistableRoot, type, currentResource); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = currentResource; + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); } catch (error$32) { captureCommitPhaseError( finishedWork, @@ -13656,7 +13709,7 @@ __DEV__ && } } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13664,7 +13717,7 @@ __DEV__ && if (finishedWork.flags & 32) { hoistableRoot = finishedWork.stateNode; try { - setTextContent(hoistableRoot, ""); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); } catch (error$24) { captureCommitPhaseError( finishedWork, @@ -13689,7 +13742,7 @@ __DEV__ && )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) @@ -13697,9 +13750,16 @@ __DEV__ && "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); flags = finishedWork.memoizedProps; - current = finishedWork.stateNode; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - current.nodeValue = flags; + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + hoistableRoot, + current, + flags + ); } catch (error$23) { captureCommitPhaseError( finishedWork, @@ -13713,7 +13773,7 @@ __DEV__ && tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -13722,7 +13782,11 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); } catch (error$30) { captureCommitPhaseError( finishedWork, @@ -13738,12 +13802,12 @@ __DEV__ && 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 && ((hoistableRoot = null !== finishedWork.memoizedState), @@ -13783,14 +13847,14 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - node = null !== finishedWork.memoizedState; + i = null !== finishedWork.memoizedState; nextNode = null !== current && null !== current.memoizedState; nodeName = offscreenSubtreeIsHidden; - type = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = nodeName || node; - offscreenSubtreeWasHidden = type || nextNode; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = type; + suspenseCallback = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = suspenseCallback || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); + offscreenSubtreeWasHidden = suspenseCallback; offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; @@ -13799,10 +13863,10 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = node + ((root._visibility = i ? root._visibility & -2 : root._visibility | 1), - node && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || nextNode || @@ -13814,42 +13878,52 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - lanes = current = root; + nextNode = current = root; try { - if (((hoistableRoot = lanes.stateNode), node)) - (currentResource = hoistableRoot.style), - "function" === typeof currentResource.setProperty - ? currentResource.setProperty( - "display", - "none", - "important" - ) - : (currentResource.display = "none"); - else { - maybeNodes = lanes.stateNode; - i = lanes.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(); - } + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + nextNode, + nextNode.return, + error$25 + ); } } } else if (6 === root.tag) { if (null === current) { - lanes = root; + nextNode = root; try { - lanes.stateNode.nodeValue = node ? "" : lanes.memoizedProps; + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); } catch (error$26) { - captureCommitPhaseError(lanes, lanes.return, error$26); + captureCommitPhaseError( + nextNode, + nextNode.return, + error$26 + ); } } } else if ( @@ -13882,7 +13956,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -13891,7 +13965,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -13901,7 +13975,7 @@ __DEV__ && (finishedWork.stateNode[internalInstanceKey] = finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -13909,52 +13983,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - 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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -13974,27 +14003,13 @@ __DEV__ && 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) { @@ -14079,19 +14094,22 @@ __DEV__ && ); current = finishedWork.stateNode; "function" === typeof current.componentDidMount && - callComponentDidMountInDEV(finishedWork, current); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error$14) { captureCommitPhaseError( finishedWork, @@ -14188,9 +14206,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -14272,21 +14288,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -14295,9 +14296,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -14420,9 +14419,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( @@ -14487,9 +14484,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -14548,9 +14543,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( @@ -14605,70 +14598,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -14745,11 +14714,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -14793,7 +14758,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -14820,116 +14785,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - if (null !== sibling) { - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, + current, instance, offscreenFiber, null, - !1 - ))); + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function onCommitRoot() { @@ -16356,8 +16312,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (lanes = 0; lanes < transitions.length; lanes++) @@ -21238,6 +21194,14 @@ __DEV__ && ? HostContextNamespaceNone : parentNamespace; } + function beforeActiveInstanceBlur(internalInstanceHandle) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("beforeblur", !0); + event._detachedInterceptFiber = internalInstanceHandle; + target.dispatchEvent(event); + _enabled = !1; + } function shouldSetTextContent(type, props) { return ( "textarea" === type || @@ -21269,21 +21233,48 @@ __DEV__ && 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 createEvent(type, bubbles) { var event = document.createEvent("Event"); event.initEvent(type, bubbles, !1); return event; } - function dispatchBeforeDetachedBlur(target, internalInstanceHandle) { - var event = createEvent("beforeblur", !0); - event._detachedInterceptFiber = internalInstanceHandle; - target.dispatchEvent(event); - } function dispatchAfterDetachedBlur(target) { var event = createEvent("afterblur", !1); event.relatedTarget = target; document.dispatchEvent(event); } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + container.nodeType === COMMENT_NODE + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -21307,6 +21298,27 @@ __DEV__ && } 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); @@ -21507,6 +21519,12 @@ __DEV__ && } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function requestPostPaintCallback(callback) { localRequestAnimationFrame(function () { localRequestAnimationFrame(function (time) { @@ -21552,6 +21570,37 @@ __DEV__ && ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + error$jscomp$0( + "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: + error$jscomp$0( + "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() @@ -26763,11 +26812,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-modern-fe03c56d-20240905" !== isomorphicReactPackageVersion) + if ("19.0.0-www-modern-a03254bc-20240905" !== 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-www-modern-fe03c56d-20240905\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-modern-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26810,11 +26859,11 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.0.0-www-modern-fe03c56d-20240905", + version: "19.0.0-www-modern-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27419,7 +27468,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-modern-fe03c56d-20240905"; + exports.version = "19.0.0-www-modern-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index d378e55ce8..f1a8cdf4c5 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -8792,24 +8792,26 @@ function commitBeforeMutationEffects(root, firstChild) { break; case 1: if (0 !== (JSCompiler_temp & 1024) && null !== root) { - JSCompiler_temp = firstChild; - anchorOffset = root.memoizedProps; + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; root = root.memoizedState; - focusNode = JSCompiler_temp.stateNode; + selection = anchorOffset.stateNode; try { - var snapshot = focusNode.getSnapshotBeforeUpdate( - resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ), + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, root ); - focusNode.__reactInternalSnapshotBeforeUpdate = snapshot; + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; } catch (error) { captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, + anchorOffset, + anchorOffset.return, error ); } @@ -8839,10 +8841,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -17323,14 +17325,14 @@ function getCrossOriginStringAs(as, input) { } var isomorphicReactPackageVersion$jscomp$inline_1763 = React.version; if ( - "19.0.0-www-classic-fe03c56d-20240905" !== + "19.0.0-www-classic-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_1763 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1763, - "19.0.0-www-classic-fe03c56d-20240905" + "19.0.0-www-classic-a03254bc-20240905" ) ); function flushSyncFromReconciler(fn) { @@ -17375,11 +17377,11 @@ Internals.Events = [ ]; var internals$jscomp$inline_2257 = { bundleType: 0, - version: "19.0.0-www-classic-fe03c56d-20240905", + version: "19.0.0-www-classic-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2258 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17835,4 +17837,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-fe03c56d-20240905"; +exports.version = "19.0.0-www-classic-a03254bc-20240905"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 091598a6ba..07d550a83c 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -8360,24 +8360,26 @@ function commitBeforeMutationEffects(root, firstChild) { break; case 1: if (0 !== (JSCompiler_temp & 1024) && null !== root) { - JSCompiler_temp = firstChild; - anchorOffset = root.memoizedProps; + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; root = root.memoizedState; - focusNode = JSCompiler_temp.stateNode; + selection = anchorOffset.stateNode; try { - var snapshot = focusNode.getSnapshotBeforeUpdate( - resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ), + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, root ); - focusNode.__reactInternalSnapshotBeforeUpdate = snapshot; + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; } catch (error) { captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, + anchorOffset, + anchorOffset.return, error ); } @@ -8422,10 +8424,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -16699,14 +16701,14 @@ function getCrossOriginStringAs(as, input) { } var isomorphicReactPackageVersion$jscomp$inline_1734 = React.version; if ( - "19.0.0-www-modern-fe03c56d-20240905" !== + "19.0.0-www-modern-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_1734 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1734, - "19.0.0-www-modern-fe03c56d-20240905" + "19.0.0-www-modern-a03254bc-20240905" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -16724,11 +16726,11 @@ Internals.Events = [ ]; var internals$jscomp$inline_2248 = { bundleType: 0, - version: "19.0.0-www-modern-fe03c56d-20240905", + version: "19.0.0-www-modern-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2249 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17091,4 +17093,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-fe03c56d-20240905"; +exports.version = "19.0.0-www-modern-a03254bc-20240905"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 6578ead508..9f294440da 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -9246,24 +9246,26 @@ function commitBeforeMutationEffects(root, firstChild) { break; case 1: if (0 !== (JSCompiler_temp & 1024) && null !== root) { - JSCompiler_temp = firstChild; - anchorOffset = root.memoizedProps; + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; root = root.memoizedState; - focusNode = JSCompiler_temp.stateNode; + selection = anchorOffset.stateNode; try { - var snapshot = focusNode.getSnapshotBeforeUpdate( - resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ), + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, root ); - focusNode.__reactInternalSnapshotBeforeUpdate = snapshot; + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; } catch (error) { captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, + anchorOffset, + anchorOffset.return, error ); } @@ -9293,10 +9295,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & 4 && 0 !== (finishedWork.flags & 4)) @@ -14038,14 +14040,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$400; if (canUseDOM) { - var isSupported$jscomp$inline_1630 = "oninput" in document; - if (!isSupported$jscomp$inline_1630) { - var element$jscomp$inline_1631 = document.createElement("div"); - element$jscomp$inline_1631.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1630 = - "function" === typeof element$jscomp$inline_1631.oninput; + var isSupported$jscomp$inline_1639 = "oninput" in document; + if (!isSupported$jscomp$inline_1639) { + var element$jscomp$inline_1640 = document.createElement("div"); + element$jscomp$inline_1640.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1639 = + "function" === typeof element$jscomp$inline_1640.oninput; } - JSCompiler_inline_result$jscomp$400 = isSupported$jscomp$inline_1630; + JSCompiler_inline_result$jscomp$400 = isSupported$jscomp$inline_1639; } else JSCompiler_inline_result$jscomp$400 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$400 && @@ -14459,20 +14461,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1671 = 0; - i$jscomp$inline_1671 < simpleEventPluginEvents.length; - i$jscomp$inline_1671++ + var i$jscomp$inline_1680 = 0; + i$jscomp$inline_1680 < simpleEventPluginEvents.length; + i$jscomp$inline_1680++ ) { - var eventName$jscomp$inline_1672 = - simpleEventPluginEvents[i$jscomp$inline_1671], - domEventName$jscomp$inline_1673 = - eventName$jscomp$inline_1672.toLowerCase(), - capitalizedEvent$jscomp$inline_1674 = - eventName$jscomp$inline_1672[0].toUpperCase() + - eventName$jscomp$inline_1672.slice(1); + var eventName$jscomp$inline_1681 = + simpleEventPluginEvents[i$jscomp$inline_1680], + domEventName$jscomp$inline_1682 = + eventName$jscomp$inline_1681.toLowerCase(), + capitalizedEvent$jscomp$inline_1683 = + eventName$jscomp$inline_1681[0].toUpperCase() + + eventName$jscomp$inline_1681.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1673, - "on" + capitalizedEvent$jscomp$inline_1674 + domEventName$jscomp$inline_1682, + "on" + capitalizedEvent$jscomp$inline_1683 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -18081,16 +18083,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1844 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1853 = React.version; if ( - "19.0.0-www-classic-fe03c56d-20240905" !== - isomorphicReactPackageVersion$jscomp$inline_1844 + "19.0.0-www-classic-a03254bc-20240905" !== + isomorphicReactPackageVersion$jscomp$inline_1853 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1844, - "19.0.0-www-classic-fe03c56d-20240905" + isomorphicReactPackageVersion$jscomp$inline_1853, + "19.0.0-www-classic-a03254bc-20240905" ) ); function flushSyncFromReconciler(fn) { @@ -18133,28 +18135,28 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1851 = { +var internals$jscomp$inline_1860 = { bundleType: 0, - version: "19.0.0-www-classic-fe03c56d-20240905", + version: "19.0.0-www-classic-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1851.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1851.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1860.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1860.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2309 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2318 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2309.isDisabled && - hook$jscomp$inline_2309.supportsFiber + !hook$jscomp$inline_2318.isDisabled && + hook$jscomp$inline_2318.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2309.inject( - internals$jscomp$inline_1851 + (rendererID = hook$jscomp$inline_2318.inject( + internals$jscomp$inline_1860 )), - (injectedHook = hook$jscomp$inline_2309); + (injectedHook = hook$jscomp$inline_2318); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -18598,7 +18600,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-fe03c56d-20240905"; +exports.version = "19.0.0-www-classic-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index 7f7d459611..e0194b7e23 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -8797,24 +8797,26 @@ function commitBeforeMutationEffects(root, firstChild) { break; case 1: if (0 !== (JSCompiler_temp & 1024) && null !== root) { - JSCompiler_temp = firstChild; - anchorOffset = root.memoizedProps; + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; root = root.memoizedState; - focusNode = JSCompiler_temp.stateNode; + selection = anchorOffset.stateNode; try { - var snapshot = focusNode.getSnapshotBeforeUpdate( - resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ), + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, root ); - focusNode.__reactInternalSnapshotBeforeUpdate = snapshot; + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; } catch (error) { captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, + anchorOffset, + anchorOffset.return, error ); } @@ -8859,10 +8861,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & 4 && 0 !== (finishedWork.flags & 4)) @@ -13448,14 +13450,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$387; if (canUseDOM) { - var isSupported$jscomp$inline_1601 = "oninput" in document; - if (!isSupported$jscomp$inline_1601) { - var element$jscomp$inline_1602 = document.createElement("div"); - element$jscomp$inline_1602.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1601 = - "function" === typeof element$jscomp$inline_1602.oninput; + var isSupported$jscomp$inline_1610 = "oninput" in document; + if (!isSupported$jscomp$inline_1610) { + var element$jscomp$inline_1611 = document.createElement("div"); + element$jscomp$inline_1611.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1610 = + "function" === typeof element$jscomp$inline_1611.oninput; } - JSCompiler_inline_result$jscomp$387 = isSupported$jscomp$inline_1601; + JSCompiler_inline_result$jscomp$387 = isSupported$jscomp$inline_1610; } else JSCompiler_inline_result$jscomp$387 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$387 && @@ -13869,20 +13871,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1642 = 0; - i$jscomp$inline_1642 < simpleEventPluginEvents.length; - i$jscomp$inline_1642++ + var i$jscomp$inline_1651 = 0; + i$jscomp$inline_1651 < simpleEventPluginEvents.length; + i$jscomp$inline_1651++ ) { - var eventName$jscomp$inline_1643 = - simpleEventPluginEvents[i$jscomp$inline_1642], - domEventName$jscomp$inline_1644 = - eventName$jscomp$inline_1643.toLowerCase(), - capitalizedEvent$jscomp$inline_1645 = - eventName$jscomp$inline_1643[0].toUpperCase() + - eventName$jscomp$inline_1643.slice(1); + var eventName$jscomp$inline_1652 = + simpleEventPluginEvents[i$jscomp$inline_1651], + domEventName$jscomp$inline_1653 = + eventName$jscomp$inline_1652.toLowerCase(), + capitalizedEvent$jscomp$inline_1654 = + eventName$jscomp$inline_1652[0].toUpperCase() + + eventName$jscomp$inline_1652.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1644, - "on" + capitalizedEvent$jscomp$inline_1645 + domEventName$jscomp$inline_1653, + "on" + capitalizedEvent$jscomp$inline_1654 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17440,16 +17442,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1815 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1824 = React.version; if ( - "19.0.0-www-modern-fe03c56d-20240905" !== - isomorphicReactPackageVersion$jscomp$inline_1815 + "19.0.0-www-modern-a03254bc-20240905" !== + isomorphicReactPackageVersion$jscomp$inline_1824 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1815, - "19.0.0-www-modern-fe03c56d-20240905" + isomorphicReactPackageVersion$jscomp$inline_1824, + "19.0.0-www-modern-a03254bc-20240905" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17465,28 +17467,28 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1817 = { +var internals$jscomp$inline_1826 = { bundleType: 0, - version: "19.0.0-www-modern-fe03c56d-20240905", + version: "19.0.0-www-modern-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1817.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1817.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1826.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1826.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2301 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2310 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2301.isDisabled && - hook$jscomp$inline_2301.supportsFiber + !hook$jscomp$inline_2310.isDisabled && + hook$jscomp$inline_2310.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2301.inject( - internals$jscomp$inline_1817 + (rendererID = hook$jscomp$inline_2310.inject( + internals$jscomp$inline_1826 )), - (injectedHook = hook$jscomp$inline_2301); + (injectedHook = hook$jscomp$inline_2310); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17837,7 +17839,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-fe03c56d-20240905"; +exports.version = "19.0.0-www-modern-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index 715b6884c6..ffab3dd6ec 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -8987,5 +8987,5 @@ __DEV__ && '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-www-classic-fe03c56d-20240905"; + exports.version = "19.0.0-www-classic-a03254bc-20240905"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 2f8b7092a2..9aa1212efa 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -8805,5 +8805,5 @@ __DEV__ && '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-www-modern-fe03c56d-20240905"; + exports.version = "19.0.0-www-modern-a03254bc-20240905"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index 663438b9f9..bb22bf7a98 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -5912,4 +5912,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-www-classic-fe03c56d-20240905"; +exports.version = "19.0.0-www-classic-a03254bc-20240905"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index 5f52381a03..16f445cbb8 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -5824,4 +5824,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-www-modern-fe03c56d-20240905"; +exports.version = "19.0.0-www-modern-a03254bc-20240905"; diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index bbf5555150..658ebb8c8d 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -4384,6 +4384,16 @@ __DEV__ && ); 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) @@ -9208,32 +9218,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2501; - var JSCompiler_object_inline_stack_2502 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2451; + var JSCompiler_object_inline_stack_2452 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2503 = !1; + var JSCompiler_object_inline_componentStack_2453 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2501 = didSuspend) || - (JSCompiler_object_inline_digest_2501 = + (JSCompiler_object_inline_digest_2451 = didSuspend) || + (JSCompiler_object_inline_digest_2451 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2501 && - ((JSCompiler_object_inline_componentStack_2503 = !0), + JSCompiler_object_inline_digest_2451 && + ((JSCompiler_object_inline_componentStack_2453 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2501 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2451 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2503 + JSCompiler_object_inline_componentStack_2453 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2500 = nextHydratableInstance; + var JSCompiler_object_inline_message_2450 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2500)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2450)) { c: { - var instance = JSCompiler_object_inline_message_2500; + var instance = JSCompiler_object_inline_message_2450; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9274,19 +9284,19 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2500 + JSCompiler_object_inline_message_2450 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2500 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2450 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2500 && - ((JSCompiler_object_inline_message_2500 = - JSCompiler_object_inline_message_2500.dehydrated), - null !== JSCompiler_object_inline_message_2500) + null !== JSCompiler_object_inline_message_2450 && + ((JSCompiler_object_inline_message_2450 = + JSCompiler_object_inline_message_2450.dehydrated), + null !== JSCompiler_object_inline_message_2450) ) return ( - JSCompiler_object_inline_message_2500.data === + JSCompiler_object_inline_message_2450.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -9294,27 +9304,27 @@ __DEV__ && ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2500 = - JSCompiler_object_inline_stack_2502.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2502.fallback; - if (JSCompiler_object_inline_componentStack_2503) + JSCompiler_object_inline_message_2450 = + JSCompiler_object_inline_stack_2452.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2452.fallback; + if (JSCompiler_object_inline_componentStack_2453) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2502 = + (JSCompiler_object_inline_stack_2452 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2500, + JSCompiler_object_inline_message_2450, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2503 = + (JSCompiler_object_inline_componentStack_2453 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2503.memoizedState = + (JSCompiler_object_inline_componentStack_2453.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2503.childLanes = + (JSCompiler_object_inline_componentStack_2453.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2501, + JSCompiler_object_inline_digest_2451, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9327,9 +9337,9 @@ __DEV__ && ? markerInstanceStack.current : null), (current = - JSCompiler_object_inline_componentStack_2503.updateQueue), + JSCompiler_object_inline_componentStack_2453.updateQueue), null === current - ? (JSCompiler_object_inline_componentStack_2503.updateQueue = + ? (JSCompiler_object_inline_componentStack_2453.updateQueue = { transitions: workInProgress, markerInstances: renderLanes, @@ -9337,46 +9347,46 @@ __DEV__ && }) : ((current.transitions = workInProgress), (current.markerInstances = renderLanes)))), - JSCompiler_object_inline_stack_2502 + JSCompiler_object_inline_stack_2452 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2502.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2452.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2502 = + (JSCompiler_object_inline_stack_2452 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2500, + JSCompiler_object_inline_message_2450, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2503 = + (JSCompiler_object_inline_componentStack_2453 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2503.memoizedState = + (JSCompiler_object_inline_componentStack_2453.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2503.childLanes = + (JSCompiler_object_inline_componentStack_2453.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2501, + JSCompiler_object_inline_digest_2451, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2502 + JSCompiler_object_inline_stack_2452 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2500 + JSCompiler_object_inline_message_2450 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2500 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2500) + ((JSCompiler_object_inline_message_2450 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2450) ) { if (didSuspend) workInProgress.flags & 256 @@ -9393,32 +9403,32 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2503 = - JSCompiler_object_inline_stack_2502.fallback), - (JSCompiler_object_inline_message_2500 = workInProgress.mode), - (JSCompiler_object_inline_stack_2502 = createFiberFromOffscreen( + (JSCompiler_object_inline_componentStack_2453 = + JSCompiler_object_inline_stack_2452.fallback), + (JSCompiler_object_inline_message_2450 = workInProgress.mode), + (JSCompiler_object_inline_stack_2452 = createFiberFromOffscreen( { mode: "visible", - children: JSCompiler_object_inline_stack_2502.children + children: JSCompiler_object_inline_stack_2452.children }, - JSCompiler_object_inline_message_2500, + JSCompiler_object_inline_message_2450, 0, null )), - (JSCompiler_object_inline_componentStack_2503 = + (JSCompiler_object_inline_componentStack_2453 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2503, - JSCompiler_object_inline_message_2500, + JSCompiler_object_inline_componentStack_2453, + JSCompiler_object_inline_message_2450, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2503.flags |= 2), - (JSCompiler_object_inline_stack_2502.return = workInProgress), - (JSCompiler_object_inline_componentStack_2503.return = + (JSCompiler_object_inline_componentStack_2453.flags |= 2), + (JSCompiler_object_inline_stack_2452.return = workInProgress), + (JSCompiler_object_inline_componentStack_2453.return = workInProgress), - (JSCompiler_object_inline_stack_2502.sibling = - JSCompiler_object_inline_componentStack_2503), - (workInProgress.child = JSCompiler_object_inline_stack_2502), + (JSCompiler_object_inline_stack_2452.sibling = + JSCompiler_object_inline_componentStack_2453), + (workInProgress.child = JSCompiler_object_inline_stack_2452), (disableLegacyMode || (workInProgress.mode & ConcurrentMode) !== NoMode) && reconcileChildFibers( @@ -9427,63 +9437,63 @@ __DEV__ && null, renderLanes ), - (JSCompiler_object_inline_stack_2502 = workInProgress.child), - (JSCompiler_object_inline_stack_2502.memoizedState = + (JSCompiler_object_inline_stack_2452 = workInProgress.child), + (JSCompiler_object_inline_stack_2452.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2502.childLanes = + (JSCompiler_object_inline_stack_2452.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2501, + JSCompiler_object_inline_digest_2451, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2503)); + JSCompiler_object_inline_componentStack_2453)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2500.data === + JSCompiler_object_inline_message_2450.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2501 = - JSCompiler_object_inline_message_2500.nextSibling && - JSCompiler_object_inline_message_2500.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2501) { - JSCompiler_temp = JSCompiler_object_inline_digest_2501.dgst; - var message = JSCompiler_object_inline_digest_2501.msg; - instance = JSCompiler_object_inline_digest_2501.stck; - var componentStack = JSCompiler_object_inline_digest_2501.cstck; + JSCompiler_object_inline_digest_2451 = + JSCompiler_object_inline_message_2450.nextSibling && + JSCompiler_object_inline_message_2450.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2451) { + JSCompiler_temp = JSCompiler_object_inline_digest_2451.dgst; + var message = JSCompiler_object_inline_digest_2451.msg; + instance = JSCompiler_object_inline_digest_2451.stck; + var componentStack = JSCompiler_object_inline_digest_2451.cstck; } - JSCompiler_object_inline_message_2500 = message; - JSCompiler_object_inline_digest_2501 = JSCompiler_temp; - JSCompiler_object_inline_stack_2502 = instance; - JSCompiler_object_inline_componentStack_2503 = componentStack; - JSCompiler_object_inline_message_2500 = - JSCompiler_object_inline_message_2500 - ? Error(JSCompiler_object_inline_message_2500) + JSCompiler_object_inline_message_2450 = message; + JSCompiler_object_inline_digest_2451 = JSCompiler_temp; + JSCompiler_object_inline_stack_2452 = instance; + JSCompiler_object_inline_componentStack_2453 = componentStack; + JSCompiler_object_inline_message_2450 = + JSCompiler_object_inline_message_2450 + ? Error(JSCompiler_object_inline_message_2450) : 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_2500.stack = - JSCompiler_object_inline_stack_2502 || ""; - JSCompiler_object_inline_message_2500.digest = - JSCompiler_object_inline_digest_2501; - JSCompiler_object_inline_digest_2501 = - void 0 === JSCompiler_object_inline_componentStack_2503 + JSCompiler_object_inline_message_2450.stack = + JSCompiler_object_inline_stack_2452 || ""; + JSCompiler_object_inline_message_2450.digest = + JSCompiler_object_inline_digest_2451; + JSCompiler_object_inline_digest_2451 = + void 0 === JSCompiler_object_inline_componentStack_2453 ? null - : JSCompiler_object_inline_componentStack_2503; - "string" === typeof JSCompiler_object_inline_digest_2501 && + : JSCompiler_object_inline_componentStack_2453; + "string" === typeof JSCompiler_object_inline_digest_2451 && CapturedStacks.set( - JSCompiler_object_inline_message_2500, - JSCompiler_object_inline_digest_2501 + JSCompiler_object_inline_message_2450, + JSCompiler_object_inline_digest_2451 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2500, + value: JSCompiler_object_inline_message_2450, source: null, - stack: JSCompiler_object_inline_digest_2501 + stack: JSCompiler_object_inline_digest_2451 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9498,25 +9508,25 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2501 = + (JSCompiler_object_inline_digest_2451 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2501) + didReceiveUpdate || JSCompiler_object_inline_digest_2451) ) { - JSCompiler_object_inline_digest_2501 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2501) { - JSCompiler_object_inline_stack_2502 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2502 & 42)) - JSCompiler_object_inline_stack_2502 = 1; + JSCompiler_object_inline_digest_2451 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2451) { + JSCompiler_object_inline_stack_2452 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2452 & 42)) + JSCompiler_object_inline_stack_2452 = 1; else - switch (JSCompiler_object_inline_stack_2502) { + switch (JSCompiler_object_inline_stack_2452) { case 2: - JSCompiler_object_inline_stack_2502 = 1; + JSCompiler_object_inline_stack_2452 = 1; break; case 8: - JSCompiler_object_inline_stack_2502 = 4; + JSCompiler_object_inline_stack_2452 = 4; break; case 32: - JSCompiler_object_inline_stack_2502 = 16; + JSCompiler_object_inline_stack_2452 = 16; break; case 128: case 256: @@ -9537,40 +9547,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2502 = 64; + JSCompiler_object_inline_stack_2452 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2502 = 134217728; + JSCompiler_object_inline_stack_2452 = 134217728; break; default: - JSCompiler_object_inline_stack_2502 = 0; + JSCompiler_object_inline_stack_2452 = 0; } - JSCompiler_object_inline_stack_2502 = + JSCompiler_object_inline_stack_2452 = 0 !== - (JSCompiler_object_inline_stack_2502 & - (JSCompiler_object_inline_digest_2501.suspendedLanes | + (JSCompiler_object_inline_stack_2452 & + (JSCompiler_object_inline_digest_2451.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2502; + : JSCompiler_object_inline_stack_2452; if ( - 0 !== JSCompiler_object_inline_stack_2502 && - JSCompiler_object_inline_stack_2502 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2452 && + JSCompiler_object_inline_stack_2452 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2502), + ((prevState.retryLane = JSCompiler_object_inline_stack_2452), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2502 + JSCompiler_object_inline_stack_2452 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2501, + JSCompiler_object_inline_digest_2451, current, - JSCompiler_object_inline_stack_2502 + JSCompiler_object_inline_stack_2452 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2500.data === + JSCompiler_object_inline_message_2450.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9578,7 +9588,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2500.data === + JSCompiler_object_inline_message_2450.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9586,12 +9596,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2500._reactRetry = + (JSCompiler_object_inline_message_2450._reactRetry = workInProgress), (workInProgress = null)) : ((renderLanes = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2500.nextSibling + JSCompiler_object_inline_message_2450.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9609,73 +9619,73 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2502.children + JSCompiler_object_inline_stack_2452.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2503) + if (JSCompiler_object_inline_componentStack_2453) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2503 = - JSCompiler_object_inline_stack_2502.fallback), - (JSCompiler_object_inline_message_2500 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2453 = + JSCompiler_object_inline_stack_2452.fallback), + (JSCompiler_object_inline_message_2450 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), (componentStack = { mode: "hidden", - children: JSCompiler_object_inline_stack_2502.children + children: JSCompiler_object_inline_stack_2452.children }), disableLegacyMode || - (JSCompiler_object_inline_message_2500 & ConcurrentMode) !== NoMode || + (JSCompiler_object_inline_message_2450 & ConcurrentMode) !== NoMode || workInProgress.child === JSCompiler_temp - ? ((JSCompiler_object_inline_stack_2502 = createWorkInProgress( + ? ((JSCompiler_object_inline_stack_2452 = createWorkInProgress( JSCompiler_temp, componentStack )), - (JSCompiler_object_inline_stack_2502.subtreeFlags = + (JSCompiler_object_inline_stack_2452.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)) - : ((JSCompiler_object_inline_stack_2502 = workInProgress.child), - (JSCompiler_object_inline_stack_2502.childLanes = 0), - (JSCompiler_object_inline_stack_2502.pendingProps = + : ((JSCompiler_object_inline_stack_2452 = workInProgress.child), + (JSCompiler_object_inline_stack_2452.childLanes = 0), + (JSCompiler_object_inline_stack_2452.pendingProps = componentStack), workInProgress.mode & ProfileMode && - ((JSCompiler_object_inline_stack_2502.actualDuration = 0), - (JSCompiler_object_inline_stack_2502.actualStartTime = -1), - (JSCompiler_object_inline_stack_2502.selfBaseDuration = + ((JSCompiler_object_inline_stack_2452.actualDuration = 0), + (JSCompiler_object_inline_stack_2452.actualStartTime = -1), + (JSCompiler_object_inline_stack_2452.selfBaseDuration = JSCompiler_temp.selfBaseDuration), - (JSCompiler_object_inline_stack_2502.treeBaseDuration = + (JSCompiler_object_inline_stack_2452.treeBaseDuration = JSCompiler_temp.treeBaseDuration)), (workInProgress.deletions = null)), null !== instance - ? (JSCompiler_object_inline_componentStack_2503 = + ? (JSCompiler_object_inline_componentStack_2453 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2503 + JSCompiler_object_inline_componentStack_2453 )) - : ((JSCompiler_object_inline_componentStack_2503 = + : ((JSCompiler_object_inline_componentStack_2453 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2503, - JSCompiler_object_inline_message_2500, + JSCompiler_object_inline_componentStack_2453, + JSCompiler_object_inline_message_2450, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2503.flags |= 2)), - (JSCompiler_object_inline_componentStack_2503.return = + (JSCompiler_object_inline_componentStack_2453.flags |= 2)), + (JSCompiler_object_inline_componentStack_2453.return = workInProgress), - (JSCompiler_object_inline_stack_2502.return = workInProgress), - (JSCompiler_object_inline_stack_2502.sibling = - JSCompiler_object_inline_componentStack_2503), - (workInProgress.child = JSCompiler_object_inline_stack_2502), - (JSCompiler_object_inline_stack_2502 = - JSCompiler_object_inline_componentStack_2503), - (JSCompiler_object_inline_componentStack_2503 = workInProgress.child), - (JSCompiler_object_inline_message_2500 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2500 - ? (JSCompiler_object_inline_message_2500 = + (JSCompiler_object_inline_stack_2452.return = workInProgress), + (JSCompiler_object_inline_stack_2452.sibling = + JSCompiler_object_inline_componentStack_2453), + (workInProgress.child = JSCompiler_object_inline_stack_2452), + (JSCompiler_object_inline_stack_2452 = + JSCompiler_object_inline_componentStack_2453), + (JSCompiler_object_inline_componentStack_2453 = workInProgress.child), + (JSCompiler_object_inline_message_2450 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2450 + ? (JSCompiler_object_inline_message_2450 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2500.cachePool), + JSCompiler_object_inline_message_2450.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9683,34 +9693,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2500 = { + (JSCompiler_object_inline_message_2450 = { baseLanes: - JSCompiler_object_inline_message_2500.baseLanes | renderLanes, + JSCompiler_object_inline_message_2450.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2503.memoizedState = - JSCompiler_object_inline_message_2500), + (JSCompiler_object_inline_componentStack_2453.memoizedState = + JSCompiler_object_inline_message_2450), enableTransitionTracing && - ((JSCompiler_object_inline_message_2500 = enableTransitionTracing + ((JSCompiler_object_inline_message_2450 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2500 && + null !== JSCompiler_object_inline_message_2450 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2503.updateQueue), + JSCompiler_object_inline_componentStack_2453.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2503.updateQueue = { - transitions: JSCompiler_object_inline_message_2500, + ? (JSCompiler_object_inline_componentStack_2453.updateQueue = { + transitions: JSCompiler_object_inline_message_2450, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2503.updateQueue = + ? (JSCompiler_object_inline_componentStack_2453.updateQueue = { - transitions: JSCompiler_object_inline_message_2500, + transitions: JSCompiler_object_inline_message_2450, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9718,41 +9728,41 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2500), + JSCompiler_object_inline_message_2450), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2503.childLanes = + (JSCompiler_object_inline_componentStack_2453.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2501, + JSCompiler_object_inline_digest_2451, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2502 + JSCompiler_object_inline_stack_2452 ); pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_object_inline_digest_2501 = current.child; - current = JSCompiler_object_inline_digest_2501.sibling; - JSCompiler_object_inline_digest_2501 = createWorkInProgress( - JSCompiler_object_inline_digest_2501, + JSCompiler_object_inline_digest_2451 = current.child; + current = JSCompiler_object_inline_digest_2451.sibling; + JSCompiler_object_inline_digest_2451 = createWorkInProgress( + JSCompiler_object_inline_digest_2451, { mode: "visible", - children: JSCompiler_object_inline_stack_2502.children + children: JSCompiler_object_inline_stack_2452.children } ); disableLegacyMode || (workInProgress.mode & ConcurrentMode) !== NoMode || - (JSCompiler_object_inline_digest_2501.lanes = renderLanes); - JSCompiler_object_inline_digest_2501.return = workInProgress; - JSCompiler_object_inline_digest_2501.sibling = null; + (JSCompiler_object_inline_digest_2451.lanes = renderLanes); + JSCompiler_object_inline_digest_2451.return = workInProgress; + JSCompiler_object_inline_digest_2451.sibling = null; null !== current && ((renderLanes = workInProgress.deletions), null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) : renderLanes.push(current)); - workInProgress.child = JSCompiler_object_inline_digest_2501; + workInProgress.child = JSCompiler_object_inline_digest_2451; workInProgress.memoizedState = null; - return JSCompiler_object_inline_digest_2501; + return JSCompiler_object_inline_digest_2451; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { primaryChildren = createFiberFromOffscreen( @@ -12381,7 +12391,11 @@ __DEV__ && (lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -12417,8 +12431,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -12460,7 +12481,13 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -12509,7 +12536,12 @@ __DEV__ && function commitClassDidMount(finishedWork) { var instance = finishedWork.stateNode; "function" === typeof instance.componentDidMount && - callComponentDidMountInDEV(finishedWork, instance); + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + instance + ); } function commitClassCallbacks(finishedWork) { var updateQueue = finishedWork.updateQueue; @@ -12529,12 +12561,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -12548,50 +12633,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -12604,11 +12696,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -12620,16 +12713,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -12638,27 +12754,14 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } @@ -12668,27 +12771,29 @@ __DEV__ && 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); - } + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); } catch (error$21) { captureCommitPhaseError(finishedWork, finishedWork.return, error$21); } } function commitHostUpdate(finishedWork, newProps, oldProps) { try { - var domElement = finishedWork.stateNode; - updateProperties(domElement, finishedWork.type, oldProps, newProps); - domElement[internalPropsKey] = newProps; + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); } catch (error$22) { captureCommitPhaseError(finishedWork, finishedWork.return, error$22); } @@ -12765,6 +12870,50 @@ __DEV__ && 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." + ); + } + } + } function shouldProfile(current) { return ( (current.mode & ProfileMode) !== NoMode && @@ -12860,23 +13009,82 @@ __DEV__ && ) (anchorOffset = root[JSCompiler_temp]), doesFiberContain(anchorOffset, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - anchorOffset - ), - (_enabled = !1)); + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(anchorOffset)); root = firstChild.child; if (0 !== (firstChild.subtreeFlags & 9236) && null !== root) (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + if ( + (focusNode = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((focusNode = 13 === root.tag)) + a: { + if ( + null !== JSCompiler_temp && + ((focusNode = JSCompiler_temp.memoizedState), + null === focusNode || null !== focusNode.dehydrated) + ) { + focusNode = root.memoizedState; + focusNode = + null !== focusNode && null === focusNode.dehydrated; + break a; + } + focusNode = !1; + } + focusNode = + focusNode && doesFiberContain(root, focusedInstanceHandle); + } + focusNode && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(root)); + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.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: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; + case 3: + 0 !== (anchorOffset & 1024) && + clearContainer(root.stateNode.containerInfo); + 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; @@ -12891,115 +13099,6 @@ __DEV__ && focusedInstanceHandle = null; return firstChild; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - finishedWork - ), - (_enabled = !1)); - } - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (var ii = 0; ii < finishedWork.length; ii++) - (current = finishedWork[ii]), - (current.ref.impl = current.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - JSCompiler_temp = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 { - (ii = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (flags = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== ii || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = ii); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - 0 !== (flags & 1024) && - clearContainer(finishedWork.stateNode.containerInfo); - 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 commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) switch (finishedWork.tag) { @@ -13032,97 +13131,95 @@ __DEV__ && } } } - 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -13138,7 +13235,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -13149,29 +13251,17 @@ __DEV__ && } 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 - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -13193,11 +13283,7 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; @@ -13206,15 +13292,18 @@ __DEV__ && disableLegacyMode || (finishedWork.mode & ConcurrentMode) !== NoMode ) { - var newOffscreenSubtreeIsHidden = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || + offscreenSubtreeIsHidden), + !prevProps) + ) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -13222,31 +13311,18 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } - } else - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -13528,24 +13604,25 @@ __DEV__ && offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParentIsContainer = hostParent; - var _prevHostParentIsContainer = hostParentIsContainer; + prevHostParent = hostParent; + prevHostParentIsContainer = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParentIsContainer; - hostParentIsContainer = _prevHostParentIsContainer; + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; if (null !== hostParent) if (hostParentIsContainer) try { - (finishedRoot = hostParent), - (prevHostParent = deletedFiber.stateNode), - finishedRoot.nodeType === COMMENT_NODE - ? finishedRoot.parentNode.removeChild(prevHostParent) - : finishedRoot.removeChild(prevHostParent); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -13555,7 +13632,12 @@ __DEV__ && } else try { - hostParent.removeChild(deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -13568,8 +13650,8 @@ __DEV__ && finishedRoot = finishedRoot.hydrationCallbacks; if (null !== finishedRoot) try { - (prevHostParentIsContainer = finishedRoot.onDeleted) && - prevHostParentIsContainer(deletedFiber.stateNode); + (prevHostParent = finishedRoot.onDeleted) && + prevHostParent(deletedFiber.stateNode); } catch (error$33) { captureCommitPhaseError( deletedFiber, @@ -13617,31 +13699,37 @@ __DEV__ && ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - _prevHostParentIsContainer = prevHostParentIsContainer.tag; - var inst = prevHostParentIsContainer.inst, + var tag = prevHostParentIsContainer.tag, + inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - ((_prevHostParentIsContainer & Insertion) !== NoFlags + ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy )) - : (_prevHostParentIsContainer & Layout) !== NoFlags && + : (tag & Layout) !== NoFlags && (enableSchedulingProfiler && markComponentLayoutEffectUnmountStarted(deletedFiber), 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 @@ -13717,7 +13805,11 @@ __DEV__ && ((current = current.dehydrated), null !== current)) ) { try { - retryIfBlockedOn(current); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + current + ); } catch (error$31) { captureCommitPhaseError( finishedWork, @@ -13811,20 +13903,10 @@ __DEV__ && 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++) { @@ -13864,16 +13946,10 @@ __DEV__ && } 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) { @@ -13881,7 +13957,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -13905,7 +13981,7 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13922,7 +13998,7 @@ __DEV__ && break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13962,15 +14038,16 @@ __DEV__ && flags = currentResource; break a; case "link": - var maybeNodes = getHydratableHoistableCache( - "link", - "href", - hoistableRoot - ).get(flags + (current.href || "")); - if (maybeNodes) - for (var i = 0; i < maybeNodes.length; i++) + if ( + (root = getHydratableHoistableCache( + "link", + "href", + hoistableRoot + ).get(flags + (current.href || ""))) + ) + for (var i = 0; i < root.length; i++) if ( - ((currentResource = maybeNodes[i]), + ((currentResource = root[i]), currentResource.getAttribute("href") === (null == current.href ? null : current.href) && currentResource.getAttribute("rel") === @@ -13984,7 +14061,7 @@ __DEV__ && ? null : current.crossOrigin)) ) { - maybeNodes.splice(i, 1); + root.splice(i, 1); break b; } currentResource = hoistableRoot.createElement(flags); @@ -13993,15 +14070,15 @@ __DEV__ && break; case "meta": if ( - (maybeNodes = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < maybeNodes.length; i++) + for (i = 0; i < root.length; i++) if ( - ((currentResource = maybeNodes[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" @@ -14027,7 +14104,7 @@ __DEV__ && ? null : current.charSet)) ) { - maybeNodes.splice(i, 1); + root.splice(i, 1); break b; } currentResource = hoistableRoot.createElement(flags); @@ -14090,48 +14167,27 @@ __DEV__ && hoistableRoot = finishedWork.stateNode; currentResource = finishedWork.memoizedProps; try { - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || + 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" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; } - var type = finishedWork.type; - if (getInstanceFromNode(hoistableRoot)) { - var tagName = hoistableRoot.tagName.toLowerCase(); - error$jscomp$0( - "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: - error$jscomp$0( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); - } - for ( - var attributes = hoistableRoot.attributes; - attributes.length; - - ) - hoistableRoot.removeAttributeNode(attributes[0]); - setInitialProperties(hoistableRoot, type, currentResource); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = currentResource; + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); } catch (error$32) { captureCommitPhaseError( finishedWork, @@ -14141,7 +14197,7 @@ __DEV__ && } } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -14149,7 +14205,7 @@ __DEV__ && if (finishedWork.flags & 32) { hoistableRoot = finishedWork.stateNode; try { - setTextContent(hoistableRoot, ""); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); } catch (error$24) { captureCommitPhaseError( finishedWork, @@ -14174,7 +14230,7 @@ __DEV__ && )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) @@ -14182,9 +14238,16 @@ __DEV__ && "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); flags = finishedWork.memoizedProps; - current = finishedWork.stateNode; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - current.nodeValue = flags; + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + hoistableRoot, + current, + flags + ); } catch (error$23) { captureCommitPhaseError( finishedWork, @@ -14198,7 +14261,7 @@ __DEV__ && tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -14207,7 +14270,11 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); } catch (error$30) { captureCommitPhaseError( finishedWork, @@ -14223,12 +14290,12 @@ __DEV__ && 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 && ((hoistableRoot = null !== finishedWork.memoizedState), @@ -14268,17 +14335,17 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - node = null !== finishedWork.memoizedState; + i = null !== finishedWork.memoizedState; nextNode = null !== current && null !== current.memoizedState; disableLegacyMode || finishedWork.mode & ConcurrentMode ? ((nodeName = offscreenSubtreeIsHidden), - (type = offscreenSubtreeWasHidden), - (offscreenSubtreeIsHidden = nodeName || node), - (offscreenSubtreeWasHidden = type || nextNode), - recursivelyTraverseMutationEffects(root, finishedWork, lanes), - (offscreenSubtreeWasHidden = type), + (suspenseCallback = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = nodeName || i), + (offscreenSubtreeWasHidden = suspenseCallback || nextNode), + recursivelyTraverseMutationEffects(root, finishedWork), + (offscreenSubtreeWasHidden = suspenseCallback), (offscreenSubtreeIsHidden = nodeName)) - : recursivelyTraverseMutationEffects(root, finishedWork, lanes); + : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -14286,10 +14353,10 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = node + ((root._visibility = i ? root._visibility & -2 : root._visibility | 1), - node && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || nextNode || @@ -14303,42 +14370,52 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - lanes = current = root; + nextNode = current = root; try { - if (((hoistableRoot = lanes.stateNode), node)) - (currentResource = hoistableRoot.style), - "function" === typeof currentResource.setProperty - ? currentResource.setProperty( - "display", - "none", - "important" - ) - : (currentResource.display = "none"); - else { - maybeNodes = lanes.stateNode; - i = lanes.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(); - } + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + nextNode, + nextNode.return, + error$25 + ); } } } else if (6 === root.tag) { if (null === current) { - lanes = root; + nextNode = root; try { - lanes.stateNode.nodeValue = node ? "" : lanes.memoizedProps; + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); } catch (error$26) { - captureCommitPhaseError(lanes, lanes.return, error$26); + captureCommitPhaseError( + nextNode, + nextNode.return, + error$26 + ); } } } else if ( @@ -14371,7 +14448,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -14380,7 +14457,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -14390,7 +14467,7 @@ __DEV__ && (finishedWork.stateNode[internalInstanceKey] = finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -14398,52 +14475,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - 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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -14463,27 +14495,13 @@ __DEV__ && 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) { @@ -14567,18 +14585,16 @@ __DEV__ && includeWorkInProgressEffects ); commitClassDidMount(finishedWork); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error$14) { captureCommitPhaseError( finishedWork, @@ -14675,9 +14691,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -14759,21 +14773,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -14782,9 +14781,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -14908,9 +14905,7 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & ConcurrentMode ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((nextCache._visibility |= 4), recursivelyTraversePassiveMountEffects( @@ -14982,9 +14977,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -15044,9 +15037,7 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & ConcurrentMode ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( @@ -15109,70 +15100,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -15249,11 +15216,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -15297,7 +15260,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -15324,116 +15287,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - if (null !== sibling) { - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, + current, instance, offscreenFiber, null, - !1 - ))); + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function invokeLayoutEffectMountInDEV(fiber) { @@ -17119,8 +17073,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (lanes = 0; lanes < transitions.length; lanes++) @@ -22133,6 +22087,14 @@ __DEV__ && ? HostContextNamespaceNone : parentNamespace; } + function beforeActiveInstanceBlur(internalInstanceHandle) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("beforeblur", !0); + event._detachedInterceptFiber = internalInstanceHandle; + target.dispatchEvent(event); + _enabled = !1; + } function shouldSetTextContent(type, props) { return ( "textarea" === type || @@ -22164,21 +22126,48 @@ __DEV__ && 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 createEvent(type, bubbles) { var event = document.createEvent("Event"); event.initEvent(type, bubbles, !1); return event; } - function dispatchBeforeDetachedBlur(target, internalInstanceHandle) { - var event = createEvent("beforeblur", !0); - event._detachedInterceptFiber = internalInstanceHandle; - target.dispatchEvent(event); - } function dispatchAfterDetachedBlur(target) { var event = createEvent("afterblur", !1); event.relatedTarget = target; document.dispatchEvent(event); } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + container.nodeType === COMMENT_NODE + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -22202,6 +22191,27 @@ __DEV__ && } 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 clearContainer(container) { var nodeType = container.nodeType; if (nodeType === DOCUMENT_NODE) clearContainerSparingly(container); @@ -22416,6 +22426,12 @@ __DEV__ && } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function getBoundingRect(node) { node = node.getBoundingClientRect(); return { @@ -22526,6 +22542,37 @@ __DEV__ && ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + error$jscomp$0( + "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: + error$jscomp$0( + "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() @@ -27982,11 +28029,11 @@ __DEV__ && : flushSyncErrorInBuildsThatSupportLegacyMode; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-classic-fe03c56d-20240905" !== isomorphicReactPackageVersion) + if ("19.0.0-www-classic-a03254bc-20240905" !== 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-www-classic-fe03c56d-20240905\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-classic-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -28030,11 +28077,11 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.0.0-www-classic-fe03c56d-20240905", + version: "19.0.0-www-classic-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -28853,5 +28900,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-classic-fe03c56d-20240905"; + exports.version = "19.0.0-www-classic-a03254bc-20240905"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index a40777820a..4ae41e93e2 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -4251,6 +4251,16 @@ __DEV__ && ); 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) @@ -8893,32 +8903,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2521; - var JSCompiler_object_inline_stack_2522 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2472; + var JSCompiler_object_inline_stack_2473 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2523 = !1; + var JSCompiler_object_inline_componentStack_2474 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2521 = didSuspend) || - (JSCompiler_object_inline_digest_2521 = + (JSCompiler_object_inline_digest_2472 = didSuspend) || + (JSCompiler_object_inline_digest_2472 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2521 && - ((JSCompiler_object_inline_componentStack_2523 = !0), + JSCompiler_object_inline_digest_2472 && + ((JSCompiler_object_inline_componentStack_2474 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2521 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2472 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2523 + JSCompiler_object_inline_componentStack_2474 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2520 = nextHydratableInstance; + var JSCompiler_object_inline_message_2471 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2520)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2471)) { c: { - var instance = JSCompiler_object_inline_message_2520; + var instance = JSCompiler_object_inline_message_2471; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -8959,19 +8969,19 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2520 + JSCompiler_object_inline_message_2471 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2520 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2471 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2520 && - ((JSCompiler_object_inline_message_2520 = - JSCompiler_object_inline_message_2520.dehydrated), - null !== JSCompiler_object_inline_message_2520) + null !== JSCompiler_object_inline_message_2471 && + ((JSCompiler_object_inline_message_2471 = + JSCompiler_object_inline_message_2471.dehydrated), + null !== JSCompiler_object_inline_message_2471) ) return ( - JSCompiler_object_inline_message_2520.data === + JSCompiler_object_inline_message_2471.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8979,27 +8989,27 @@ __DEV__ && ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2520 = - JSCompiler_object_inline_stack_2522.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2522.fallback; - if (JSCompiler_object_inline_componentStack_2523) + JSCompiler_object_inline_message_2471 = + JSCompiler_object_inline_stack_2473.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2473.fallback; + if (JSCompiler_object_inline_componentStack_2474) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2522 = + (JSCompiler_object_inline_stack_2473 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2520, + JSCompiler_object_inline_message_2471, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2523 = + (JSCompiler_object_inline_componentStack_2474 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2523.memoizedState = + (JSCompiler_object_inline_componentStack_2474.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2523.childLanes = + (JSCompiler_object_inline_componentStack_2474.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2521, + JSCompiler_object_inline_digest_2472, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9012,9 +9022,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2523.updateQueue), + JSCompiler_object_inline_componentStack_2474.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2523.updateQueue = + ? (JSCompiler_object_inline_componentStack_2474.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9022,46 +9032,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2522 + JSCompiler_object_inline_stack_2473 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2522.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2473.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2522 = + (JSCompiler_object_inline_stack_2473 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2520, + JSCompiler_object_inline_message_2471, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2523 = + (JSCompiler_object_inline_componentStack_2474 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2523.memoizedState = + (JSCompiler_object_inline_componentStack_2474.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2523.childLanes = + (JSCompiler_object_inline_componentStack_2474.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2521, + JSCompiler_object_inline_digest_2472, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2522 + JSCompiler_object_inline_stack_2473 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2520 + JSCompiler_object_inline_message_2471 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2520 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2520) + ((JSCompiler_object_inline_message_2471 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2471) ) { if (didSuspend) workInProgress.flags & 256 @@ -9078,94 +9088,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2523 = - JSCompiler_object_inline_stack_2522.fallback), - (JSCompiler_object_inline_message_2520 = workInProgress.mode), - (JSCompiler_object_inline_stack_2522 = + (JSCompiler_object_inline_componentStack_2474 = + JSCompiler_object_inline_stack_2473.fallback), + (JSCompiler_object_inline_message_2471 = workInProgress.mode), + (JSCompiler_object_inline_stack_2473 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2522.children + children: JSCompiler_object_inline_stack_2473.children }, - JSCompiler_object_inline_message_2520 + JSCompiler_object_inline_message_2471 )), - (JSCompiler_object_inline_componentStack_2523 = + (JSCompiler_object_inline_componentStack_2474 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2523, - JSCompiler_object_inline_message_2520, + JSCompiler_object_inline_componentStack_2474, + JSCompiler_object_inline_message_2471, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2523.flags |= 2), - (JSCompiler_object_inline_stack_2522.return = workInProgress), - (JSCompiler_object_inline_componentStack_2523.return = + (JSCompiler_object_inline_componentStack_2474.flags |= 2), + (JSCompiler_object_inline_stack_2473.return = workInProgress), + (JSCompiler_object_inline_componentStack_2474.return = workInProgress), - (JSCompiler_object_inline_stack_2522.sibling = - JSCompiler_object_inline_componentStack_2523), - (workInProgress.child = JSCompiler_object_inline_stack_2522), + (JSCompiler_object_inline_stack_2473.sibling = + JSCompiler_object_inline_componentStack_2474), + (workInProgress.child = JSCompiler_object_inline_stack_2473), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2522 = workInProgress.child), - (JSCompiler_object_inline_stack_2522.memoizedState = + (JSCompiler_object_inline_stack_2473 = workInProgress.child), + (JSCompiler_object_inline_stack_2473.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2522.childLanes = + (JSCompiler_object_inline_stack_2473.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2521, + JSCompiler_object_inline_digest_2472, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2523)); + JSCompiler_object_inline_componentStack_2474)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2520.data === + JSCompiler_object_inline_message_2471.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2521 = - JSCompiler_object_inline_message_2520.nextSibling && - JSCompiler_object_inline_message_2520.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2521) { - JSCompiler_temp = JSCompiler_object_inline_digest_2521.dgst; - var message = JSCompiler_object_inline_digest_2521.msg; - instance = JSCompiler_object_inline_digest_2521.stck; - var componentStack = JSCompiler_object_inline_digest_2521.cstck; + JSCompiler_object_inline_digest_2472 = + JSCompiler_object_inline_message_2471.nextSibling && + JSCompiler_object_inline_message_2471.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2472) { + JSCompiler_temp = JSCompiler_object_inline_digest_2472.dgst; + var message = JSCompiler_object_inline_digest_2472.msg; + instance = JSCompiler_object_inline_digest_2472.stck; + var componentStack = JSCompiler_object_inline_digest_2472.cstck; } - JSCompiler_object_inline_message_2520 = message; - JSCompiler_object_inline_digest_2521 = JSCompiler_temp; - JSCompiler_object_inline_stack_2522 = instance; - JSCompiler_object_inline_componentStack_2523 = componentStack; - JSCompiler_object_inline_message_2520 = - JSCompiler_object_inline_message_2520 - ? Error(JSCompiler_object_inline_message_2520) + JSCompiler_object_inline_message_2471 = message; + JSCompiler_object_inline_digest_2472 = JSCompiler_temp; + JSCompiler_object_inline_stack_2473 = instance; + JSCompiler_object_inline_componentStack_2474 = componentStack; + JSCompiler_object_inline_message_2471 = + JSCompiler_object_inline_message_2471 + ? Error(JSCompiler_object_inline_message_2471) : 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_2520.stack = - JSCompiler_object_inline_stack_2522 || ""; - JSCompiler_object_inline_message_2520.digest = - JSCompiler_object_inline_digest_2521; - JSCompiler_object_inline_digest_2521 = - void 0 === JSCompiler_object_inline_componentStack_2523 + JSCompiler_object_inline_message_2471.stack = + JSCompiler_object_inline_stack_2473 || ""; + JSCompiler_object_inline_message_2471.digest = + JSCompiler_object_inline_digest_2472; + JSCompiler_object_inline_digest_2472 = + void 0 === JSCompiler_object_inline_componentStack_2474 ? null - : JSCompiler_object_inline_componentStack_2523; - "string" === typeof JSCompiler_object_inline_digest_2521 && + : JSCompiler_object_inline_componentStack_2474; + "string" === typeof JSCompiler_object_inline_digest_2472 && CapturedStacks.set( - JSCompiler_object_inline_message_2520, - JSCompiler_object_inline_digest_2521 + JSCompiler_object_inline_message_2471, + JSCompiler_object_inline_digest_2472 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2520, + value: JSCompiler_object_inline_message_2471, source: null, - stack: JSCompiler_object_inline_digest_2521 + stack: JSCompiler_object_inline_digest_2472 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9180,25 +9190,25 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2521 = + (JSCompiler_object_inline_digest_2472 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2521) + didReceiveUpdate || JSCompiler_object_inline_digest_2472) ) { - JSCompiler_object_inline_digest_2521 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2521) { - JSCompiler_object_inline_stack_2522 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2522 & 42)) - JSCompiler_object_inline_stack_2522 = 1; + JSCompiler_object_inline_digest_2472 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2472) { + JSCompiler_object_inline_stack_2473 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2473 & 42)) + JSCompiler_object_inline_stack_2473 = 1; else - switch (JSCompiler_object_inline_stack_2522) { + switch (JSCompiler_object_inline_stack_2473) { case 2: - JSCompiler_object_inline_stack_2522 = 1; + JSCompiler_object_inline_stack_2473 = 1; break; case 8: - JSCompiler_object_inline_stack_2522 = 4; + JSCompiler_object_inline_stack_2473 = 4; break; case 32: - JSCompiler_object_inline_stack_2522 = 16; + JSCompiler_object_inline_stack_2473 = 16; break; case 128: case 256: @@ -9219,40 +9229,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2522 = 64; + JSCompiler_object_inline_stack_2473 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2522 = 134217728; + JSCompiler_object_inline_stack_2473 = 134217728; break; default: - JSCompiler_object_inline_stack_2522 = 0; + JSCompiler_object_inline_stack_2473 = 0; } - JSCompiler_object_inline_stack_2522 = + JSCompiler_object_inline_stack_2473 = 0 !== - (JSCompiler_object_inline_stack_2522 & - (JSCompiler_object_inline_digest_2521.suspendedLanes | + (JSCompiler_object_inline_stack_2473 & + (JSCompiler_object_inline_digest_2472.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2522; + : JSCompiler_object_inline_stack_2473; if ( - 0 !== JSCompiler_object_inline_stack_2522 && - JSCompiler_object_inline_stack_2522 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2473 && + JSCompiler_object_inline_stack_2473 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2522), + ((prevState.retryLane = JSCompiler_object_inline_stack_2473), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2522 + JSCompiler_object_inline_stack_2473 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2521, + JSCompiler_object_inline_digest_2472, current, - JSCompiler_object_inline_stack_2522 + JSCompiler_object_inline_stack_2473 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2520.data === + JSCompiler_object_inline_message_2471.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9260,7 +9270,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2520.data === + JSCompiler_object_inline_message_2471.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9268,12 +9278,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2520._reactRetry = + (JSCompiler_object_inline_message_2471._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2520.nextSibling + JSCompiler_object_inline_message_2471.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9291,57 +9301,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2522.children + JSCompiler_object_inline_stack_2473.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2523) + if (JSCompiler_object_inline_componentStack_2474) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2523 = - JSCompiler_object_inline_stack_2522.fallback), - (JSCompiler_object_inline_message_2520 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2474 = + JSCompiler_object_inline_stack_2473.fallback), + (JSCompiler_object_inline_message_2471 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2522 = createWorkInProgress( + (JSCompiler_object_inline_stack_2473 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2522.children + children: JSCompiler_object_inline_stack_2473.children } )), - (JSCompiler_object_inline_stack_2522.subtreeFlags = + (JSCompiler_object_inline_stack_2473.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2523 = + ? (JSCompiler_object_inline_componentStack_2474 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2523 + JSCompiler_object_inline_componentStack_2474 )) - : ((JSCompiler_object_inline_componentStack_2523 = + : ((JSCompiler_object_inline_componentStack_2474 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2523, - JSCompiler_object_inline_message_2520, + JSCompiler_object_inline_componentStack_2474, + JSCompiler_object_inline_message_2471, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2523.flags |= 2)), - (JSCompiler_object_inline_componentStack_2523.return = + (JSCompiler_object_inline_componentStack_2474.flags |= 2)), + (JSCompiler_object_inline_componentStack_2474.return = workInProgress), - (JSCompiler_object_inline_stack_2522.return = workInProgress), - (JSCompiler_object_inline_stack_2522.sibling = - JSCompiler_object_inline_componentStack_2523), - (workInProgress.child = JSCompiler_object_inline_stack_2522), - (JSCompiler_object_inline_stack_2522 = - JSCompiler_object_inline_componentStack_2523), - (JSCompiler_object_inline_componentStack_2523 = workInProgress.child), - (JSCompiler_object_inline_message_2520 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2520 - ? (JSCompiler_object_inline_message_2520 = + (JSCompiler_object_inline_stack_2473.return = workInProgress), + (JSCompiler_object_inline_stack_2473.sibling = + JSCompiler_object_inline_componentStack_2474), + (workInProgress.child = JSCompiler_object_inline_stack_2473), + (JSCompiler_object_inline_stack_2473 = + JSCompiler_object_inline_componentStack_2474), + (JSCompiler_object_inline_componentStack_2474 = workInProgress.child), + (JSCompiler_object_inline_message_2471 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2471 + ? (JSCompiler_object_inline_message_2471 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2520.cachePool), + JSCompiler_object_inline_message_2471.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9349,34 +9359,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2520 = { + (JSCompiler_object_inline_message_2471 = { baseLanes: - JSCompiler_object_inline_message_2520.baseLanes | renderLanes, + JSCompiler_object_inline_message_2471.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2523.memoizedState = - JSCompiler_object_inline_message_2520), + (JSCompiler_object_inline_componentStack_2474.memoizedState = + JSCompiler_object_inline_message_2471), enableTransitionTracing && - ((JSCompiler_object_inline_message_2520 = enableTransitionTracing + ((JSCompiler_object_inline_message_2471 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2520 && + null !== JSCompiler_object_inline_message_2471 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2523.updateQueue), + JSCompiler_object_inline_componentStack_2474.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2523.updateQueue = { - transitions: JSCompiler_object_inline_message_2520, + ? (JSCompiler_object_inline_componentStack_2474.updateQueue = { + transitions: JSCompiler_object_inline_message_2471, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2523.updateQueue = + ? (JSCompiler_object_inline_componentStack_2474.updateQueue = { - transitions: JSCompiler_object_inline_message_2520, + transitions: JSCompiler_object_inline_message_2471, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9384,32 +9394,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2520), + JSCompiler_object_inline_message_2471), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2523.childLanes = + (JSCompiler_object_inline_componentStack_2474.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2521, + JSCompiler_object_inline_digest_2472, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2522 + JSCompiler_object_inline_stack_2473 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2522.children + children: JSCompiler_object_inline_stack_2473.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2521 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2521 + ((JSCompiler_object_inline_digest_2472 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2472 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2521.push(current)); + : JSCompiler_object_inline_digest_2472.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11943,7 +11953,11 @@ __DEV__ && (lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -11979,8 +11993,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -12022,7 +12043,13 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -12086,12 +12113,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -12105,50 +12185,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -12161,11 +12248,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -12177,16 +12265,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -12195,27 +12306,14 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } @@ -12225,27 +12323,29 @@ __DEV__ && 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); - } + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); } catch (error$21) { captureCommitPhaseError(finishedWork, finishedWork.return, error$21); } } function commitHostUpdate(finishedWork, newProps, oldProps) { try { - var domElement = finishedWork.stateNode; - updateProperties(domElement, finishedWork.type, oldProps, newProps); - domElement[internalPropsKey] = newProps; + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); } catch (error$22) { captureCommitPhaseError(finishedWork, finishedWork.return, error$22); } @@ -12322,6 +12422,50 @@ __DEV__ && 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." + ); + } + } + } function shouldProfile(current) { return ( (current.mode & ProfileMode) !== NoMode && @@ -12417,23 +12561,97 @@ __DEV__ && ) (anchorOffset = root[JSCompiler_temp]), doesFiberContain(anchorOffset, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - anchorOffset - ), - (_enabled = !1)); + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(anchorOffset)); root = firstChild.child; if (0 !== (firstChild.subtreeFlags & 9236) && null !== root) (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + if ( + (focusNode = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((focusNode = 13 === root.tag)) + a: { + if ( + null !== JSCompiler_temp && + ((focusNode = JSCompiler_temp.memoizedState), + null === focusNode || null !== focusNode.dehydrated) + ) { + focusNode = root.memoizedState; + focusNode = + null !== focusNode && null === focusNode.dehydrated; + break a; + } + focusNode = !1; + } + focusNode = + focusNode && doesFiberContain(root, focusedInstanceHandle); + } + focusNode && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(root)); + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.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: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; + case 3: + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + JSCompiler_temp === DOCUMENT_NODE) + ) + 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; @@ -12448,130 +12666,6 @@ __DEV__ && focusedInstanceHandle = null; return firstChild; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - finishedWork - ), - (_enabled = !1)); - } - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (var ii = 0; ii < finishedWork.length; ii++) - (current = finishedWork[ii]), - (current.ref.impl = current.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - JSCompiler_temp = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 { - (ii = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (flags = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== ii || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = ii); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (ii = finishedWork.nodeType), - ii === DOCUMENT_NODE) - ) - clearContainerSparingly(finishedWork); - else if (1 === ii) - 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 commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) switch (finishedWork.tag) { @@ -12604,97 +12698,95 @@ __DEV__ && } } } - 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -12710,7 +12802,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -12721,29 +12818,17 @@ __DEV__ && } 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 - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -12765,24 +12850,20 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - var newOffscreenSubtreeIsHidden = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -12790,11 +12871,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -12804,11 +12881,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -13090,24 +13163,25 @@ __DEV__ && offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParentIsContainer = hostParent; - var _prevHostParentIsContainer = hostParentIsContainer; + prevHostParent = hostParent; + prevHostParentIsContainer = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParentIsContainer; - hostParentIsContainer = _prevHostParentIsContainer; + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; if (null !== hostParent) if (hostParentIsContainer) try { - (finishedRoot = hostParent), - (prevHostParent = deletedFiber.stateNode), - finishedRoot.nodeType === COMMENT_NODE - ? finishedRoot.parentNode.removeChild(prevHostParent) - : finishedRoot.removeChild(prevHostParent); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -13117,7 +13191,12 @@ __DEV__ && } else try { - hostParent.removeChild(deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -13130,8 +13209,8 @@ __DEV__ && finishedRoot = finishedRoot.hydrationCallbacks; if (null !== finishedRoot) try { - (prevHostParentIsContainer = finishedRoot.onDeleted) && - prevHostParentIsContainer(deletedFiber.stateNode); + (prevHostParent = finishedRoot.onDeleted) && + prevHostParent(deletedFiber.stateNode); } catch (error$33) { captureCommitPhaseError( deletedFiber, @@ -13179,31 +13258,37 @@ __DEV__ && ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - _prevHostParentIsContainer = prevHostParentIsContainer.tag; - var inst = prevHostParentIsContainer.inst, + var tag = prevHostParentIsContainer.tag, + inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - ((_prevHostParentIsContainer & Insertion) !== NoFlags + ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy )) - : (_prevHostParentIsContainer & Layout) !== NoFlags && + : (tag & Layout) !== NoFlags && (enableSchedulingProfiler && markComponentLayoutEffectUnmountStarted(deletedFiber), 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 @@ -13273,7 +13358,11 @@ __DEV__ && ((current = current.dehydrated), null !== current)) ) { try { - retryIfBlockedOn(current); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + current + ); } catch (error$31) { captureCommitPhaseError( finishedWork, @@ -13367,20 +13456,10 @@ __DEV__ && 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++) { @@ -13420,16 +13499,10 @@ __DEV__ && } 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) { @@ -13437,7 +13510,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -13461,7 +13534,7 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13478,7 +13551,7 @@ __DEV__ && break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13518,15 +13591,16 @@ __DEV__ && flags = currentResource; break a; case "link": - var maybeNodes = getHydratableHoistableCache( - "link", - "href", - hoistableRoot - ).get(flags + (current.href || "")); - if (maybeNodes) - for (var i = 0; i < maybeNodes.length; i++) + if ( + (root = getHydratableHoistableCache( + "link", + "href", + hoistableRoot + ).get(flags + (current.href || ""))) + ) + for (var i = 0; i < root.length; i++) if ( - ((currentResource = maybeNodes[i]), + ((currentResource = root[i]), currentResource.getAttribute("href") === (null == current.href ? null : current.href) && currentResource.getAttribute("rel") === @@ -13540,7 +13614,7 @@ __DEV__ && ? null : current.crossOrigin)) ) { - maybeNodes.splice(i, 1); + root.splice(i, 1); break b; } currentResource = hoistableRoot.createElement(flags); @@ -13549,15 +13623,15 @@ __DEV__ && break; case "meta": if ( - (maybeNodes = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < maybeNodes.length; i++) + for (i = 0; i < root.length; i++) if ( - ((currentResource = maybeNodes[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" @@ -13583,7 +13657,7 @@ __DEV__ && ? null : current.charSet)) ) { - maybeNodes.splice(i, 1); + root.splice(i, 1); break b; } currentResource = hoistableRoot.createElement(flags); @@ -13646,48 +13720,27 @@ __DEV__ && hoistableRoot = finishedWork.stateNode; currentResource = finishedWork.memoizedProps; try { - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || + 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" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; } - var type = finishedWork.type; - if (getInstanceFromNode(hoistableRoot)) { - var tagName = hoistableRoot.tagName.toLowerCase(); - error$jscomp$0( - "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: - error$jscomp$0( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); - } - for ( - var attributes = hoistableRoot.attributes; - attributes.length; - - ) - hoistableRoot.removeAttributeNode(attributes[0]); - setInitialProperties(hoistableRoot, type, currentResource); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = currentResource; + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); } catch (error$32) { captureCommitPhaseError( finishedWork, @@ -13697,7 +13750,7 @@ __DEV__ && } } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13705,7 +13758,7 @@ __DEV__ && if (finishedWork.flags & 32) { hoistableRoot = finishedWork.stateNode; try { - setTextContent(hoistableRoot, ""); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); } catch (error$24) { captureCommitPhaseError( finishedWork, @@ -13730,7 +13783,7 @@ __DEV__ && )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) @@ -13738,9 +13791,16 @@ __DEV__ && "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); flags = finishedWork.memoizedProps; - current = finishedWork.stateNode; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - current.nodeValue = flags; + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + hoistableRoot, + current, + flags + ); } catch (error$23) { captureCommitPhaseError( finishedWork, @@ -13754,7 +13814,7 @@ __DEV__ && tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -13763,7 +13823,11 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); } catch (error$30) { captureCommitPhaseError( finishedWork, @@ -13779,12 +13843,12 @@ __DEV__ && 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 && ((hoistableRoot = null !== finishedWork.memoizedState), @@ -13824,14 +13888,14 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - node = null !== finishedWork.memoizedState; + i = null !== finishedWork.memoizedState; nextNode = null !== current && null !== current.memoizedState; nodeName = offscreenSubtreeIsHidden; - type = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = nodeName || node; - offscreenSubtreeWasHidden = type || nextNode; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = type; + suspenseCallback = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = suspenseCallback || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); + offscreenSubtreeWasHidden = suspenseCallback; offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; @@ -13840,10 +13904,10 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = node + ((root._visibility = i ? root._visibility & -2 : root._visibility | 1), - node && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || nextNode || @@ -13855,42 +13919,52 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - lanes = current = root; + nextNode = current = root; try { - if (((hoistableRoot = lanes.stateNode), node)) - (currentResource = hoistableRoot.style), - "function" === typeof currentResource.setProperty - ? currentResource.setProperty( - "display", - "none", - "important" - ) - : (currentResource.display = "none"); - else { - maybeNodes = lanes.stateNode; - i = lanes.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(); - } + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + nextNode, + nextNode.return, + error$25 + ); } } } else if (6 === root.tag) { if (null === current) { - lanes = root; + nextNode = root; try { - lanes.stateNode.nodeValue = node ? "" : lanes.memoizedProps; + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); } catch (error$26) { - captureCommitPhaseError(lanes, lanes.return, error$26); + captureCommitPhaseError( + nextNode, + nextNode.return, + error$26 + ); } } } else if ( @@ -13923,7 +13997,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -13932,7 +14006,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -13942,7 +14016,7 @@ __DEV__ && (finishedWork.stateNode[internalInstanceKey] = finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -13950,52 +14024,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - 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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -14015,27 +14044,13 @@ __DEV__ && 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) { @@ -14120,19 +14135,22 @@ __DEV__ && ); current = finishedWork.stateNode; "function" === typeof current.componentDidMount && - callComponentDidMountInDEV(finishedWork, current); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error$14) { captureCommitPhaseError( finishedWork, @@ -14229,9 +14247,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -14313,21 +14329,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -14336,9 +14337,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -14461,9 +14460,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( @@ -14528,9 +14525,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -14589,9 +14584,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( @@ -14646,70 +14639,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -14786,11 +14755,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -14834,7 +14799,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -14861,116 +14826,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - if (null !== sibling) { - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, + current, instance, offscreenFiber, null, - !1 - ))); + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function findFiberRootForHostRoot(hostRoot) { @@ -16579,8 +16535,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (lanes = 0; lanes < transitions.length; lanes++) @@ -21461,6 +21417,14 @@ __DEV__ && ? HostContextNamespaceNone : parentNamespace; } + function beforeActiveInstanceBlur(internalInstanceHandle) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("beforeblur", !0); + event._detachedInterceptFiber = internalInstanceHandle; + target.dispatchEvent(event); + _enabled = !1; + } function shouldSetTextContent(type, props) { return ( "textarea" === type || @@ -21492,21 +21456,48 @@ __DEV__ && 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 createEvent(type, bubbles) { var event = document.createEvent("Event"); event.initEvent(type, bubbles, !1); return event; } - function dispatchBeforeDetachedBlur(target, internalInstanceHandle) { - var event = createEvent("beforeblur", !0); - event._detachedInterceptFiber = internalInstanceHandle; - target.dispatchEvent(event); - } function dispatchAfterDetachedBlur(target) { var event = createEvent("afterblur", !1); event.relatedTarget = target; document.dispatchEvent(event); } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + container.nodeType === COMMENT_NODE + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -21530,6 +21521,27 @@ __DEV__ && } 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); @@ -21730,6 +21742,12 @@ __DEV__ && } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function getBoundingRect(node) { node = node.getBoundingClientRect(); return { @@ -21840,6 +21858,37 @@ __DEV__ && ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + error$jscomp$0( + "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: + error$jscomp$0( + "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() @@ -27097,11 +27146,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-modern-fe03c56d-20240905" !== isomorphicReactPackageVersion) + if ("19.0.0-www-modern-a03254bc-20240905" !== 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-www-modern-fe03c56d-20240905\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-modern-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27144,11 +27193,11 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.0.0-www-modern-fe03c56d-20240905", + version: "19.0.0-www-modern-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27919,5 +27968,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-modern-fe03c56d-20240905"; + exports.version = "19.0.0-www-modern-a03254bc-20240905"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 9cde792937..d6586bc325 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -8878,24 +8878,26 @@ function commitBeforeMutationEffects(root, firstChild) { break; case 1: if (0 !== (JSCompiler_temp & 1024) && null !== root) { - JSCompiler_temp = firstChild; - anchorOffset = root.memoizedProps; + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; root = root.memoizedState; - focusNode = JSCompiler_temp.stateNode; + selection = anchorOffset.stateNode; try { - var snapshot = focusNode.getSnapshotBeforeUpdate( - resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ), + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, root ); - focusNode.__reactInternalSnapshotBeforeUpdate = snapshot; + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; } catch (error) { captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, + anchorOffset, + anchorOffset.return, error ); } @@ -8925,10 +8927,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -17652,14 +17654,14 @@ function getCrossOriginStringAs(as, input) { } var isomorphicReactPackageVersion$jscomp$inline_1793 = React.version; if ( - "19.0.0-www-classic-fe03c56d-20240905" !== + "19.0.0-www-classic-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_1793 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1793, - "19.0.0-www-classic-fe03c56d-20240905" + "19.0.0-www-classic-a03254bc-20240905" ) ); function flushSyncFromReconciler(fn) { @@ -17704,11 +17706,11 @@ Internals.Events = [ ]; var internals$jscomp$inline_2292 = { bundleType: 0, - version: "19.0.0-www-classic-fe03c56d-20240905", + version: "19.0.0-www-classic-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2293 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -18315,4 +18317,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-fe03c56d-20240905"; +exports.version = "19.0.0-www-classic-a03254bc-20240905"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 8315f51f27..525643a20f 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -8446,24 +8446,26 @@ function commitBeforeMutationEffects(root, firstChild) { break; case 1: if (0 !== (JSCompiler_temp & 1024) && null !== root) { - JSCompiler_temp = firstChild; - anchorOffset = root.memoizedProps; + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; root = root.memoizedState; - focusNode = JSCompiler_temp.stateNode; + selection = anchorOffset.stateNode; try { - var snapshot = focusNode.getSnapshotBeforeUpdate( - resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ), + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, root ); - focusNode.__reactInternalSnapshotBeforeUpdate = snapshot; + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; } catch (error) { captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, + anchorOffset, + anchorOffset.return, error ); } @@ -8508,10 +8510,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -17028,14 +17030,14 @@ function getCrossOriginStringAs(as, input) { } var isomorphicReactPackageVersion$jscomp$inline_1764 = React.version; if ( - "19.0.0-www-modern-fe03c56d-20240905" !== + "19.0.0-www-modern-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_1764 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1764, - "19.0.0-www-modern-fe03c56d-20240905" + "19.0.0-www-modern-a03254bc-20240905" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17053,11 +17055,11 @@ Internals.Events = [ ]; var internals$jscomp$inline_2283 = { bundleType: 0, - version: "19.0.0-www-modern-fe03c56d-20240905", + version: "19.0.0-www-modern-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2284 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17571,4 +17573,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-fe03c56d-20240905"; +exports.version = "19.0.0-www-modern-a03254bc-20240905"; diff --git a/compiled/facebook-www/ReactReconciler-dev.classic.js b/compiled/facebook-www/ReactReconciler-dev.classic.js index 0f6246a29f..32b2f7b183 100644 --- a/compiled/facebook-www/ReactReconciler-dev.classic.js +++ b/compiled/facebook-www/ReactReconciler-dev.classic.js @@ -2715,6 +2715,16 @@ __DEV__ && ); 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) @@ -10677,7 +10687,11 @@ __DEV__ && (lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -10713,8 +10727,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -10756,7 +10777,13 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -10805,7 +10832,12 @@ __DEV__ && function commitClassDidMount(finishedWork) { var instance = finishedWork.stateNode; "function" === typeof instance.componentDidMount && - callComponentDidMountInDEV(finishedWork, instance); + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + instance + ); } function commitClassCallbacks(finishedWork) { var updateQueue = finishedWork.updateQueue; @@ -10825,12 +10857,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -10844,50 +10929,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = getPublicInstance(instance); + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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 = getPublicInstance(instance); - break; - default: - instanceToUse = instance; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -10900,11 +10992,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -10916,16 +11009,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -10934,27 +11050,14 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } @@ -10964,14 +11067,23 @@ __DEV__ && props = finishedWork.memoizedProps, instance = finishedWork.stateNode; try { - commitMount(instance, type, props, finishedWork); + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); } catch (error$21) { captureCommitPhaseError(finishedWork, finishedWork.return, error$21); } } function commitHostUpdate(finishedWork, newProps, oldProps) { try { - commitUpdate( + runWithFiberInDEV( + finishedWork, + commitUpdate, finishedWork.stateNode, finishedWork.type, oldProps, @@ -11053,6 +11165,55 @@ __DEV__ && insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); } + function commitPlacement(finishedWork) { + if ( + supportsMutation && + (!supportsSingletons || 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: + if (supportsSingletons) { + 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." + ); + } + } + } function commitHostPortalContainerChildren( portal, finishedWork, @@ -11060,7 +11221,12 @@ __DEV__ && ) { portal = portal.containerInfo; try { - replaceContainerChildren(portal, pendingChildren); + runWithFiberInDEV( + finishedWork, + replaceContainerChildren, + portal, + pendingChildren + ); } catch (error$31) { captureCommitPhaseError(finishedWork, finishedWork.return, error$31); } @@ -11088,8 +11254,76 @@ __DEV__ && (firstChild.return = root), (nextEffect = firstChild); else for (; null !== nextEffect; ) { - root = nextEffect; - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); + firstChild = root = nextEffect; + i = firstChild.alternate; + deletion = firstChild.flags; + var JSCompiler_temp; + if ( + (JSCompiler_temp = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((JSCompiler_temp = 13 === firstChild.tag)) + a: { + if ( + null !== i && + ((JSCompiler_temp = i.memoizedState), + null === JSCompiler_temp || + null !== JSCompiler_temp.dehydrated) + ) { + JSCompiler_temp = firstChild.memoizedState; + JSCompiler_temp = + null !== JSCompiler_temp && + null === JSCompiler_temp.dehydrated; + break a; + } + JSCompiler_temp = !1; + } + JSCompiler_temp = + JSCompiler_temp && + doesFiberContain(firstChild, focusedInstanceHandle); + } + JSCompiler_temp && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(firstChild)); + switch (firstChild.tag) { + case 0: + if ( + 0 !== (deletion & 4) && + ((firstChild = firstChild.updateQueue), + (firstChild = null !== firstChild ? firstChild.events : null), + null !== firstChild) + ) + for (i = 0; i < firstChild.length; i++) + (deletion = firstChild[i]), + (deletion.ref.impl = deletion.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (deletion & 1024) && + null !== i && + commitClassSnapshot(firstChild, i); + break; + case 3: + 0 !== (deletion & 1024) && + supportsMutation && + clearContainer(firstChild.stateNode.containerInfo); + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (deletion & 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." + ); + } firstChild = root.sibling; if (null !== firstChild) { firstChild.return = root.return; @@ -11104,112 +11338,6 @@ __DEV__ && focusedInstanceHandle = null; return root; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - ((shouldFireAfterActiveInstanceBlur = !0), - beforeActiveInstanceBlur(finishedWork)); - } - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (var ii = 0; ii < finishedWork.length; ii++) - (current = finishedWork[ii]), - (current.ref.impl = current.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - JSCompiler_temp = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 { - (ii = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (flags = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== ii || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = ii); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - 0 !== (flags & 1024) && - supportsMutation && - clearContainer(finishedWork.stateNode.containerInfo); - 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 commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) switch (finishedWork.tag) { @@ -11242,97 +11370,95 @@ __DEV__ && } } } - 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11350,7 +11476,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -11362,30 +11493,18 @@ __DEV__ && break; case 26: if (supportsResources) { - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; } case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -11407,25 +11526,24 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: if (disableLegacyMode || (finishedWork.mode & 1) !== NoMode) { - var newOffscreenSubtreeIsHidden = - null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if ( + ((prevProps = + null !== finishedWork.memoizedState || + offscreenSubtreeIsHidden), + !prevProps) + ) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11433,31 +11551,18 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } - } else - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -11751,7 +11856,12 @@ __DEV__ && ) if (hostParentIsContainer) try { - removeChildFromContainer(hostParent, deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -11761,7 +11871,12 @@ __DEV__ && } else try { - removeChild(hostParent, deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -11842,7 +11957,9 @@ __DEV__ && void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11853,14 +11970,18 @@ __DEV__ && 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 @@ -11936,7 +12057,11 @@ __DEV__ && ((current = current.dehydrated), null !== current)) ) { try { - commitHydratedSuspenseInstance(current); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + current + ); } catch (error$33) { captureCommitPhaseError( finishedWork, @@ -12030,20 +12155,10 @@ __DEV__ && 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++) { @@ -12085,16 +12200,10 @@ __DEV__ && } 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) { @@ -12102,7 +12211,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -12126,7 +12235,7 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12144,7 +12253,7 @@ __DEV__ && case 26: if (supportsResources) { var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12206,7 +12315,9 @@ __DEV__ && var props = finishedWork.memoizedProps; try { clearSingleton(hoistableRoot), - acquireSingletonInstance( + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, finishedWork.type, props, hoistableRoot, @@ -12221,7 +12332,7 @@ __DEV__ && } } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12230,7 +12341,7 @@ __DEV__ && if (finishedWork.flags & 32) { root = finishedWork.stateNode; try { - resetTextContent(root); + runWithFiberInDEV(finishedWork, resetTextContent, root); } catch (error$24) { captureCommitPhaseError( finishedWork, @@ -12256,7 +12367,7 @@ __DEV__ && } break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4 && supportsMutation) { if (null === finishedWork.stateNode) @@ -12267,7 +12378,13 @@ __DEV__ && current = null !== current ? current.memoizedProps : flags; root = finishedWork.stateNode; try { - commitTextUpdate(root, current, flags); + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + root, + current, + flags + ); } catch (error$23) { captureCommitPhaseError( finishedWork, @@ -12282,9 +12399,9 @@ __DEV__ && ? (prepareToCommitHoistables(), (hoistableRoot = currentHoistableRoot), (currentHoistableRoot = getHoistableRoot(root.containerInfo)), - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), (currentHoistableRoot = hoistableRoot)) - : recursivelyTraverseMutationEffects(root, finishedWork, lanes); + : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if ( @@ -12294,7 +12411,11 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - commitHydratedContainer(root.containerInfo); + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); } catch (error$32) { captureCommitPhaseError( finishedWork, @@ -12306,7 +12427,12 @@ __DEV__ && flags = root.containerInfo; current = root.pendingChildren; try { - replaceContainerChildren(flags, current); + runWithFiberInDEV( + finishedWork, + replaceContainerChildren, + flags, + current + ); } catch (error$30) { captureCommitPhaseError( finishedWork, @@ -12325,10 +12451,10 @@ __DEV__ && (currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo )), - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork), (currentHoistableRoot = current)) - : (recursivelyTraverseMutationEffects(root, finishedWork, lanes), + : (recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork)); flags & 4 && supportsPersistence && @@ -12339,7 +12465,7 @@ __DEV__ && ); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && ((root = null !== finishedWork.memoizedState), @@ -12385,10 +12511,10 @@ __DEV__ && prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - } else recursivelyTraverseMutationEffects(root, finishedWork, lanes); + } else recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12418,29 +12544,52 @@ __DEV__ && (supportsSingletons && 27 === root.tag) ) { if (null === current) { - lanes = current = root; + retryQueue = current = root; try { - (hoistableRoot = lanes.stateNode), + (hoistableRoot = retryQueue.stateNode), suspenseCallback - ? hideInstance(hoistableRoot) - : unhideInstance( - lanes.stateNode, - lanes.memoizedProps + ? runWithFiberInDEV( + retryQueue, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$25 + ); } } } else if (6 === root.tag) { if (null === current) { - lanes = root; + retryQueue = root; try { - (props = lanes.stateNode), + (props = retryQueue.stateNode), suspenseCallback - ? hideTextInstance(props) - : unhideTextInstance(props, lanes.memoizedProps); + ? runWithFiberInDEV( + retryQueue, + hideTextInstance, + props + ) + : runWithFiberInDEV( + retryQueue, + unhideTextInstance, + props, + retryQueue.memoizedProps + ); } catch (error$26) { - captureCommitPhaseError(lanes, lanes.return, error$26); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$26 + ); } } } else if ( @@ -12473,7 +12622,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12482,7 +12631,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -12491,7 +12640,7 @@ __DEV__ && flags & 4 && prepareScopeUpdate(finishedWork.stateNode, finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12499,57 +12648,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - if ( - supportsMutation && - (!supportsSingletons || 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: - if (supportsSingletons) { - 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 && - (resetTextContent(_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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -12571,27 +12670,13 @@ __DEV__ && 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) { @@ -12675,18 +12760,16 @@ __DEV__ && includeWorkInProgressEffects ); commitClassDidMount(finishedWork); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error$14) { captureCommitPhaseError( finishedWork, @@ -12783,9 +12866,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12867,21 +12948,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -12890,9 +12956,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -13016,9 +13080,7 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & 1 ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((nextCache._visibility |= 4), recursivelyTraversePassiveMountEffects( @@ -13090,9 +13152,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -13152,9 +13212,7 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & 1 ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( @@ -13217,70 +13275,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -13362,11 +13396,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -13410,7 +13440,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -13437,116 +13467,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - if (null !== sibling) { - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, + current, instance, offscreenFiber, null, - !1 - ))); + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function invokeLayoutEffectMountInDEV(fiber) { @@ -15187,8 +15208,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (lanes = 0; lanes < transitions.length; lanes++) @@ -19122,7 +19143,7 @@ __DEV__ && rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-dev.modern.js b/compiled/facebook-www/ReactReconciler-dev.modern.js index 97ccd7f58f..45da351d98 100644 --- a/compiled/facebook-www/ReactReconciler-dev.modern.js +++ b/compiled/facebook-www/ReactReconciler-dev.modern.js @@ -2614,6 +2614,16 @@ __DEV__ && ); 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) @@ -10289,7 +10299,11 @@ __DEV__ && (lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -10325,8 +10339,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -10368,7 +10389,13 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -10432,12 +10459,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -10451,50 +10531,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = getPublicInstance(instance); + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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 = getPublicInstance(instance); - break; - default: - instanceToUse = instance; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -10507,11 +10594,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -10523,16 +10611,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -10541,27 +10652,14 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } @@ -10571,14 +10669,23 @@ __DEV__ && props = finishedWork.memoizedProps, instance = finishedWork.stateNode; try { - commitMount(instance, type, props, finishedWork); + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); } catch (error$21) { captureCommitPhaseError(finishedWork, finishedWork.return, error$21); } } function commitHostUpdate(finishedWork, newProps, oldProps) { try { - commitUpdate( + runWithFiberInDEV( + finishedWork, + commitUpdate, finishedWork.stateNode, finishedWork.type, oldProps, @@ -10660,6 +10767,55 @@ __DEV__ && insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); } + function commitPlacement(finishedWork) { + if ( + supportsMutation && + (!supportsSingletons || 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: + if (supportsSingletons) { + 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." + ); + } + } + } function commitHostPortalContainerChildren( portal, finishedWork, @@ -10667,7 +10823,12 @@ __DEV__ && ) { portal = portal.containerInfo; try { - replaceContainerChildren(portal, pendingChildren); + runWithFiberInDEV( + finishedWork, + replaceContainerChildren, + portal, + pendingChildren + ); } catch (error$31) { captureCommitPhaseError(finishedWork, finishedWork.return, error$31); } @@ -10695,8 +10856,76 @@ __DEV__ && (firstChild.return = root), (nextEffect = firstChild); else for (; null !== nextEffect; ) { - root = nextEffect; - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); + firstChild = root = nextEffect; + i = firstChild.alternate; + deletion = firstChild.flags; + var JSCompiler_temp; + if ( + (JSCompiler_temp = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((JSCompiler_temp = 13 === firstChild.tag)) + a: { + if ( + null !== i && + ((JSCompiler_temp = i.memoizedState), + null === JSCompiler_temp || + null !== JSCompiler_temp.dehydrated) + ) { + JSCompiler_temp = firstChild.memoizedState; + JSCompiler_temp = + null !== JSCompiler_temp && + null === JSCompiler_temp.dehydrated; + break a; + } + JSCompiler_temp = !1; + } + JSCompiler_temp = + JSCompiler_temp && + doesFiberContain(firstChild, focusedInstanceHandle); + } + JSCompiler_temp && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(firstChild)); + switch (firstChild.tag) { + case 0: + if ( + 0 !== (deletion & 4) && + ((firstChild = firstChild.updateQueue), + (firstChild = null !== firstChild ? firstChild.events : null), + null !== firstChild) + ) + for (i = 0; i < firstChild.length; i++) + (deletion = firstChild[i]), + (deletion.ref.impl = deletion.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (deletion & 1024) && + null !== i && + commitClassSnapshot(firstChild, i); + break; + case 3: + 0 !== (deletion & 1024) && + supportsMutation && + clearContainer(firstChild.stateNode.containerInfo); + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (deletion & 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." + ); + } firstChild = root.sibling; if (null !== firstChild) { firstChild.return = root.return; @@ -10711,112 +10940,6 @@ __DEV__ && focusedInstanceHandle = null; return root; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - ((shouldFireAfterActiveInstanceBlur = !0), - beforeActiveInstanceBlur(finishedWork)); - } - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (var ii = 0; ii < finishedWork.length; ii++) - (current = finishedWork[ii]), - (current.ref.impl = current.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - JSCompiler_temp = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 { - (ii = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (flags = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== ii || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = ii); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - 0 !== (flags & 1024) && - supportsMutation && - clearContainer(finishedWork.stateNode.containerInfo); - 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 commitPassiveEffectDurations(finishedRoot, finishedWork) { if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) switch (finishedWork.tag) { @@ -10849,97 +10972,95 @@ __DEV__ && } } } - 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -10957,7 +11078,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -10969,30 +11095,18 @@ __DEV__ && break; case 26: if (supportsResources) { - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; } case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -11014,24 +11128,20 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - var newOffscreenSubtreeIsHidden = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11039,11 +11149,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11053,11 +11159,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -11351,7 +11453,12 @@ __DEV__ && ) if (hostParentIsContainer) try { - removeChildFromContainer(hostParent, deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -11361,7 +11468,12 @@ __DEV__ && } else try { - removeChild(hostParent, deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -11442,7 +11554,9 @@ __DEV__ && void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11453,14 +11567,18 @@ __DEV__ && 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 @@ -11530,7 +11648,11 @@ __DEV__ && ((current = current.dehydrated), null !== current)) ) { try { - commitHydratedSuspenseInstance(current); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + current + ); } catch (error$33) { captureCommitPhaseError( finishedWork, @@ -11624,20 +11746,10 @@ __DEV__ && 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++) { @@ -11679,16 +11791,10 @@ __DEV__ && } 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) { @@ -11696,7 +11802,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -11720,7 +11826,7 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -11738,7 +11844,7 @@ __DEV__ && case 26: if (supportsResources) { var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -11800,7 +11906,9 @@ __DEV__ && var props = finishedWork.memoizedProps; try { clearSingleton(hoistableRoot), - acquireSingletonInstance( + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, finishedWork.type, props, hoistableRoot, @@ -11815,7 +11923,7 @@ __DEV__ && } } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -11824,7 +11932,7 @@ __DEV__ && if (finishedWork.flags & 32) { root = finishedWork.stateNode; try { - resetTextContent(root); + runWithFiberInDEV(finishedWork, resetTextContent, root); } catch (error$24) { captureCommitPhaseError( finishedWork, @@ -11850,7 +11958,7 @@ __DEV__ && } break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4 && supportsMutation) { if (null === finishedWork.stateNode) @@ -11861,7 +11969,13 @@ __DEV__ && current = null !== current ? current.memoizedProps : flags; root = finishedWork.stateNode; try { - commitTextUpdate(root, current, flags); + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + root, + current, + flags + ); } catch (error$23) { captureCommitPhaseError( finishedWork, @@ -11876,9 +11990,9 @@ __DEV__ && ? (prepareToCommitHoistables(), (hoistableRoot = currentHoistableRoot), (currentHoistableRoot = getHoistableRoot(root.containerInfo)), - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), (currentHoistableRoot = hoistableRoot)) - : recursivelyTraverseMutationEffects(root, finishedWork, lanes); + : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if ( @@ -11888,7 +12002,11 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - commitHydratedContainer(root.containerInfo); + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); } catch (error$32) { captureCommitPhaseError( finishedWork, @@ -11900,7 +12018,12 @@ __DEV__ && flags = root.containerInfo; current = root.pendingChildren; try { - replaceContainerChildren(flags, current); + runWithFiberInDEV( + finishedWork, + replaceContainerChildren, + flags, + current + ); } catch (error$30) { captureCommitPhaseError( finishedWork, @@ -11919,10 +12042,10 @@ __DEV__ && (currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo )), - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork), (currentHoistableRoot = current)) - : (recursivelyTraverseMutationEffects(root, finishedWork, lanes), + : (recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork)); flags & 4 && supportsPersistence && @@ -11933,7 +12056,7 @@ __DEV__ && ); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && ((root = null !== finishedWork.memoizedState), @@ -11978,7 +12101,7 @@ __DEV__ && prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; commitReconciliationEffects(finishedWork); @@ -12009,29 +12132,52 @@ __DEV__ && (supportsSingletons && 27 === root.tag) ) { if (null === current) { - lanes = current = root; + retryQueue = current = root; try { - (hoistableRoot = lanes.stateNode), + (hoistableRoot = retryQueue.stateNode), suspenseCallback - ? hideInstance(hoistableRoot) - : unhideInstance( - lanes.stateNode, - lanes.memoizedProps + ? runWithFiberInDEV( + retryQueue, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$25 + ); } } } else if (6 === root.tag) { if (null === current) { - lanes = root; + retryQueue = root; try { - (props = lanes.stateNode), + (props = retryQueue.stateNode), suspenseCallback - ? hideTextInstance(props) - : unhideTextInstance(props, lanes.memoizedProps); + ? runWithFiberInDEV( + retryQueue, + hideTextInstance, + props + ) + : runWithFiberInDEV( + retryQueue, + unhideTextInstance, + props, + retryQueue.memoizedProps + ); } catch (error$26) { - captureCommitPhaseError(lanes, lanes.return, error$26); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$26 + ); } } } else if ( @@ -12064,7 +12210,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12073,7 +12219,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -12082,7 +12228,7 @@ __DEV__ && flags & 4 && prepareScopeUpdate(finishedWork.stateNode, finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12090,57 +12236,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - if ( - supportsMutation && - (!supportsSingletons || 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: - if (supportsSingletons) { - 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 && - (resetTextContent(_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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -12162,27 +12258,13 @@ __DEV__ && 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) { @@ -12267,19 +12349,22 @@ __DEV__ && ); current = finishedWork.stateNode; "function" === typeof current.componentDidMount && - callComponentDidMountInDEV(finishedWork, current); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error$14) { captureCommitPhaseError( finishedWork, @@ -12376,9 +12461,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12460,21 +12543,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -12483,9 +12551,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12608,9 +12674,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : nextCache._visibility & 4 ? recursivelyTraversePassiveMountEffects( @@ -12675,9 +12739,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12736,9 +12798,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( @@ -12793,70 +12853,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -12938,11 +12974,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -12986,7 +13018,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -13013,116 +13045,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; + var fiber = nextEffect, + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } } - if (null !== sibling) { - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } - } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, + current, instance, offscreenFiber, null, - !1 - ))); + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); + else + a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; + } + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function findFiberRootForHostRoot(hostRoot) { @@ -14694,8 +14717,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (lanes = 0; lanes < transitions.length; lanes++) @@ -18514,7 +18537,7 @@ __DEV__ && rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-prod.classic.js b/compiled/facebook-www/ReactReconciler-prod.classic.js index 38ef6fb137..ec6ea8937d 100644 --- a/compiled/facebook-www/ReactReconciler-prod.classic.js +++ b/compiled/facebook-www/ReactReconciler-prod.classic.js @@ -7653,22 +7653,24 @@ module.exports = function ($$$config) { break; case 1: if (0 !== (i & 1024) && null !== firstChild) { - i = root; - deletion = firstChild.memoizedProps; + i = void 0; + deletion = root; + var prevProps = firstChild.memoizedProps; firstChild = firstChild.memoizedState; - var instance = i.stateNode; + var instance = deletion.stateNode; try { - var snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - i.type, - deletion, - i.elementType === i.type - ), + var resolvedPrevProps = resolveClassComponentProps( + deletion.type, + prevProps, + deletion.elementType === deletion.type + ); + i = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, firstChild ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + instance.__reactInternalSnapshotBeforeUpdate = i; } catch (error) { - captureCommitPhaseError(i, i.return, error); + captureCommitPhaseError(deletion, deletion.return, error); } } break; @@ -7696,10 +7698,10 @@ module.exports = function ($$$config) { nextEffect = root.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -12771,7 +12773,7 @@ module.exports = function ($$$config) { rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-prod.modern.js b/compiled/facebook-www/ReactReconciler-prod.modern.js index 1d74b76024..913d037eb1 100644 --- a/compiled/facebook-www/ReactReconciler-prod.modern.js +++ b/compiled/facebook-www/ReactReconciler-prod.modern.js @@ -7254,22 +7254,24 @@ module.exports = function ($$$config) { break; case 1: if (0 !== (i & 1024) && null !== firstChild) { - i = root; - deletion = firstChild.memoizedProps; + i = void 0; + deletion = root; + var prevProps = firstChild.memoizedProps; firstChild = firstChild.memoizedState; - var instance = i.stateNode; + var instance = deletion.stateNode; try { - var snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - i.type, - deletion, - i.elementType === i.type - ), + var resolvedPrevProps = resolveClassComponentProps( + deletion.type, + prevProps, + deletion.elementType === deletion.type + ); + i = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, firstChild ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + instance.__reactInternalSnapshotBeforeUpdate = i; } catch (error) { - captureCommitPhaseError(i, i.return, error); + captureCommitPhaseError(deletion, deletion.return, error); } } break; @@ -7297,10 +7299,10 @@ module.exports = function ($$$config) { nextEffect = root.return; } } - snapshot = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return snapshot; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -12264,7 +12266,7 @@ module.exports = function ($$$config) { rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 4d075c4dfd..3076ecafc6 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -13,7 +13,7 @@ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1088() { + function JSCompiler_object_inline_createNodeMock_1107() { return null; } function findHook(fiber, id) { @@ -1026,6 +1026,27 @@ __DEV__ && child = parentInstance.children.indexOf(child); parentInstance.children.splice(child, 1); } + function commitUpdate(instance, type, oldProps, newProps) { + instance.type = type; + instance.props = newProps; + } + function commitMount() {} + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.text = newText; + } + function resetTextContent() {} + function hideInstance(instance) { + instance.isHidden = !0; + } + function hideTextInstance(textInstance) { + textInstance.isHidden = !0; + } + function unhideInstance(instance) { + instance.isHidden = !1; + } + function unhideTextInstance(textInstance) { + textInstance.isHidden = !1; + } function getInstanceFromNode(mockNode) { mockNode = nodeToInstanceMap.get(mockNode); return void 0 !== mockNode ? mockNode.internalInstanceHandle : null; @@ -2248,6 +2269,16 @@ __DEV__ && ); 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) @@ -8591,7 +8622,11 @@ __DEV__ && ((lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), void 0 !== lastEffect && "function" !== typeof lastEffect) @@ -8614,8 +8649,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -8646,7 +8688,13 @@ __DEV__ && ((inst.destroy = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1)); } @@ -8686,7 +8734,12 @@ __DEV__ && function commitClassDidMount(finishedWork) { var instance = finishedWork.stateNode; "function" === typeof instance.componentDidMount && - callComponentDidMountInDEV(finishedWork, instance); + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + instance + ); } function commitClassCallbacks(finishedWork) { var updateQueue = finishedWork.updateQueue; @@ -8706,12 +8759,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -8725,50 +8831,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = getPublicInstance(instance); + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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 = getPublicInstance(instance); - break; - default: - instanceToUse = instance; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -8781,11 +8894,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -8797,16 +8911,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -8815,31 +8952,35 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } + } function isHostParent(fiber) { return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; } @@ -8896,6 +9037,43 @@ __DEV__ && insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); } + function commitPlacement(finishedWork) { + 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: + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && (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." + ); + } + } function shouldProfile(current) { return ( 0 !== (current.mode & 2) && @@ -8912,8 +9090,37 @@ __DEV__ && (firstChild.return = root), (nextEffect = firstChild); else for (; null !== nextEffect; ) { - root = nextEffect; - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); + firstChild = root = nextEffect; + var current = firstChild.alternate, + flags = firstChild.flags; + switch (firstChild.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(firstChild, current); + break; + case 3: + 0 !== (flags & 1024) && + firstChild.stateNode.containerInfo.children.splice(0); + 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." + ); + } firstChild = root.sibling; if (null !== firstChild) { firstChild.return = root.return; @@ -8926,169 +9133,95 @@ __DEV__ && shouldFireAfterActiveInstanceBlur = !1; return root; } - 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 && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 snapshot = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - prevState - ); - flags = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== snapshot || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = snapshot; - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - 0 !== (flags & 1024) && - finishedWork.stateNode.containerInfo.children.splice(0); - 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 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -9106,7 +9239,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -9119,19 +9257,12 @@ __DEV__ && case 26: case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -9153,22 +9284,18 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 22: - var newOffscreenSubtreeIsHidden = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -9176,11 +9303,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -9190,11 +9313,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -9266,7 +9385,12 @@ __DEV__ && if (null !== hostParent) if (hostParentIsContainer) try { - removeChildFromContainer(hostParent, deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -9276,7 +9400,12 @@ __DEV__ && } else try { - removeChild(hostParent, deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -9335,7 +9464,9 @@ __DEV__ && void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -9344,14 +9475,18 @@ __DEV__ && (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 @@ -9441,11 +9576,7 @@ __DEV__ && (retryCache.add(wakeable), wakeable.then(retry, retry)); }); } - 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++) { @@ -9485,16 +9616,10 @@ __DEV__ && } 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) { @@ -9502,7 +9627,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -9526,7 +9651,7 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -9548,17 +9673,43 @@ __DEV__ && case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); + if (finishedWork.flags & 32) { + existingHiddenCallbacks = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + resetTextContent, + existingHiddenCallbacks + ); + } catch (error$24) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$24 + ); + } + } if (flags & 4 && null != finishedWork.stateNode) { existingHiddenCallbacks = finishedWork.memoizedProps; + var oldProps = + null !== current + ? current.memoizedProps + : existingHiddenCallbacks; try { - var instance = finishedWork.stateNode; - instance.type = finishedWork.type; - instance.props = existingHiddenCallbacks; + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + existingHiddenCallbacks, + finishedWork + ); } catch (error$22) { captureCommitPhaseError( finishedWork, @@ -9574,7 +9725,7 @@ __DEV__ && ); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) @@ -9582,9 +9733,17 @@ __DEV__ && "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); flags = finishedWork.memoizedProps; - existingHiddenCallbacks = finishedWork.stateNode; + existingHiddenCallbacks = + null !== current ? current.memoizedProps : flags; + oldProps = finishedWork.stateNode; try { - existingHiddenCallbacks.text = flags; + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + oldProps, + existingHiddenCallbacks, + flags + ); } catch (error$23) { captureCommitPhaseError( finishedWork, @@ -9595,15 +9754,15 @@ __DEV__ && } break; case 3: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; case 4: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -9638,16 +9797,17 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - instance = null !== finishedWork.memoizedState; - suspenseCallback = null !== current && null !== current.memoizedState; - retryQueue = offscreenSubtreeIsHidden; - var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = retryQueue || instance; + suspenseCallback = null !== finishedWork.memoizedState; + retryQueue = null !== current && null !== current.memoizedState; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || suspenseCallback; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = retryQueue; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -9655,13 +9815,13 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = instance + ((root._visibility = suspenseCallback ? root._visibility & -2 : root._visibility | 1), - instance && + suspenseCallback && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - suspenseCallback || + retryQueue || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -9670,23 +9830,52 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag) { if (null === current) { - lanes = current = root; + retryQueue = current = root; try { - (existingHiddenCallbacks = lanes.stateNode), - instance - ? (existingHiddenCallbacks.isHidden = !0) - : (lanes.stateNode.isHidden = !1); + (existingHiddenCallbacks = retryQueue.stateNode), + suspenseCallback + ? runWithFiberInDEV( + retryQueue, + hideInstance, + existingHiddenCallbacks + ) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps + ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$25 + ); } } } else if (6 === root.tag) { if (null === current) { - lanes = root; + retryQueue = root; try { - lanes.stateNode.isHidden = instance ? !0 : !1; + (oldProps = retryQueue.stateNode), + suspenseCallback + ? runWithFiberInDEV( + retryQueue, + hideTextInstance, + oldProps + ) + : runWithFiberInDEV( + retryQueue, + unhideTextInstance, + oldProps, + retryQueue.memoizedProps + ); } catch (error$26) { - captureCommitPhaseError(lanes, lanes.return, error$26); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$26 + ); } } } else if ( @@ -9722,7 +9911,7 @@ __DEV__ && )))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -9731,7 +9920,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -9741,7 +9930,7 @@ __DEV__ && nodeToInstanceMap.set(finishedWork.stateNode, finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -9749,41 +9938,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && (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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -9791,17 +9946,10 @@ __DEV__ && } flags & 4096 && (finishedWork.flags &= -4097); } - 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 recursivelyTraverseDisappearLayoutEffects(parentFiber) { @@ -9859,142 +10007,132 @@ __DEV__ && parentFiber = parentFiber.sibling; } } - function reappearLayoutEffects( - finishedRoot, - current, - finishedWork, - includeWorkInProgressEffects + function recursivelyTraverseReappearLayoutEffects( + finishedRoot$jscomp$0, + parentFiber, + includeWorkInProgressEffects$jscomp$0 ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - commitHookLayoutEffects(finishedWork, Layout); - break; - case 1: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - commitClassDidMount(finishedWork); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; - try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); - } catch (error$14) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$14 - ); - } - } - includeWorkInProgressEffects && - flags & 64 && - commitClassCallbacks(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 26: - case 27: - case 5: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - 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( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - break; - case 22: - null === finishedWork.memoizedState && + includeWorkInProgressEffects$jscomp$0 = + includeWorkInProgressEffects$jscomp$0 && + 0 !== (parentFiber.subtreeFlags & 8772); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + current = parentFiber.alternate, + finishedWork = parentFiber, + includeWorkInProgressEffects = includeWorkInProgressEffects$jscomp$0, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: recursivelyTraverseReappearLayoutEffects( finishedRoot, finishedWork, includeWorkInProgressEffects ); - safelyAttachRef(finishedWork, finishedWork.return); - break; - default: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); + commitHookLayoutEffects(finishedWork, Layout); + break; + case 1: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + commitClassDidMount(finishedWork); + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + runWithFiberInDEV( + current, + commitHiddenCallbacks, + finishedRoot, + instance + ); + } catch (error$14) { + captureCommitPhaseError(current, current.return, error$14); + } + } + includeWorkInProgressEffects && + flags & 64 && + commitClassCallbacks(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 26: + case 27: + case 5: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 12: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + 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( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + break; + case 22: + null === finishedWork.memoizedState && + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + safelyAttachRef(finishedWork, finishedWork.return); + break; + default: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + } + parentFiber = parentFiber.sibling; } } - function recursivelyTraverseReappearLayoutEffects( - finishedRoot, - parentFiber, - includeWorkInProgressEffects - ) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, - finishedRoot, - parentFiber.alternate, - parentFiber, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -10025,9 +10163,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -10085,9 +10221,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : _instance._visibility & 4 ? recursivelyTraversePassiveMountEffects( @@ -10130,161 +10264,134 @@ __DEV__ && } } function recursivelyTraverseReconnectPassiveEffects( - finishedRoot, + finishedRoot$jscomp$0, parentFiber, - committedLanes, - committedTransitions, - includeWorkInProgressEffects + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + includeWorkInProgressEffects$jscomp$0 ) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && + includeWorkInProgressEffects$jscomp$0 = + includeWorkInProgressEffects$jscomp$0 && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); - } - function reconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - commitHookPassiveMountEffects(finishedWork, Passive); - break; - case 23: - break; - case 22: - var _instance2 = finishedWork.stateNode; - null !== finishedWork.memoizedState - ? _instance2._visibility & 4 - ? recursivelyTraverseReconnectPassiveEffects( + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + includeWorkInProgressEffects = includeWorkInProgressEffects$jscomp$0, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + commitHookPassiveMountEffects(finishedWork, Passive); + break; + case 23: + break; + case 22: + var _instance2 = finishedWork.stateNode; + null !== finishedWork.memoizedState + ? _instance2._visibility & 4 + ? recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((_instance2._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, includeWorkInProgressEffects - ) - : recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((_instance2._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )); - includeWorkInProgressEffects && - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork + )); + includeWorkInProgressEffects && + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects ); - break; - case 24: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); + includeWorkInProgressEffects && + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + } + parentFiber = parentFiber.sibling; } } 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) @@ -10352,11 +10459,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -10399,30 +10502,29 @@ __DEV__ && } detachAlternateSiblings(parentFiber); } - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), - (parentFiber = parentFiber.sibling); - } - function disconnectPassiveEffect(finishedWork) { - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - finishedWork, - finishedWork.return, - Passive - ); - recursivelyTraverseDisconnectPassiveEffects(finishedWork); - break; - case 22: - var instance = finishedWork.stateNode; - instance._visibility & 4 && - ((instance._visibility &= -5), - recursivelyTraverseDisconnectPassiveEffects(finishedWork)); - break; - default: - recursivelyTraverseDisconnectPassiveEffects(finishedWork); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + deletions = parentFiber; + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + deletions, + deletions.return, + Passive + ); + recursivelyTraverseDisconnectPassiveEffects(deletions); + break; + case 22: + i = deletions.stateNode; + i._visibility & 4 && + ((i._visibility &= -5), + recursivelyTraverseDisconnectPassiveEffects(deletions)); + break; + default: + recursivelyTraverseDisconnectPassiveEffects(deletions); + } + parentFiber = parentFiber.sibling; } } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( @@ -10430,22 +10532,37 @@ __DEV__ && 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; } @@ -10458,31 +10575,6 @@ __DEV__ && } } } - 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 invokeLayoutEffectMountInDEV(fiber) { switch (fiber.tag) { case 0: @@ -11561,22 +11653,9 @@ __DEV__ && executionContext |= CommitContext; commitBeforeMutationEffects(root, finishedWork); commitTime = now(); - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - didIncludeRenderPhaseUpdate - ); + commitMutationEffectsOnFiber(finishedWork, root); root.current = finishedWork; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - didIncludeRenderPhaseUpdate - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); requestPaint(); executionContext = prevExecutionContext; currentUpdatePriority = spawnedLane; @@ -11678,55 +11757,40 @@ __DEV__ && didScheduleUpdateDuringPassiveEffects = !1; 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: @@ -14886,11 +14950,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-www-classic-fe03c56d-20240905", + version: "19.0.0-www-classic-a03254bc-20240905", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-classic-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -14910,7 +14974,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1088, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1107, isConcurrentOnly = !0 !== global.IS_REACT_NATIVE_TEST_ENVIRONMENT, isConcurrent = isConcurrentOnly, isStrictMode = !1; @@ -15025,5 +15089,5 @@ __DEV__ && exports.unstable_batchedUpdates = function (fn, a) { return fn(a); }; - exports.version = "19.0.0-www-classic-fe03c56d-20240905"; + exports.version = "19.0.0-www-classic-a03254bc-20240905"; })(); diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 7ae70bdc21..23e0aad945 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -13,7 +13,7 @@ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1088() { + function JSCompiler_object_inline_createNodeMock_1107() { return null; } function findHook(fiber, id) { @@ -1026,6 +1026,27 @@ __DEV__ && child = parentInstance.children.indexOf(child); parentInstance.children.splice(child, 1); } + function commitUpdate(instance, type, oldProps, newProps) { + instance.type = type; + instance.props = newProps; + } + function commitMount() {} + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.text = newText; + } + function resetTextContent() {} + function hideInstance(instance) { + instance.isHidden = !0; + } + function hideTextInstance(textInstance) { + textInstance.isHidden = !0; + } + function unhideInstance(instance) { + instance.isHidden = !1; + } + function unhideTextInstance(textInstance) { + textInstance.isHidden = !1; + } function getInstanceFromNode(mockNode) { mockNode = nodeToInstanceMap.get(mockNode); return void 0 !== mockNode ? mockNode.internalInstanceHandle : null; @@ -2248,6 +2269,16 @@ __DEV__ && ); 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) @@ -8591,7 +8622,11 @@ __DEV__ && ((lastEffect = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - (lastEffect = callCreateInDEV(updateQueue)), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), void 0 !== lastEffect && "function" !== typeof lastEffect) @@ -8614,8 +8649,15 @@ __DEV__ && 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; - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", + runWithFiberInDEV( + finishedWork, + function (n, a) { + error$jscomp$0( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, hookName, addendum ); @@ -8646,7 +8688,13 @@ __DEV__ && ((inst.destroy = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1)); } @@ -8686,7 +8734,12 @@ __DEV__ && function commitClassDidMount(finishedWork) { var instance = finishedWork.stateNode; "function" === typeof instance.componentDidMount && - callComponentDidMountInDEV(finishedWork, instance); + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + instance + ); } function commitClassCallbacks(finishedWork) { var updateQueue = finishedWork.updateQueue; @@ -8706,12 +8759,65 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); try { - commitCallbacks(updateQueue, instance); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); } catch (error$13) { captureCommitPhaseError(finishedWork, finishedWork.return, error$13); } } } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -8725,50 +8831,57 @@ __DEV__ && instance.state = current.memoizedState; shouldProfile$1(current) ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ), recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, current, nearestMountedAncestor, instance ); } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = getPublicInstance(instance); + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } 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 = getPublicInstance(instance); - break; - default: - instanceToUse = instance; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile$1(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } + runWithFiberInDEV(current, commitAttachRef, current); } catch (error$17) { captureCommitPhaseError(current, nearestMountedAncestor, error$17); } @@ -8781,11 +8894,12 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), refCleanup(); + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); } finally { recordLayoutEffectDuration(current); } - else refCleanup(); + else runWithFiberInDEV(current, refCleanup); } catch (error$18) { captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { @@ -8797,16 +8911,39 @@ __DEV__ && try { if (shouldProfile$1(current)) try { - startLayoutEffectTimer(), ref(null); + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { recordLayoutEffectDuration(current); } - else ref(null); + else runWithFiberInDEV(current, ref, null); } catch (error$19) { captureCommitPhaseError(current, nearestMountedAncestor, error$19); } 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, @@ -8815,31 +8952,35 @@ __DEV__ && ) { if (executionContext & CommitContext) 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 - ); + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); } catch (error$20) { captureCommitPhaseError(finishedWork, finishedWork.return, error$20); } } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } + } function isHostParent(fiber) { return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; } @@ -8896,6 +9037,43 @@ __DEV__ && insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); } + function commitPlacement(finishedWork) { + 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: + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && (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." + ); + } + } function shouldProfile(current) { return ( 0 !== (current.mode & 2) && @@ -8912,8 +9090,37 @@ __DEV__ && (firstChild.return = root), (nextEffect = firstChild); else for (; null !== nextEffect; ) { - root = nextEffect; - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); + firstChild = root = nextEffect; + var current = firstChild.alternate, + flags = firstChild.flags; + switch (firstChild.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(firstChild, current); + break; + case 3: + 0 !== (flags & 1024) && + firstChild.stateNode.containerInfo.children.splice(0); + 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." + ); + } firstChild = root.sibling; if (null !== firstChild) { firstChild.return = root.return; @@ -8926,169 +9133,95 @@ __DEV__ && shouldFireAfterActiveInstanceBlur = !1; return root; } - 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 && - error$jscomp$0( - "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 && - error$jscomp$0( - "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 snapshot = current.getSnapshotBeforeUpdate( - resolveClassComponentProps( - finishedWork.type, - flags, - finishedWork.elementType === finishedWork.type - ), - prevState - ); - flags = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== snapshot || - flags.has(finishedWork.type) || - (flags.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = snapshot; - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } - } - break; - case 3: - 0 !== (flags & 1024) && - finishedWork.stateNode.containerInfo.children.splice(0); - 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 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 - ); - flags & 4 && - ((finishedRoot = finishedWork.stateNode), - null === current - ? (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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" - )), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + if (((finishedRoot = finishedWork.stateNode), null === current)) + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot)) - : ((committedLanes = resolveClassComponentProps( - finishedWork.type, - current.memoizedProps, - finishedWork.elementType === finishedWork.type - )), - (current = current.memoizedState), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidUpdate. 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" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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$1(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( finishedWork, - finishedRoot, - committedLanes, - current, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ))); + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); + else { + var prevProps = resolveClassComponentProps( + finishedWork.type, + current.memoizedProps, + finishedWork.elementType === finishedWork.type + ); + current = current.memoizedState; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidUpdate. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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$1(finishedWork) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ), + recordLayoutEffectDuration(finishedWork)) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate + ); + } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -9106,7 +9239,12 @@ __DEV__ && finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error$15) { captureCommitPhaseError( finishedWork, @@ -9119,19 +9257,12 @@ __DEV__ && case 26: case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) a: for ( flags = finishedWork.stateNode.effectDuration, @@ -9153,22 +9284,18 @@ __DEV__ && } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 22: - var newOffscreenSubtreeIsHidden = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!newOffscreenSubtreeIsHidden) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -9176,11 +9303,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -9190,11 +9313,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -9266,7 +9385,12 @@ __DEV__ && if (null !== hostParent) if (hostParentIsContainer) try { - removeChildFromContainer(hostParent, deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); } catch (error$28) { captureCommitPhaseError( deletedFiber, @@ -9276,7 +9400,12 @@ __DEV__ && } else try { - removeChild(hostParent, deletedFiber.stateNode); + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); } catch (error$29) { captureCommitPhaseError( deletedFiber, @@ -9335,7 +9464,9 @@ __DEV__ && void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -9344,14 +9475,18 @@ __DEV__ && (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 @@ -9441,11 +9576,7 @@ __DEV__ && (retryCache.add(wakeable), wakeable.then(retry, retry)); }); } - 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++) { @@ -9485,16 +9616,10 @@ __DEV__ && } 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) { @@ -9502,7 +9627,7 @@ __DEV__ && case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && (commitHookEffectListUnmount( @@ -9526,7 +9651,7 @@ __DEV__ && )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -9548,17 +9673,43 @@ __DEV__ && case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); + if (finishedWork.flags & 32) { + existingHiddenCallbacks = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + resetTextContent, + existingHiddenCallbacks + ); + } catch (error$24) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$24 + ); + } + } if (flags & 4 && null != finishedWork.stateNode) { existingHiddenCallbacks = finishedWork.memoizedProps; + var oldProps = + null !== current + ? current.memoizedProps + : existingHiddenCallbacks; try { - var instance = finishedWork.stateNode; - instance.type = finishedWork.type; - instance.props = existingHiddenCallbacks; + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + existingHiddenCallbacks, + finishedWork + ); } catch (error$22) { captureCommitPhaseError( finishedWork, @@ -9574,7 +9725,7 @@ __DEV__ && ); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) @@ -9582,9 +9733,17 @@ __DEV__ && "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); flags = finishedWork.memoizedProps; - existingHiddenCallbacks = finishedWork.stateNode; + existingHiddenCallbacks = + null !== current ? current.memoizedProps : flags; + oldProps = finishedWork.stateNode; try { - existingHiddenCallbacks.text = flags; + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + oldProps, + existingHiddenCallbacks, + flags + ); } catch (error$23) { captureCommitPhaseError( finishedWork, @@ -9595,15 +9754,15 @@ __DEV__ && } break; case 3: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; case 4: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -9638,16 +9797,17 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - instance = null !== finishedWork.memoizedState; - suspenseCallback = null !== current && null !== current.memoizedState; - retryQueue = offscreenSubtreeIsHidden; - var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = retryQueue || instance; + suspenseCallback = null !== finishedWork.memoizedState; + retryQueue = null !== current && null !== current.memoizedState; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = + prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = - prevOffscreenSubtreeWasHidden || suspenseCallback; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + prevOffscreenSubtreeWasHidden || retryQueue; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = retryQueue; + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -9655,13 +9815,13 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = instance + ((root._visibility = suspenseCallback ? root._visibility & -2 : root._visibility | 1), - instance && + suspenseCallback && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - suspenseCallback || + retryQueue || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -9670,23 +9830,52 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag) { if (null === current) { - lanes = current = root; + retryQueue = current = root; try { - (existingHiddenCallbacks = lanes.stateNode), - instance - ? (existingHiddenCallbacks.isHidden = !0) - : (lanes.stateNode.isHidden = !1); + (existingHiddenCallbacks = retryQueue.stateNode), + suspenseCallback + ? runWithFiberInDEV( + retryQueue, + hideInstance, + existingHiddenCallbacks + ) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps + ); } catch (error$25) { - captureCommitPhaseError(lanes, lanes.return, error$25); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$25 + ); } } } else if (6 === root.tag) { if (null === current) { - lanes = root; + retryQueue = root; try { - lanes.stateNode.isHidden = instance ? !0 : !1; + (oldProps = retryQueue.stateNode), + suspenseCallback + ? runWithFiberInDEV( + retryQueue, + hideTextInstance, + oldProps + ) + : runWithFiberInDEV( + retryQueue, + unhideTextInstance, + oldProps, + retryQueue.memoizedProps + ); } catch (error$26) { - captureCommitPhaseError(lanes, lanes.return, error$26); + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$26 + ); } } } else if ( @@ -9722,7 +9911,7 @@ __DEV__ && )))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -9731,7 +9920,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -9741,7 +9930,7 @@ __DEV__ && nodeToInstanceMap.set(finishedWork.stateNode, finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -9749,41 +9938,7 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && (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$27) { captureCommitPhaseError(finishedWork, finishedWork.return, error$27); } @@ -9791,17 +9946,10 @@ __DEV__ && } flags & 4096 && (finishedWork.flags &= -4097); } - 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 recursivelyTraverseDisappearLayoutEffects(parentFiber) { @@ -9859,142 +10007,132 @@ __DEV__ && parentFiber = parentFiber.sibling; } } - function reappearLayoutEffects( - finishedRoot, - current, - finishedWork, - includeWorkInProgressEffects + function recursivelyTraverseReappearLayoutEffects( + finishedRoot$jscomp$0, + parentFiber, + includeWorkInProgressEffects$jscomp$0 ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - commitHookLayoutEffects(finishedWork, Layout); - break; - case 1: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - commitClassDidMount(finishedWork); - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - current = finishedWork.stateNode; - try { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], current); - } catch (error$14) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$14 - ); - } - } - includeWorkInProgressEffects && - flags & 64 && - commitClassCallbacks(finishedWork); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 26: - case 27: - case 5: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - safelyAttachRef(finishedWork, finishedWork.return); - break; - case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - 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( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - break; - case 22: - null === finishedWork.memoizedState && + includeWorkInProgressEffects$jscomp$0 = + includeWorkInProgressEffects$jscomp$0 && + 0 !== (parentFiber.subtreeFlags & 8772); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + current = parentFiber.alternate, + finishedWork = parentFiber, + includeWorkInProgressEffects = includeWorkInProgressEffects$jscomp$0, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: recursivelyTraverseReappearLayoutEffects( finishedRoot, finishedWork, includeWorkInProgressEffects ); - safelyAttachRef(finishedWork, finishedWork.return); - break; - default: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); + commitHookLayoutEffects(finishedWork, Layout); + break; + case 1: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + commitClassDidMount(finishedWork); + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + runWithFiberInDEV( + current, + commitHiddenCallbacks, + finishedRoot, + instance + ); + } catch (error$14) { + captureCommitPhaseError(current, current.return, error$14); + } + } + includeWorkInProgressEffects && + flags & 64 && + commitClassCallbacks(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 26: + case 27: + case 5: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); + safelyAttachRef(finishedWork, finishedWork.return); + break; + case 12: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + 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( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + break; + case 22: + null === finishedWork.memoizedState && + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + safelyAttachRef(finishedWork, finishedWork.return); + break; + default: + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + } + parentFiber = parentFiber.sibling; } } - function recursivelyTraverseReappearLayoutEffects( - finishedRoot, - parentFiber, - includeWorkInProgressEffects - ) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, - finishedRoot, - parentFiber.alternate, - parentFiber, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -10025,9 +10163,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -10085,9 +10221,7 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) : _instance._visibility & 4 ? recursivelyTraversePassiveMountEffects( @@ -10130,161 +10264,134 @@ __DEV__ && } } function recursivelyTraverseReconnectPassiveEffects( - finishedRoot, + finishedRoot$jscomp$0, parentFiber, - committedLanes, - committedTransitions, - includeWorkInProgressEffects + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + includeWorkInProgressEffects$jscomp$0 ) { - includeWorkInProgressEffects = - includeWorkInProgressEffects && + includeWorkInProgressEffects$jscomp$0 = + includeWorkInProgressEffects$jscomp$0 && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); - } - function reconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - commitHookPassiveMountEffects(finishedWork, Passive); - break; - case 23: - break; - case 22: - var _instance2 = finishedWork.stateNode; - null !== finishedWork.memoizedState - ? _instance2._visibility & 4 - ? recursivelyTraverseReconnectPassiveEffects( + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + includeWorkInProgressEffects = includeWorkInProgressEffects$jscomp$0, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 15: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + commitHookPassiveMountEffects(finishedWork, Passive); + break; + case 23: + break; + case 22: + var _instance2 = finishedWork.stateNode; + null !== finishedWork.memoizedState + ? _instance2._visibility & 4 + ? recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((_instance2._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, includeWorkInProgressEffects - ) - : recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((_instance2._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )); - includeWorkInProgressEffects && - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork + )); + includeWorkInProgressEffects && + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects ); - break; - case 24: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); + includeWorkInProgressEffects && + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + ); + } + parentFiber = parentFiber.sibling; } } 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) @@ -10352,11 +10459,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -10399,30 +10502,29 @@ __DEV__ && } detachAlternateSiblings(parentFiber); } - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), - (parentFiber = parentFiber.sibling); - } - function disconnectPassiveEffect(finishedWork) { - switch (finishedWork.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - finishedWork, - finishedWork.return, - Passive - ); - recursivelyTraverseDisconnectPassiveEffects(finishedWork); - break; - case 22: - var instance = finishedWork.stateNode; - instance._visibility & 4 && - ((instance._visibility &= -5), - recursivelyTraverseDisconnectPassiveEffects(finishedWork)); - break; - default: - recursivelyTraverseDisconnectPassiveEffects(finishedWork); + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + deletions = parentFiber; + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + deletions, + deletions.return, + Passive + ); + recursivelyTraverseDisconnectPassiveEffects(deletions); + break; + case 22: + i = deletions.stateNode; + i._visibility & 4 && + ((i._visibility &= -5), + recursivelyTraverseDisconnectPassiveEffects(deletions)); + break; + default: + recursivelyTraverseDisconnectPassiveEffects(deletions); + } + parentFiber = parentFiber.sibling; } } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( @@ -10430,22 +10532,37 @@ __DEV__ && 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; } @@ -10458,31 +10575,6 @@ __DEV__ && } } } - 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 invokeLayoutEffectMountInDEV(fiber) { switch (fiber.tag) { case 0: @@ -11561,22 +11653,9 @@ __DEV__ && executionContext |= CommitContext; commitBeforeMutationEffects(root, finishedWork); commitTime = now(); - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - didIncludeRenderPhaseUpdate - ); + commitMutationEffectsOnFiber(finishedWork, root); root.current = finishedWork; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - didIncludeRenderPhaseUpdate - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); requestPaint(); executionContext = prevExecutionContext; currentUpdatePriority = spawnedLane; @@ -11678,55 +11757,40 @@ __DEV__ && didScheduleUpdateDuringPassiveEffects = !1; 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: @@ -14886,11 +14950,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-www-modern-fe03c56d-20240905", + version: "19.0.0-www-modern-a03254bc-20240905", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-fe03c56d-20240905" + reconcilerVersion: "19.0.0-www-modern-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -14910,7 +14974,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1088, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1107, isConcurrentOnly = !0 !== global.IS_REACT_NATIVE_TEST_ENVIRONMENT, isConcurrent = isConcurrentOnly, isStrictMode = !1; @@ -15025,5 +15089,5 @@ __DEV__ && exports.unstable_batchedUpdates = function (fn, a) { return fn(a); }; - exports.version = "19.0.0-www-modern-fe03c56d-20240905"; + exports.version = "19.0.0-www-modern-a03254bc-20240905"; })(); diff --git a/compiled/facebook-www/VERSION_CLASSIC b/compiled/facebook-www/VERSION_CLASSIC index 6483743ebd..3636778f2d 100644 --- a/compiled/facebook-www/VERSION_CLASSIC +++ b/compiled/facebook-www/VERSION_CLASSIC @@ -1 +1 @@ -19.0.0-www-classic-fe03c56d-20240905 \ No newline at end of file +19.0.0-www-classic-a03254bc-20240905 \ No newline at end of file diff --git a/compiled/facebook-www/VERSION_MODERN b/compiled/facebook-www/VERSION_MODERN index 9b51e85a6a..826df41b57 100644 --- a/compiled/facebook-www/VERSION_MODERN +++ b/compiled/facebook-www/VERSION_MODERN @@ -1 +1 @@ -19.0.0-www-modern-fe03c56d-20240905 \ No newline at end of file +19.0.0-www-modern-a03254bc-20240905 \ No newline at end of file