From 64facb3eb98e571d9a06f48add42af28f604919e Mon Sep 17 00:00:00 2001 From: rickhanlonii Date: Wed, 22 Mar 2023 17:18:33 +0000 Subject: [PATCH] Fix enableClientRenderFallbackOnTextMismatch flag (#26457) With this flag off, we don't throw and therefore don't patch up the tree when suppression is off. Haven't tested. --------- Co-authored-by: Rick Hanlon DiffTrain build for [afb3d51dc6310f0dbeffdd303eb3c6895e6f7db0](https://github.com/facebook/react/commit/afb3d51dc6310f0dbeffdd303eb3c6895e6f7db0) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/React-dev.modern.js | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 2 +- compiled/facebook-www/ReactART-prod.modern.js | 4 +- compiled/facebook-www/ReactDOM-dev.classic.js | 8 +- compiled/facebook-www/ReactDOM-dev.modern.js | 8 +- .../facebook-www/ReactDOM-prod.classic.js | 126 ++++++++---------- compiled/facebook-www/ReactDOM-prod.modern.js | 126 ++++++++---------- .../ReactDOM-profiling.classic.js | 126 ++++++++---------- .../facebook-www/ReactDOM-profiling.modern.js | 126 ++++++++---------- .../ReactDOMTesting-dev.classic.js | 8 +- .../ReactDOMTesting-dev.modern.js | 8 +- .../ReactDOMTesting-prod.classic.js | 126 ++++++++---------- .../ReactDOMTesting-prod.modern.js | 126 ++++++++---------- .../ReactTestRenderer-dev.modern.js | 2 +- 15 files changed, 334 insertions(+), 466 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index d00ce2bb83e83..dd906bc893ced 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -b93b4f07454298e99012201a5ecdd195a41baa50 +afb3d51dc6310f0dbeffdd303eb3c6895e6f7db0 diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 539e49d858ed0..d311460335ab9 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-www-modern-36a2211a"; +var ReactVersion = "18.3.0-www-modern-b3a4de20"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 4aa9da73c726b..b02cfc9ff0a70 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-classic-20a03402"; +var ReactVersion = "18.3.0-www-classic-ac5037f5"; var LegacyRoot = 0; var ConcurrentRoot = 1; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 88f1548a030ba..18a265719215d 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -9627,7 +9627,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "18.3.0-www-modern-7b2876d5", + version: "18.3.0-www-modern-22ca78ee", rendererPackageName: "react-art" }; var internals$jscomp$inline_1312 = { @@ -9658,7 +9658,7 @@ var internals$jscomp$inline_1312 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-7b2876d5" + reconcilerVersion: "18.3.0-www-modern-22ca78ee" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1313 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index e9c0aa6a3f26b..7435e403779b1 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -6948,7 +6948,7 @@ function diffHydratedProperties( ); } - if (!isConcurrentMode) { + if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) { updatePayload = ["children", children]; } } @@ -14134,7 +14134,7 @@ function prepareToHydrateHostTextInstance(fiber) { shouldWarnIfMismatchDev ); - if (isConcurrentMode) { + if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) { // In concurrent mode we never update the mismatched text, // even if the error was ignored. return false; @@ -14162,7 +14162,7 @@ function prepareToHydrateHostTextInstance(fiber) { shouldWarnIfMismatchDev ); - if (_isConcurrentMode2) { + if (_isConcurrentMode2 && enableClientRenderFallbackOnTextMismatch) { // In concurrent mode we never update the mismatched text, // even if the error was ignored. return false; @@ -39144,7 +39144,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-01e3cef5"; +var ReactVersion = "18.3.0-www-classic-51af468f"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index bc4274ed5d36e..923f473210e09 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -8591,7 +8591,7 @@ function prepareToHydrateHostTextInstance(fiber) { shouldWarnIfMismatchDev ); - if (isConcurrentMode) { + if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) { // In concurrent mode we never update the mismatched text, // even if the error was ignored. return false; @@ -8619,7 +8619,7 @@ function prepareToHydrateHostTextInstance(fiber) { shouldWarnIfMismatchDev ); - if (_isConcurrentMode2) { + if (_isConcurrentMode2 && enableClientRenderFallbackOnTextMismatch) { // In concurrent mode we never update the mismatched text, // even if the error was ignored. return false; @@ -33507,7 +33507,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-7b2876d5"; +var ReactVersion = "18.3.0-www-modern-22ca78ee"; function createPortal$1( children, @@ -40247,7 +40247,7 @@ function diffHydratedProperties( ); } - if (!isConcurrentMode) { + if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) { updatePayload = ["children", children]; } } diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index e8ba49f20a990..2430e52a89b17 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -3146,7 +3146,6 @@ function prepareToHydrateHostInstance(fiber) { props = fiber.memoizedProps; instance[internalInstanceKey] = fiber; instance[internalPropsKey] = props; - var isConcurrentMode = 0 !== (fiber.mode & 1); switch (type) { case "dialog": listenToNonDelegatedEvent("cancel", instance); @@ -3188,19 +3187,15 @@ function prepareToHydrateHostInstance(fiber) { } props.hasOwnProperty("onScroll") && listenToNonDelegatedEvent("scroll", instance); - i = null; - var children = props.children; - if ( - ("string" === typeof children || "number" === typeof children) && - instance.textContent !== "" + children - ) { - if (!0 !== props.suppressHydrationWarning) { - var serverText = instance.textContent; - normalizeMarkupForTextOrAttribute(children); - normalizeMarkupForTextOrAttribute(serverText); - } - isConcurrentMode || (i = ["children", children]); - } + var updatePayload = null; + i = props.children; + ("string" !== typeof i && "number" !== typeof i) || + instance.textContent === "" + i || + (!0 !== props.suppressHydrationWarning && + ((updatePayload = instance.textContent), + normalizeMarkupForTextOrAttribute(i), + normalizeMarkupForTextOrAttribute(updatePayload)), + (updatePayload = ["children", i])); switch (type) { case "input": track(instance); @@ -3216,7 +3211,7 @@ function prepareToHydrateHostInstance(fiber) { default: "function" === typeof props.onClick && (instance.onclick = noop$1); } - instance = i; + instance = updatePayload; fiber.updateQueue = instance; return null !== instance ? !0 : !1; } @@ -8109,43 +8104,25 @@ function completeWork(current, workInProgress, renderLanes) { throw Error(formatProdErrorMessage(166)); current = rootInstanceStackCursor.current; if (popHydrationState(workInProgress)) { - a: { - newProps = workInProgress.stateNode; - current = workInProgress.memoizedProps; - newProps[internalInstanceKey] = workInProgress; - if ((renderLanes = newProps.nodeValue !== current)) { - var returnFiber = hydrationParentFiber; - if (null !== returnFiber) - switch (returnFiber.tag) { - case 3: - type = 0 !== (returnFiber.mode & 1); - newProps = newProps.nodeValue; - normalizeMarkupForTextOrAttribute(current); - normalizeMarkupForTextOrAttribute(newProps); - if (type) { - current = !1; - break a; - } - break; - case 27: - case 5: - if ( - ((type = 0 !== (returnFiber.mode & 1)), - !0 !== - returnFiber.memoizedProps.suppressHydrationWarning && - ((newProps = newProps.nodeValue), - normalizeMarkupForTextOrAttribute(current), - normalizeMarkupForTextOrAttribute(newProps)), - type) - ) { - current = !1; - break a; - } - } - } - current = renderLanes; - } - current && markUpdate(workInProgress); + newProps = workInProgress.stateNode; + current = workInProgress.memoizedProps; + newProps[internalInstanceKey] = workInProgress; + if ((renderLanes = newProps.nodeValue !== current)) + if (((type = hydrationParentFiber), null !== type)) + switch (type.tag) { + case 3: + newProps = newProps.nodeValue; + normalizeMarkupForTextOrAttribute(current); + normalizeMarkupForTextOrAttribute(newProps); + break; + case 27: + case 5: + !0 !== type.memoizedProps.suppressHydrationWarning && + ((newProps = newProps.nodeValue), + normalizeMarkupForTextOrAttribute(current), + normalizeMarkupForTextOrAttribute(newProps)); + } + renderLanes && markUpdate(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -8201,18 +8178,19 @@ function completeWork(current, workInProgress, renderLanes) { return (workInProgress.lanes = renderLanes), workInProgress; renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - renderLanes && - ((newProps = workInProgress.child), - (type = null), + if (renderLanes) { + newProps = workInProgress.child; + type = null; null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && - (type = newProps.alternate.memoizedState.cachePool.pool), - (returnFiber = null), + (type = newProps.alternate.memoizedState.cachePool.pool); + var cache$142 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (returnFiber = newProps.memoizedState.cachePool.pool), - returnFiber !== type && (newProps.flags |= 2048)); + (cache$142 = newProps.memoizedState.cachePool.pool); + cache$142 !== type && (newProps.flags |= 2048); + } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), renderLanes && (workInProgress.child.flags |= 8192)); @@ -8247,8 +8225,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - returnFiber = type.rendering; - if (null === returnFiber) + cache$142 = type.rendering; + if (null === cache$142) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -8256,11 +8234,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - returnFiber = findFirstSuspended(current); - if (null !== returnFiber) { + cache$142 = findFirstSuspended(current); + if (null !== cache$142) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = returnFiber.updateQueue; + current = cache$142.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8285,7 +8263,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(returnFiber)), null !== current)) { + if (((current = findFirstSuspended(cache$142)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8295,7 +8273,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !returnFiber.alternate && + !cache$142.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8308,13 +8286,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 8388608)); type.isBackwards - ? ((returnFiber.sibling = workInProgress.child), - (workInProgress.child = returnFiber)) + ? ((cache$142.sibling = workInProgress.child), + (workInProgress.child = cache$142)) : ((current = type.last), null !== current - ? (current.sibling = returnFiber) - : (workInProgress.child = returnFiber), - (type.last = returnFiber)); + ? (current.sibling = cache$142) + : (workInProgress.child = cache$142), + (type.last = cache$142)); } if (null !== type.tail) return ( @@ -15830,7 +15808,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1775 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-0ef6286c", + version: "18.3.0-www-classic-1f5575cc", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2155 = { @@ -15860,7 +15838,7 @@ var internals$jscomp$inline_2155 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-0ef6286c" + reconcilerVersion: "18.3.0-www-classic-1f5575cc" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2156 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16100,4 +16078,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-0ef6286c"; +exports.version = "18.3.0-www-classic-1f5575cc"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 8b28dfed50ad6..22900be914286 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -1829,7 +1829,6 @@ function prepareToHydrateHostInstance(fiber) { props = fiber.memoizedProps; instance[internalInstanceKey] = fiber; instance[internalPropsKey] = props; - var isConcurrentMode = 0 !== (fiber.mode & 1); switch (type) { case "dialog": listenToNonDelegatedEvent("cancel", instance); @@ -1871,19 +1870,15 @@ function prepareToHydrateHostInstance(fiber) { } props.hasOwnProperty("onScroll") && listenToNonDelegatedEvent("scroll", instance); - i = null; - var children = props.children; - if ( - ("string" === typeof children || "number" === typeof children) && - instance.textContent !== "" + children - ) { - if (!0 !== props.suppressHydrationWarning) { - var serverText = instance.textContent; - normalizeMarkupForTextOrAttribute(children); - normalizeMarkupForTextOrAttribute(serverText); - } - isConcurrentMode || (i = ["children", children]); - } + var updatePayload = null; + i = props.children; + ("string" !== typeof i && "number" !== typeof i) || + instance.textContent === "" + i || + (!0 !== props.suppressHydrationWarning && + ((updatePayload = instance.textContent), + normalizeMarkupForTextOrAttribute(i), + normalizeMarkupForTextOrAttribute(updatePayload)), + (updatePayload = ["children", i])); switch (type) { case "input": track(instance); @@ -1899,7 +1894,7 @@ function prepareToHydrateHostInstance(fiber) { default: "function" === typeof props.onClick && (instance.onclick = noop); } - instance = i; + instance = updatePayload; fiber.updateQueue = instance; return null !== instance ? !0 : !1; } @@ -6731,43 +6726,25 @@ function completeWork(current, workInProgress, renderLanes) { throw Error(formatProdErrorMessage(166)); current = rootInstanceStackCursor.current; if (popHydrationState(workInProgress)) { - a: { - newProps = workInProgress.stateNode; - current = workInProgress.memoizedProps; - newProps[internalInstanceKey] = workInProgress; - if ((renderLanes = newProps.nodeValue !== current)) { - var returnFiber = hydrationParentFiber; - if (null !== returnFiber) - switch (returnFiber.tag) { - case 3: - type = 0 !== (returnFiber.mode & 1); - newProps = newProps.nodeValue; - normalizeMarkupForTextOrAttribute(current); - normalizeMarkupForTextOrAttribute(newProps); - if (type) { - current = !1; - break a; - } - break; - case 27: - case 5: - if ( - ((type = 0 !== (returnFiber.mode & 1)), - !0 !== - returnFiber.memoizedProps.suppressHydrationWarning && - ((newProps = newProps.nodeValue), - normalizeMarkupForTextOrAttribute(current), - normalizeMarkupForTextOrAttribute(newProps)), - type) - ) { - current = !1; - break a; - } - } - } - current = renderLanes; - } - current && markUpdate(workInProgress); + newProps = workInProgress.stateNode; + current = workInProgress.memoizedProps; + newProps[internalInstanceKey] = workInProgress; + if ((renderLanes = newProps.nodeValue !== current)) + if (((type = hydrationParentFiber), null !== type)) + switch (type.tag) { + case 3: + newProps = newProps.nodeValue; + normalizeMarkupForTextOrAttribute(current); + normalizeMarkupForTextOrAttribute(newProps); + break; + case 27: + case 5: + !0 !== type.memoizedProps.suppressHydrationWarning && + ((newProps = newProps.nodeValue), + normalizeMarkupForTextOrAttribute(current), + normalizeMarkupForTextOrAttribute(newProps)); + } + renderLanes && markUpdate(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -6823,18 +6800,19 @@ function completeWork(current, workInProgress, renderLanes) { return (workInProgress.lanes = renderLanes), workInProgress; renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - renderLanes && - ((newProps = workInProgress.child), - (type = null), + if (renderLanes) { + newProps = workInProgress.child; + type = null; null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && - (type = newProps.alternate.memoizedState.cachePool.pool), - (returnFiber = null), + (type = newProps.alternate.memoizedState.cachePool.pool); + var cache$110 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (returnFiber = newProps.memoizedState.cachePool.pool), - returnFiber !== type && (newProps.flags |= 2048)); + (cache$110 = newProps.memoizedState.cachePool.pool); + cache$110 !== type && (newProps.flags |= 2048); + } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), renderLanes && (workInProgress.child.flags |= 8192)); @@ -6865,8 +6843,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - returnFiber = type.rendering; - if (null === returnFiber) + cache$110 = type.rendering; + if (null === cache$110) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -6874,11 +6852,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - returnFiber = findFirstSuspended(current); - if (null !== returnFiber) { + cache$110 = findFirstSuspended(current); + if (null !== cache$110) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = returnFiber.updateQueue; + current = cache$110.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6903,7 +6881,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(returnFiber)), null !== current)) { + if (((current = findFirstSuspended(cache$110)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6913,7 +6891,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !returnFiber.alternate && + !cache$110.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -6926,13 +6904,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 8388608)); type.isBackwards - ? ((returnFiber.sibling = workInProgress.child), - (workInProgress.child = returnFiber)) + ? ((cache$110.sibling = workInProgress.child), + (workInProgress.child = cache$110)) : ((current = type.last), null !== current - ? (current.sibling = returnFiber) - : (workInProgress.child = returnFiber), - (type.last = returnFiber)); + ? (current.sibling = cache$110) + : (workInProgress.child = cache$110), + (type.last = cache$110)); } if (null !== type.tail) return ( @@ -15353,7 +15331,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1745 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-f3cbd027", + version: "18.3.0-www-modern-5315d9ff", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2143 = { @@ -15384,7 +15362,7 @@ var internals$jscomp$inline_2143 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-f3cbd027" + reconcilerVersion: "18.3.0-www-modern-5315d9ff" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2144 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -15553,4 +15531,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-f3cbd027"; +exports.version = "18.3.0-www-modern-5315d9ff"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 2093669af5bda..faa8d6147025c 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -3290,7 +3290,6 @@ function prepareToHydrateHostInstance(fiber) { props = fiber.memoizedProps; instance[internalInstanceKey] = fiber; instance[internalPropsKey] = props; - var isConcurrentMode = 0 !== (fiber.mode & 1); switch (type) { case "dialog": listenToNonDelegatedEvent("cancel", instance); @@ -3332,19 +3331,15 @@ function prepareToHydrateHostInstance(fiber) { } props.hasOwnProperty("onScroll") && listenToNonDelegatedEvent("scroll", instance); - i = null; - var children = props.children; - if ( - ("string" === typeof children || "number" === typeof children) && - instance.textContent !== "" + children - ) { - if (!0 !== props.suppressHydrationWarning) { - var serverText = instance.textContent; - normalizeMarkupForTextOrAttribute(children); - normalizeMarkupForTextOrAttribute(serverText); - } - isConcurrentMode || (i = ["children", children]); - } + var updatePayload = null; + i = props.children; + ("string" !== typeof i && "number" !== typeof i) || + instance.textContent === "" + i || + (!0 !== props.suppressHydrationWarning && + ((updatePayload = instance.textContent), + normalizeMarkupForTextOrAttribute(i), + normalizeMarkupForTextOrAttribute(updatePayload)), + (updatePayload = ["children", i])); switch (type) { case "input": track(instance); @@ -3360,7 +3355,7 @@ function prepareToHydrateHostInstance(fiber) { default: "function" === typeof props.onClick && (instance.onclick = noop$1); } - instance = i; + instance = updatePayload; fiber.updateQueue = instance; return null !== instance ? !0 : !1; } @@ -8391,43 +8386,25 @@ function completeWork(current, workInProgress, renderLanes) { throw Error(formatProdErrorMessage(166)); current = rootInstanceStackCursor.current; if (popHydrationState(workInProgress)) { - a: { - newProps = workInProgress.stateNode; - current = workInProgress.memoizedProps; - newProps[internalInstanceKey] = workInProgress; - if ((renderLanes = newProps.nodeValue !== current)) { - var returnFiber = hydrationParentFiber; - if (null !== returnFiber) - switch (returnFiber.tag) { - case 3: - type = 0 !== (returnFiber.mode & 1); - newProps = newProps.nodeValue; - normalizeMarkupForTextOrAttribute(current); - normalizeMarkupForTextOrAttribute(newProps); - if (type) { - current = !1; - break a; - } - break; - case 27: - case 5: - if ( - ((type = 0 !== (returnFiber.mode & 1)), - !0 !== - returnFiber.memoizedProps.suppressHydrationWarning && - ((newProps = newProps.nodeValue), - normalizeMarkupForTextOrAttribute(current), - normalizeMarkupForTextOrAttribute(newProps)), - type) - ) { - current = !1; - break a; - } - } - } - current = renderLanes; - } - current && markUpdate(workInProgress); + newProps = workInProgress.stateNode; + current = workInProgress.memoizedProps; + newProps[internalInstanceKey] = workInProgress; + if ((renderLanes = newProps.nodeValue !== current)) + if (((type = hydrationParentFiber), null !== type)) + switch (type.tag) { + case 3: + newProps = newProps.nodeValue; + normalizeMarkupForTextOrAttribute(current); + normalizeMarkupForTextOrAttribute(newProps); + break; + case 27: + case 5: + !0 !== type.memoizedProps.suppressHydrationWarning && + ((newProps = newProps.nodeValue), + normalizeMarkupForTextOrAttribute(current), + normalizeMarkupForTextOrAttribute(newProps)); + } + renderLanes && markUpdate(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -8499,18 +8476,19 @@ function completeWork(current, workInProgress, renderLanes) { ); renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - renderLanes && - ((newProps = workInProgress.child), - (type = null), + if (renderLanes) { + newProps = workInProgress.child; + type = null; null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && - (type = newProps.alternate.memoizedState.cachePool.pool), - (returnFiber = null), + (type = newProps.alternate.memoizedState.cachePool.pool); + var cache$153 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (returnFiber = newProps.memoizedState.cachePool.pool), - returnFiber !== type && (newProps.flags |= 2048)); + (cache$153 = newProps.memoizedState.cachePool.pool); + cache$153 !== type && (newProps.flags |= 2048); + } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), renderLanes && (workInProgress.child.flags |= 8192)); @@ -8550,8 +8528,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - returnFiber = type.rendering; - if (null === returnFiber) + cache$153 = type.rendering; + if (null === cache$153) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -8559,11 +8537,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - returnFiber = findFirstSuspended(current); - if (null !== returnFiber) { + cache$153 = findFirstSuspended(current); + if (null !== cache$153) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = returnFiber.updateQueue; + current = cache$153.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8588,7 +8566,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(returnFiber)), null !== current)) { + if (((current = findFirstSuspended(cache$153)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8598,7 +8576,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !returnFiber.alternate && + !cache$153.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8611,13 +8589,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 8388608)); type.isBackwards - ? ((returnFiber.sibling = workInProgress.child), - (workInProgress.child = returnFiber)) + ? ((cache$153.sibling = workInProgress.child), + (workInProgress.child = cache$153)) : ((current = type.last), null !== current - ? (current.sibling = returnFiber) - : (workInProgress.child = returnFiber), - (type.last = returnFiber)); + ? (current.sibling = cache$153) + : (workInProgress.child = cache$153), + (type.last = cache$153)); } if (null !== type.tail) return ( @@ -16601,7 +16579,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1855 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-6e176d80", + version: "18.3.0-www-classic-3bcc00dd", rendererPackageName: "react-dom" }; (function (internals) { @@ -16645,7 +16623,7 @@ var devToolsConfig$jscomp$inline_1855 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-6e176d80" + reconcilerVersion: "18.3.0-www-classic-3bcc00dd" }); assign(Internals, { ReactBrowserEventEmitter: { @@ -16872,7 +16850,7 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-6e176d80"; +exports.version = "18.3.0-www-classic-3bcc00dd"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index 818473084bf26..549358c20073a 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -1977,7 +1977,6 @@ function prepareToHydrateHostInstance(fiber) { props = fiber.memoizedProps; instance[internalInstanceKey] = fiber; instance[internalPropsKey] = props; - var isConcurrentMode = 0 !== (fiber.mode & 1); switch (type) { case "dialog": listenToNonDelegatedEvent("cancel", instance); @@ -2019,19 +2018,15 @@ function prepareToHydrateHostInstance(fiber) { } props.hasOwnProperty("onScroll") && listenToNonDelegatedEvent("scroll", instance); - i = null; - var children = props.children; - if ( - ("string" === typeof children || "number" === typeof children) && - instance.textContent !== "" + children - ) { - if (!0 !== props.suppressHydrationWarning) { - var serverText = instance.textContent; - normalizeMarkupForTextOrAttribute(children); - normalizeMarkupForTextOrAttribute(serverText); - } - isConcurrentMode || (i = ["children", children]); - } + var updatePayload = null; + i = props.children; + ("string" !== typeof i && "number" !== typeof i) || + instance.textContent === "" + i || + (!0 !== props.suppressHydrationWarning && + ((updatePayload = instance.textContent), + normalizeMarkupForTextOrAttribute(i), + normalizeMarkupForTextOrAttribute(updatePayload)), + (updatePayload = ["children", i])); switch (type) { case "input": track(instance); @@ -2047,7 +2042,7 @@ function prepareToHydrateHostInstance(fiber) { default: "function" === typeof props.onClick && (instance.onclick = noop); } - instance = i; + instance = updatePayload; fiber.updateQueue = instance; return null !== instance ? !0 : !1; } @@ -7011,43 +7006,25 @@ function completeWork(current, workInProgress, renderLanes) { throw Error(formatProdErrorMessage(166)); current = rootInstanceStackCursor.current; if (popHydrationState(workInProgress)) { - a: { - newProps = workInProgress.stateNode; - current = workInProgress.memoizedProps; - newProps[internalInstanceKey] = workInProgress; - if ((renderLanes = newProps.nodeValue !== current)) { - var returnFiber = hydrationParentFiber; - if (null !== returnFiber) - switch (returnFiber.tag) { - case 3: - type = 0 !== (returnFiber.mode & 1); - newProps = newProps.nodeValue; - normalizeMarkupForTextOrAttribute(current); - normalizeMarkupForTextOrAttribute(newProps); - if (type) { - current = !1; - break a; - } - break; - case 27: - case 5: - if ( - ((type = 0 !== (returnFiber.mode & 1)), - !0 !== - returnFiber.memoizedProps.suppressHydrationWarning && - ((newProps = newProps.nodeValue), - normalizeMarkupForTextOrAttribute(current), - normalizeMarkupForTextOrAttribute(newProps)), - type) - ) { - current = !1; - break a; - } - } - } - current = renderLanes; - } - current && markUpdate(workInProgress); + newProps = workInProgress.stateNode; + current = workInProgress.memoizedProps; + newProps[internalInstanceKey] = workInProgress; + if ((renderLanes = newProps.nodeValue !== current)) + if (((type = hydrationParentFiber), null !== type)) + switch (type.tag) { + case 3: + newProps = newProps.nodeValue; + normalizeMarkupForTextOrAttribute(current); + normalizeMarkupForTextOrAttribute(newProps); + break; + case 27: + case 5: + !0 !== type.memoizedProps.suppressHydrationWarning && + ((newProps = newProps.nodeValue), + normalizeMarkupForTextOrAttribute(current), + normalizeMarkupForTextOrAttribute(newProps)); + } + renderLanes && markUpdate(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -7119,18 +7096,19 @@ function completeWork(current, workInProgress, renderLanes) { ); renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - renderLanes && - ((newProps = workInProgress.child), - (type = null), + if (renderLanes) { + newProps = workInProgress.child; + type = null; null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && - (type = newProps.alternate.memoizedState.cachePool.pool), - (returnFiber = null), + (type = newProps.alternate.memoizedState.cachePool.pool); + var cache$121 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (returnFiber = newProps.memoizedState.cachePool.pool), - returnFiber !== type && (newProps.flags |= 2048)); + (cache$121 = newProps.memoizedState.cachePool.pool); + cache$121 !== type && (newProps.flags |= 2048); + } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), renderLanes && (workInProgress.child.flags |= 8192)); @@ -7166,8 +7144,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - returnFiber = type.rendering; - if (null === returnFiber) + cache$121 = type.rendering; + if (null === cache$121) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -7175,11 +7153,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - returnFiber = findFirstSuspended(current); - if (null !== returnFiber) { + cache$121 = findFirstSuspended(current); + if (null !== cache$121) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = returnFiber.updateQueue; + current = cache$121.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7204,7 +7182,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(returnFiber)), null !== current)) { + if (((current = findFirstSuspended(cache$121)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -7214,7 +7192,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !returnFiber.alternate && + !cache$121.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -7227,13 +7205,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 8388608)); type.isBackwards - ? ((returnFiber.sibling = workInProgress.child), - (workInProgress.child = returnFiber)) + ? ((cache$121.sibling = workInProgress.child), + (workInProgress.child = cache$121)) : ((current = type.last), null !== current - ? (current.sibling = returnFiber) - : (workInProgress.child = returnFiber), - (type.last = returnFiber)); + ? (current.sibling = cache$121) + : (workInProgress.child = cache$121), + (type.last = cache$121)); } if (null !== type.tail) return ( @@ -16122,7 +16100,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1825 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-bb061536", + version: "18.3.0-www-modern-3344da1d", rendererPackageName: "react-dom" }; (function (internals) { @@ -16167,7 +16145,7 @@ var devToolsConfig$jscomp$inline_1825 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-bb061536" + reconcilerVersion: "18.3.0-www-modern-3344da1d" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = function (children, container) { @@ -16323,7 +16301,7 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-bb061536"; +exports.version = "18.3.0-www-modern-3344da1d"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 44fdf74868d9a..f01b823dbd9ce 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -7082,7 +7082,7 @@ function diffHydratedProperties( ); } - if (!isConcurrentMode) { + if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) { updatePayload = ["children", children]; } } @@ -11353,7 +11353,7 @@ function prepareToHydrateHostTextInstance(fiber) { shouldWarnIfMismatchDev ); - if (isConcurrentMode) { + if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) { // In concurrent mode we never update the mismatched text, // even if the error was ignored. return false; @@ -11381,7 +11381,7 @@ function prepareToHydrateHostTextInstance(fiber) { shouldWarnIfMismatchDev ); - if (_isConcurrentMode2) { + if (_isConcurrentMode2 && enableClientRenderFallbackOnTextMismatch) { // In concurrent mode we never update the mismatched text, // even if the error was ignored. return false; @@ -36848,7 +36848,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-2ee8f43b"; +var ReactVersion = "18.3.0-www-classic-85dd84cf"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 9f08d3779d65d..e7b02971e2586 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -8725,7 +8725,7 @@ function prepareToHydrateHostTextInstance(fiber) { shouldWarnIfMismatchDev ); - if (isConcurrentMode) { + if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) { // In concurrent mode we never update the mismatched text, // even if the error was ignored. return false; @@ -8753,7 +8753,7 @@ function prepareToHydrateHostTextInstance(fiber) { shouldWarnIfMismatchDev ); - if (_isConcurrentMode2) { + if (_isConcurrentMode2 && enableClientRenderFallbackOnTextMismatch) { // In concurrent mode we never update the mismatched text, // even if the error was ignored. return false; @@ -34124,7 +34124,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-5108ae69"; +var ReactVersion = "18.3.0-www-modern-ecd5ecdb"; function createPortal$1( children, @@ -40864,7 +40864,7 @@ function diffHydratedProperties( ); } - if (!isConcurrentMode) { + if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) { updatePayload = ["children", children]; } } diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 83203f6b56f73..e8dfe63828241 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -2386,7 +2386,6 @@ function prepareToHydrateHostInstance(fiber) { props = fiber.memoizedProps; instance[internalInstanceKey] = fiber; instance[internalPropsKey] = props; - var isConcurrentMode = 0 !== (fiber.mode & 1); switch (type) { case "dialog": listenToNonDelegatedEvent("cancel", instance); @@ -2428,19 +2427,15 @@ function prepareToHydrateHostInstance(fiber) { } props.hasOwnProperty("onScroll") && listenToNonDelegatedEvent("scroll", instance); - i = null; - var children = props.children; - if ( - ("string" === typeof children || "number" === typeof children) && - instance.textContent !== "" + children - ) { - if (!0 !== props.suppressHydrationWarning) { - var serverText = instance.textContent; - normalizeMarkupForTextOrAttribute(children); - normalizeMarkupForTextOrAttribute(serverText); - } - isConcurrentMode || (i = ["children", children]); - } + var updatePayload = null; + i = props.children; + ("string" !== typeof i && "number" !== typeof i) || + instance.textContent === "" + i || + (!0 !== props.suppressHydrationWarning && + ((updatePayload = instance.textContent), + normalizeMarkupForTextOrAttribute(i), + normalizeMarkupForTextOrAttribute(updatePayload)), + (updatePayload = ["children", i])); switch (type) { case "input": track(instance); @@ -2456,7 +2451,7 @@ function prepareToHydrateHostInstance(fiber) { default: "function" === typeof props.onClick && (instance.onclick = noop$1); } - instance = i; + instance = updatePayload; fiber.updateQueue = instance; return null !== instance ? !0 : !1; } @@ -7349,43 +7344,25 @@ function completeWork(current, workInProgress, renderLanes) { throw Error(formatProdErrorMessage(166)); current = rootInstanceStackCursor.current; if (popHydrationState(workInProgress)) { - a: { - newProps = workInProgress.stateNode; - current = workInProgress.memoizedProps; - newProps[internalInstanceKey] = workInProgress; - if ((renderLanes = newProps.nodeValue !== current)) { - var returnFiber = hydrationParentFiber; - if (null !== returnFiber) - switch (returnFiber.tag) { - case 3: - type = 0 !== (returnFiber.mode & 1); - newProps = newProps.nodeValue; - normalizeMarkupForTextOrAttribute(current); - normalizeMarkupForTextOrAttribute(newProps); - if (type) { - current = !1; - break a; - } - break; - case 27: - case 5: - if ( - ((type = 0 !== (returnFiber.mode & 1)), - !0 !== - returnFiber.memoizedProps.suppressHydrationWarning && - ((newProps = newProps.nodeValue), - normalizeMarkupForTextOrAttribute(current), - normalizeMarkupForTextOrAttribute(newProps)), - type) - ) { - current = !1; - break a; - } - } - } - current = renderLanes; - } - current && markUpdate(workInProgress); + newProps = workInProgress.stateNode; + current = workInProgress.memoizedProps; + newProps[internalInstanceKey] = workInProgress; + if ((renderLanes = newProps.nodeValue !== current)) + if (((type = hydrationParentFiber), null !== type)) + switch (type.tag) { + case 3: + newProps = newProps.nodeValue; + normalizeMarkupForTextOrAttribute(current); + normalizeMarkupForTextOrAttribute(newProps); + break; + case 27: + case 5: + !0 !== type.memoizedProps.suppressHydrationWarning && + ((newProps = newProps.nodeValue), + normalizeMarkupForTextOrAttribute(current), + normalizeMarkupForTextOrAttribute(newProps)); + } + renderLanes && markUpdate(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -7441,18 +7418,19 @@ function completeWork(current, workInProgress, renderLanes) { return (workInProgress.lanes = renderLanes), workInProgress; renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - renderLanes && - ((newProps = workInProgress.child), - (type = null), + if (renderLanes) { + newProps = workInProgress.child; + type = null; null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && - (type = newProps.alternate.memoizedState.cachePool.pool), - (returnFiber = null), + (type = newProps.alternate.memoizedState.cachePool.pool); + var cache$111 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (returnFiber = newProps.memoizedState.cachePool.pool), - returnFiber !== type && (newProps.flags |= 2048)); + (cache$111 = newProps.memoizedState.cachePool.pool); + cache$111 !== type && (newProps.flags |= 2048); + } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), renderLanes && (workInProgress.child.flags |= 8192)); @@ -7487,8 +7465,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - returnFiber = type.rendering; - if (null === returnFiber) + cache$111 = type.rendering; + if (null === cache$111) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -7496,11 +7474,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - returnFiber = findFirstSuspended(current); - if (null !== returnFiber) { + cache$111 = findFirstSuspended(current); + if (null !== cache$111) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = returnFiber.updateQueue; + current = cache$111.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7525,7 +7503,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(returnFiber)), null !== current)) { + if (((current = findFirstSuspended(cache$111)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -7535,7 +7513,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !returnFiber.alternate && + !cache$111.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -7548,13 +7526,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 8388608)); type.isBackwards - ? ((returnFiber.sibling = workInProgress.child), - (workInProgress.child = returnFiber)) + ? ((cache$111.sibling = workInProgress.child), + (workInProgress.child = cache$111)) : ((current = type.last), null !== current - ? (current.sibling = returnFiber) - : (workInProgress.child = returnFiber), - (type.last = returnFiber)); + ? (current.sibling = cache$111) + : (workInProgress.child = cache$111), + (type.last = cache$111)); } if (null !== type.tail) return ( @@ -13114,7 +13092,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1638 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-20a03402", + version: "18.3.0-www-classic-ac5037f5", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2196 = { @@ -13144,7 +13122,7 @@ var internals$jscomp$inline_2196 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-20a03402" + reconcilerVersion: "18.3.0-www-classic-ac5037f5" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2197 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16576,4 +16554,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-20a03402"; +exports.version = "18.3.0-www-classic-ac5037f5"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index e95764397c73c..7e82f0dcab00e 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -1970,7 +1970,6 @@ function prepareToHydrateHostInstance(fiber) { props = fiber.memoizedProps; instance[internalInstanceKey] = fiber; instance[internalPropsKey] = props; - var isConcurrentMode = 0 !== (fiber.mode & 1); switch (type) { case "dialog": listenToNonDelegatedEvent("cancel", instance); @@ -2012,19 +2011,15 @@ function prepareToHydrateHostInstance(fiber) { } props.hasOwnProperty("onScroll") && listenToNonDelegatedEvent("scroll", instance); - i = null; - var children = props.children; - if ( - ("string" === typeof children || "number" === typeof children) && - instance.textContent !== "" + children - ) { - if (!0 !== props.suppressHydrationWarning) { - var serverText = instance.textContent; - normalizeMarkupForTextOrAttribute(children); - normalizeMarkupForTextOrAttribute(serverText); - } - isConcurrentMode || (i = ["children", children]); - } + var updatePayload = null; + i = props.children; + ("string" !== typeof i && "number" !== typeof i) || + instance.textContent === "" + i || + (!0 !== props.suppressHydrationWarning && + ((updatePayload = instance.textContent), + normalizeMarkupForTextOrAttribute(i), + normalizeMarkupForTextOrAttribute(updatePayload)), + (updatePayload = ["children", i])); switch (type) { case "input": track(instance); @@ -2040,7 +2035,7 @@ function prepareToHydrateHostInstance(fiber) { default: "function" === typeof props.onClick && (instance.onclick = noop); } - instance = i; + instance = updatePayload; fiber.updateQueue = instance; return null !== instance ? !0 : !1; } @@ -6872,43 +6867,25 @@ function completeWork(current, workInProgress, renderLanes) { throw Error(formatProdErrorMessage(166)); current = rootInstanceStackCursor.current; if (popHydrationState(workInProgress)) { - a: { - newProps = workInProgress.stateNode; - current = workInProgress.memoizedProps; - newProps[internalInstanceKey] = workInProgress; - if ((renderLanes = newProps.nodeValue !== current)) { - var returnFiber = hydrationParentFiber; - if (null !== returnFiber) - switch (returnFiber.tag) { - case 3: - type = 0 !== (returnFiber.mode & 1); - newProps = newProps.nodeValue; - normalizeMarkupForTextOrAttribute(current); - normalizeMarkupForTextOrAttribute(newProps); - if (type) { - current = !1; - break a; - } - break; - case 27: - case 5: - if ( - ((type = 0 !== (returnFiber.mode & 1)), - !0 !== - returnFiber.memoizedProps.suppressHydrationWarning && - ((newProps = newProps.nodeValue), - normalizeMarkupForTextOrAttribute(current), - normalizeMarkupForTextOrAttribute(newProps)), - type) - ) { - current = !1; - break a; - } - } - } - current = renderLanes; - } - current && markUpdate(workInProgress); + newProps = workInProgress.stateNode; + current = workInProgress.memoizedProps; + newProps[internalInstanceKey] = workInProgress; + if ((renderLanes = newProps.nodeValue !== current)) + if (((type = hydrationParentFiber), null !== type)) + switch (type.tag) { + case 3: + newProps = newProps.nodeValue; + normalizeMarkupForTextOrAttribute(current); + normalizeMarkupForTextOrAttribute(newProps); + break; + case 27: + case 5: + !0 !== type.memoizedProps.suppressHydrationWarning && + ((newProps = newProps.nodeValue), + normalizeMarkupForTextOrAttribute(current), + normalizeMarkupForTextOrAttribute(newProps)); + } + renderLanes && markUpdate(workInProgress); } else (current = getOwnerDocumentFromRootContainer(current).createTextNode( @@ -6964,18 +6941,19 @@ function completeWork(current, workInProgress, renderLanes) { return (workInProgress.lanes = renderLanes), workInProgress; renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - renderLanes && - ((newProps = workInProgress.child), - (type = null), + if (renderLanes) { + newProps = workInProgress.child; + type = null; null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && - (type = newProps.alternate.memoizedState.cachePool.pool), - (returnFiber = null), + (type = newProps.alternate.memoizedState.cachePool.pool); + var cache$110 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (returnFiber = newProps.memoizedState.cachePool.pool), - returnFiber !== type && (newProps.flags |= 2048)); + (cache$110 = newProps.memoizedState.cachePool.pool); + cache$110 !== type && (newProps.flags |= 2048); + } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), renderLanes && (workInProgress.child.flags |= 8192)); @@ -7006,8 +6984,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - returnFiber = type.rendering; - if (null === returnFiber) + cache$110 = type.rendering; + if (null === cache$110) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -7015,11 +6993,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - returnFiber = findFirstSuspended(current); - if (null !== returnFiber) { + cache$110 = findFirstSuspended(current); + if (null !== cache$110) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = returnFiber.updateQueue; + current = cache$110.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7044,7 +7022,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(returnFiber)), null !== current)) { + if (((current = findFirstSuspended(cache$110)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -7054,7 +7032,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !returnFiber.alternate && + !cache$110.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -7067,13 +7045,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 8388608)); type.isBackwards - ? ((returnFiber.sibling = workInProgress.child), - (workInProgress.child = returnFiber)) + ? ((cache$110.sibling = workInProgress.child), + (workInProgress.child = cache$110)) : ((current = type.last), null !== current - ? (current.sibling = returnFiber) - : (workInProgress.child = returnFiber), - (type.last = returnFiber)); + ? (current.sibling = cache$110) + : (workInProgress.child = cache$110), + (type.last = cache$110)); } if (null !== type.tail) return ( @@ -15737,7 +15715,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1774 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-36a2211a", + version: "18.3.0-www-modern-b3a4de20", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2177 = { @@ -15768,7 +15746,7 @@ var internals$jscomp$inline_2177 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-36a2211a" + reconcilerVersion: "18.3.0-www-modern-b3a4de20" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2178 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16088,4 +16066,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-36a2211a"; +exports.version = "18.3.0-www-modern-b3a4de20"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 6b3131d984c3f..c397b40c268d6 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -24242,7 +24242,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-36a2211a"; +var ReactVersion = "18.3.0-www-modern-b3a4de20"; // Might add PROFILE later.