in the but that already breaks before and that is an edge case.
+ var anyProps = props;
- switch (type) {
- // case 'title':
- //We assume all titles are matchable. You should only have one in the Document, at least in a hoistable scope
- // and if you are a HostComponent with type title we must either be in an
context or this title must have an `itemProp` prop.
- case "meta": {
- // The only way to opt out of hoisting meta tags is to give it an itemprop attribute. We assume there will be
- // not 3rd party meta tags that are prepended, accepting the cases where this isn't true because meta tags
- // are usually only functional for SSR so even in a rare case where we did bind to an injected tag the runtime
- // implications are minimal
- if (!element.hasAttribute("itemprop")) {
- // This is a Hoistable
- return true;
+ if (element.nodeName.toLowerCase() !== type.toLowerCase()) {
+ if (!inRootOrSingleton || !enableHostSingletons) {
+ // Usually we error for mismatched tags.
+ {
+ return null;
+ }
+ } // In root or singleton parents we skip past mismatched instances.
+ } else if (!inRootOrSingleton || !enableHostSingletons) {
+ // Match
+ {
+ return element;
+ }
+ } else if (isMarkedHoistable(element));
+ else {
+ // We have an Element with the right type.
+ // We are going to try to exclude it if we can definitely identify it as a hoisted Node or if
+ // we can guess that the node is likely hoisted or was inserted by a 3rd party script or browser extension
+ // using high entropy attributes for certain types. This technique will fail for strange insertions like
+ // extension prepending in the but that already breaks before and that is an edge case.
+ switch (type) {
+ // case 'title':
+ //We assume all titles are matchable. You should only have one in the Document, at least in a hoistable scope
+ // and if you are a HostComponent with type title we must either be in an context or this title must have an `itemProp` prop.
+ case "meta": {
+ // The only way to opt out of hoisting meta tags is to give it an itemprop attribute. We assume there will be
+ // not 3rd party meta tags that are prepended, accepting the cases where this isn't true because meta tags
+ // are usually only functional for SSR so even in a rare case where we did bind to an injected tag the runtime
+ // implications are minimal
+ if (!element.hasAttribute("itemprop")) {
+ // This is a Hoistable
+ break;
+ }
+
+ return element;
}
- break;
- }
+ case "link": {
+ // Links come in many forms and we do expect 3rd parties to inject them into / . We exclude known resources
+ // and then use high-entroy attributes like href which are almost always used and almost always unique to filter out unlikely
+ // matches.
+ var rel = element.getAttribute("rel");
- case "link": {
- // Links come in many forms and we do expect 3rd parties to inject them into / . We exclude known resources
- // and then use high-entroy attributes like href which are almost always used and almost always unique to filter out unlikely
- // matches.
- var rel = element.getAttribute("rel");
+ if (rel === "stylesheet" && element.hasAttribute("data-precedence")) {
+ // This is a stylesheet resource
+ break;
+ } else if (
+ rel !== anyProps.rel ||
+ element.getAttribute("href") !==
+ (anyProps.href == null ? null : anyProps.href) ||
+ element.getAttribute("crossorigin") !==
+ (anyProps.crossOrigin == null ? null : anyProps.crossOrigin) ||
+ element.getAttribute("title") !==
+ (anyProps.title == null ? null : anyProps.title)
+ ) {
+ // rel + href should usually be enough to uniquely identify a link however crossOrigin can vary for rel preconnect
+ // and title could vary for rel alternate
+ break;
+ }
- if (rel === "stylesheet" && element.hasAttribute("data-precedence")) {
- // This is a stylesheet resource
- return true;
- } else if (
- rel !== anyProps.rel ||
- element.getAttribute("href") !==
- (anyProps.href == null ? null : anyProps.href) ||
- element.getAttribute("crossorigin") !==
- (anyProps.crossOrigin == null ? null : anyProps.crossOrigin) ||
- element.getAttribute("title") !==
- (anyProps.title == null ? null : anyProps.title)
- ) {
- // rel + href should usually be enough to uniquely identify a link however crossOrigin can vary for rel preconnect
- // and title could vary for rel alternate
- return true;
+ return element;
}
- break;
- }
+ case "style": {
+ // Styles are hard to match correctly. We can exclude known resources but otherwise we accept the fact that a non-hoisted style tags
+ // in or are likely never going to be unmounted given their position in the document and the fact they likely hold global styles
+ if (element.hasAttribute("data-precedence")) {
+ // This is a style resource
+ break;
+ }
- case "style": {
- // Styles are hard to match correctly. We can exclude known resources but otherwise we accept the fact that a non-hoisted style tags
- // in or are likely never going to be unmounted given their position in the document and the fact they likely hold global styles
- if (element.hasAttribute("data-precedence")) {
- // This is a style resource
- return true;
+ return element;
}
- break;
- }
+ case "script": {
+ // Scripts are a little tricky, we exclude known resources and then similar to links try to use high-entropy attributes
+ // to reject poor matches. One challenge with scripts are inline scripts. We don't attempt to check text content which could
+ // in theory lead to a hydration error later if a 3rd party injected an inline script before the React rendered nodes.
+ // Falling back to client rendering if this happens should be seemless though so we will try this hueristic and revisit later
+ // if we learn it is problematic
+ var srcAttr = element.getAttribute("src");
- case "script": {
- // Scripts are a little tricky, we exclude known resources and then similar to links try to use high-entropy attributes
- // to reject poor matches. One challenge with scripts are inline scripts. We don't attempt to check text content which could
- // in theory lead to a hydration error later if a 3rd party injected an inline script before the React rendered nodes.
- // Falling back to client rendering if this happens should be seemless though so we will try this hueristic and revisit later
- // if we learn it is problematic
- var srcAttr = element.getAttribute("src");
+ if (
+ srcAttr &&
+ element.hasAttribute("async") &&
+ !element.hasAttribute("itemprop")
+ ) {
+ // This is an async script resource
+ break;
+ } else if (
+ srcAttr !== (anyProps.src == null ? null : anyProps.src) ||
+ element.getAttribute("type") !==
+ (anyProps.type == null ? null : anyProps.type) ||
+ element.getAttribute("crossorigin") !==
+ (anyProps.crossOrigin == null ? null : anyProps.crossOrigin)
+ ) {
+ // This script is for a different src
+ break;
+ }
- if (
- srcAttr &&
- element.hasAttribute("async") &&
- !element.hasAttribute("itemprop")
- ) {
- // This is an async script resource
- return true;
- } else if (
- srcAttr !== (anyProps.src == null ? null : anyProps.src) ||
- element.getAttribute("type") !==
- (anyProps.type == null ? null : anyProps.type) ||
- element.getAttribute("crossorigin") !==
- (anyProps.crossOrigin == null ? null : anyProps.crossOrigin)
- ) {
- // This script is for a different src
- return true;
+ return element;
}
- break;
+ default: {
+ // We have excluded the most likely cases of mismatch between hoistable tags, 3rd party script inserted tags,
+ // and browser extension inserted tags. While it is possible this is not the right match it is a decent hueristic
+ // that should work in the vast majority of cases.
+ return element;
+ }
}
- } // We have excluded the most likely cases of mismatch between hoistable tags, 3rd party script inserted tags,
- // and browser extension inserted tags. While it is possible this is not the right match it is a decent hueristic
- // that should work in the vast majority of cases.
+ }
- return false;
- }
+ var nextInstance = getNextHydratableSibling(element);
+
+ if (nextInstance === null) {
+ break;
+ }
+
+ instance = nextInstance;
+ } // This is a suspense boundary or Text node or we got the end.
+ // Suspense Boundaries are never expected to be injected by 3rd parties. If we see one it should be matched
+ // and this is a hydration error.
+ // Text Nodes are also not expected to be injected by 3rd parties. This is less of a guarantee for
+ // but it seems reasonable and conservative to reject this as a hydration error as well
+
+ return null;
}
-function shouldSkipHydratableForTextInstance(instance) {
- return instance.nodeType === ELEMENT_NODE;
-}
-function shouldSkipHydratableForSuspenseInstance(instance) {
- return instance.nodeType === ELEMENT_NODE;
-}
-function canHydrateInstance(instance, type, props) {
- if (
- instance.nodeType !== ELEMENT_NODE ||
- instance.nodeName.toLowerCase() !== type.toLowerCase()
- ) {
- return null;
- } else {
- return instance;
- }
-}
-function canHydrateTextInstance(instance, text) {
+function canHydrateTextInstance(instance, text, inRootOrSingleton) {
+ // Empty strings are not parsed by HTML so there won't be a correct match here.
if (text === "") return null;
- if (instance.nodeType !== TEXT_NODE) {
- // Empty strings are not parsed by HTML so there won't be a correct match here.
- return null;
+ while (instance.nodeType !== TEXT_NODE) {
+ if (!inRootOrSingleton || !enableHostSingletons) {
+ return null;
+ }
+
+ var nextInstance = getNextHydratableSibling(instance);
+
+ if (nextInstance === null) {
+ return null;
+ }
+
+ instance = nextInstance;
} // This has now been refined to a text node.
return instance;
}
-function canHydrateSuspenseInstance(instance) {
- if (instance.nodeType !== COMMENT_NODE) {
- return null;
+function canHydrateSuspenseInstance(instance, inRootOrSingleton) {
+ while (instance.nodeType !== COMMENT_NODE) {
+ if (!inRootOrSingleton || !enableHostSingletons) {
+ return null;
+ }
+
+ var nextInstance = getNextHydratableSibling(instance);
+
+ if (nextInstance === null) {
+ return null;
+ }
+
+ instance = nextInstance;
} // This has now been refined to a suspense node.
return instance;
@@ -44445,7 +44409,7 @@ function commitHydratedContainer(container) {
function commitHydratedSuspenseInstance(suspenseInstance) {
// Retry if any event replaying was blocked on this.
retryIfBlockedOn(suspenseInstance);
-} // @TODO remove this function once float lands and hydrated tail nodes
+}
function didNotMatchHydratedContainerTextInstance(
parentContainer,
textInstance,
diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js
index 74543ea6cd..7a14bec65f 100644
--- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js
+++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js
@@ -1680,12 +1680,12 @@ function insertNonHydratedInstance(returnFiber, fiber) {
fiber.flags = (fiber.flags & -4097) | 2;
}
function tryHydrateInstance(fiber, nextInstance) {
- var type = fiber.type;
- nextInstance =
- 1 !== nextInstance.nodeType ||
- nextInstance.nodeName.toLowerCase() !== type.toLowerCase()
- ? null
- : nextInstance;
+ nextInstance = canHydrateInstance(
+ nextInstance,
+ fiber.type,
+ fiber.pendingProps,
+ rootOrSingletonContext
+ );
return null !== nextInstance
? ((fiber.stateNode = nextInstance),
(hydrationParentFiber = fiber),
@@ -1695,12 +1695,11 @@ function tryHydrateInstance(fiber, nextInstance) {
: !1;
}
function tryHydrateText(fiber, nextInstance) {
- nextInstance =
- "" === fiber.pendingProps
- ? null
- : 3 !== nextInstance.nodeType
- ? null
- : nextInstance;
+ nextInstance = canHydrateTextInstance(
+ nextInstance,
+ fiber.pendingProps,
+ rootOrSingletonContext
+ );
return null !== nextInstance
? ((fiber.stateNode = nextInstance),
(hydrationParentFiber = fiber),
@@ -1709,26 +1708,39 @@ function tryHydrateText(fiber, nextInstance) {
: !1;
}
function tryHydrateSuspense(fiber, nextInstance) {
- nextInstance = 8 !== nextInstance.nodeType ? null : nextInstance;
- if (null !== nextInstance) {
- var JSCompiler_inline_result =
- null !== treeContextProvider
- ? { id: treeContextId, overflow: treeContextOverflow }
- : null;
- fiber.memoizedState = {
- dehydrated: nextInstance,
- treeContext: JSCompiler_inline_result,
- retryLane: 1073741824
- };
- JSCompiler_inline_result = createFiber(18, null, null, 0);
- JSCompiler_inline_result.stateNode = nextInstance;
- JSCompiler_inline_result.return = fiber;
- fiber.child = JSCompiler_inline_result;
- hydrationParentFiber = fiber;
- nextHydratableInstance = null;
- return !0;
+ a: {
+ var instance = nextInstance;
+ for (nextInstance = rootOrSingletonContext; 8 !== instance.nodeType; ) {
+ if (!nextInstance) {
+ nextInstance = null;
+ break a;
+ }
+ instance = getNextHydratable(instance.nextSibling);
+ if (null === instance) {
+ nextInstance = null;
+ break a;
+ }
+ }
+ nextInstance = instance;
}
- return !1;
+ return null !== nextInstance
+ ? ((instance =
+ null !== treeContextProvider
+ ? { id: treeContextId, overflow: treeContextOverflow }
+ : null),
+ (fiber.memoizedState = {
+ dehydrated: nextInstance,
+ treeContext: instance,
+ retryLane: 1073741824
+ }),
+ (instance = createFiber(18, null, null, 0)),
+ (instance.stateNode = nextInstance),
+ (instance.return = fiber),
+ (fiber.child = instance),
+ (hydrationParentFiber = fiber),
+ (nextHydratableInstance = null),
+ !0)
+ : !1;
}
function shouldClientRenderOnMismatch(fiber) {
return 0 !== (fiber.mode & 1) && 0 === (fiber.flags & 128);
@@ -1736,33 +1748,6 @@ function shouldClientRenderOnMismatch(fiber) {
function throwOnHydrationMismatch() {
throw Error(formatProdErrorMessage(418));
}
-function advanceToFirstAttemptableInstance(fiber) {
- for (
- ;
- nextHydratableInstance &&
- shouldSkipHydratableForInstance(
- nextHydratableInstance,
- fiber.type,
- fiber.pendingProps
- );
-
- )
- nextHydratableInstance = getNextHydratable(
- nextHydratableInstance.nextSibling
- );
-}
-function advanceToFirstAttemptableTextInstance() {
- for (; nextHydratableInstance && 1 === nextHydratableInstance.nodeType; )
- nextHydratableInstance = getNextHydratable(
- nextHydratableInstance.nextSibling
- );
-}
-function advanceToFirstAttemptableSuspenseInstance() {
- for (; nextHydratableInstance && 1 === nextHydratableInstance.nodeType; )
- nextHydratableInstance = getNextHydratable(
- nextHydratableInstance.nextSibling
- );
-}
function prepareToHydrateHostInstance(fiber) {
var instance = fiber.stateNode,
type = fiber.type,
@@ -5563,10 +5548,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
? pushPrimaryTreeSuspenseHandler(workInProgress)
: reuseSuspenseHandlerOnStack(workInProgress);
isHydrating &&
- (((current = nextHydratableInstance),
- rootOrSingletonContext && advanceToFirstAttemptableSuspenseInstance(),
- (didSuspend = nextHydratableInstance),
- didSuspend)
+ (((didSuspend = current = nextHydratableInstance), didSuspend)
? tryHydrateSuspense(workInProgress, didSuspend) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
@@ -5574,8 +5556,6 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
didSuspend.nextSibling
)),
(JSCompiler_temp = hydrationParentFiber),
- rootOrSingletonContext &&
- advanceToFirstAttemptableSuspenseInstance(),
nextHydratableInstance &&
tryHydrateSuspense(workInProgress, nextHydratableInstance)
? deleteHydratableInstance(JSCompiler_temp, didSuspend)
@@ -11621,11 +11601,7 @@ beginWork = function (current, workInProgress, renderLanes) {
(Component = !(Component.async && (context || prevState))))
: (Component = !0),
Component)
- ? ((Component = nextHydratableInstance),
- rootOrSingletonContext &&
- advanceToFirstAttemptableInstance(workInProgress),
- (context = nextHydratableInstance),
- context)
+ ? ((context = Component = nextHydratableInstance), context)
? tryHydrateInstance(workInProgress, context) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
@@ -11633,8 +11609,6 @@ beginWork = function (current, workInProgress, renderLanes) {
context.nextSibling
)),
(prevState = hydrationParentFiber),
- rootOrSingletonContext &&
- advanceToFirstAttemptableInstance(workInProgress),
nextHydratableInstance &&
tryHydrateInstance(workInProgress, nextHydratableInstance)
? deleteHydratableInstance(prevState, context)
@@ -11671,39 +11645,30 @@ beginWork = function (current, workInProgress, renderLanes) {
return (
null === current &&
isHydrating &&
- (((renderLanes = "" !== workInProgress.pendingProps),
- (current = nextHydratableInstance),
- rootOrSingletonContext &&
- renderLanes &&
- advanceToFirstAttemptableTextInstance(),
- (Component = nextHydratableInstance),
- Component && renderLanes)
- ? tryHydrateText(workInProgress, Component) ||
+ (((Component = "" !== workInProgress.pendingProps),
+ (current = renderLanes = nextHydratableInstance),
+ current && Component)
+ ? tryHydrateText(workInProgress, current) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
- (nextHydratableInstance = getNextHydratable(
- Component.nextSibling
- )),
- (context = hydrationParentFiber),
- rootOrSingletonContext &&
- renderLanes &&
- advanceToFirstAttemptableTextInstance(),
+ (nextHydratableInstance = getNextHydratable(current.nextSibling)),
+ (Component = hydrationParentFiber),
nextHydratableInstance &&
tryHydrateText(workInProgress, nextHydratableInstance)
- ? deleteHydratableInstance(context, Component)
+ ? deleteHydratableInstance(Component, current)
: (insertNonHydratedInstance(
hydrationParentFiber,
workInProgress
),
(isHydrating = !1),
(hydrationParentFiber = workInProgress),
- (nextHydratableInstance = current)))
+ (nextHydratableInstance = renderLanes)))
: (shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
insertNonHydratedInstance(hydrationParentFiber, workInProgress),
(isHydrating = !1),
(hydrationParentFiber = workInProgress),
- (nextHydratableInstance = current))),
+ (nextHydratableInstance = renderLanes))),
null
);
case 13:
@@ -13041,14 +13006,14 @@ var isInputEventSupported = !1;
if (canUseDOM) {
var JSCompiler_inline_result$jscomp$376;
if (canUseDOM) {
- var isSupported$jscomp$inline_1614 = "oninput" in document;
- if (!isSupported$jscomp$inline_1614) {
- var element$jscomp$inline_1615 = document.createElement("div");
- element$jscomp$inline_1615.setAttribute("oninput", "return;");
- isSupported$jscomp$inline_1614 =
- "function" === typeof element$jscomp$inline_1615.oninput;
+ var isSupported$jscomp$inline_1607 = "oninput" in document;
+ if (!isSupported$jscomp$inline_1607) {
+ var element$jscomp$inline_1608 = document.createElement("div");
+ element$jscomp$inline_1608.setAttribute("oninput", "return;");
+ isSupported$jscomp$inline_1607 =
+ "function" === typeof element$jscomp$inline_1608.oninput;
}
- JSCompiler_inline_result$jscomp$376 = isSupported$jscomp$inline_1614;
+ JSCompiler_inline_result$jscomp$376 = isSupported$jscomp$inline_1607;
} else JSCompiler_inline_result$jscomp$376 = !1;
isInputEventSupported =
JSCompiler_inline_result$jscomp$376 &&
@@ -13360,20 +13325,20 @@ function registerSimpleEvent(domEventName, reactName) {
registerTwoPhaseEvent(reactName, [domEventName]);
}
for (
- var i$jscomp$inline_1655 = 0;
- i$jscomp$inline_1655 < simpleEventPluginEvents.length;
- i$jscomp$inline_1655++
+ var i$jscomp$inline_1648 = 0;
+ i$jscomp$inline_1648 < simpleEventPluginEvents.length;
+ i$jscomp$inline_1648++
) {
- var eventName$jscomp$inline_1656 =
- simpleEventPluginEvents[i$jscomp$inline_1655],
- domEventName$jscomp$inline_1657 =
- eventName$jscomp$inline_1656.toLowerCase(),
- capitalizedEvent$jscomp$inline_1658 =
- eventName$jscomp$inline_1656[0].toUpperCase() +
- eventName$jscomp$inline_1656.slice(1);
+ var eventName$jscomp$inline_1649 =
+ simpleEventPluginEvents[i$jscomp$inline_1648],
+ domEventName$jscomp$inline_1650 =
+ eventName$jscomp$inline_1649.toLowerCase(),
+ capitalizedEvent$jscomp$inline_1651 =
+ eventName$jscomp$inline_1649[0].toUpperCase() +
+ eventName$jscomp$inline_1649.slice(1);
registerSimpleEvent(
- domEventName$jscomp$inline_1657,
- "on" + capitalizedEvent$jscomp$inline_1658
+ domEventName$jscomp$inline_1650,
+ "on" + capitalizedEvent$jscomp$inline_1651
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -15417,48 +15382,72 @@ function clearContainerSparingly(container) {
container.removeChild(node);
}
}
-function shouldSkipHydratableForInstance(instance, type, props) {
- if (1 !== instance.nodeType) return !1;
- if (
- instance.nodeName.toLowerCase() !== type.toLowerCase() ||
- instance[internalHoistableMarker]
- )
- return !0;
- switch (type) {
- case "meta":
- if (!instance.hasAttribute("itemprop")) return !0;
- break;
- case "link":
- type = instance.getAttribute("rel");
- if (
- ("stylesheet" === type && instance.hasAttribute("data-precedence")) ||
- type !== props.rel ||
- instance.getAttribute("href") !==
- (null == props.href ? null : props.href) ||
- instance.getAttribute("crossorigin") !==
- (null == props.crossOrigin ? null : props.crossOrigin) ||
- instance.getAttribute("title") !==
- (null == props.title ? null : props.title)
- )
- return !0;
- break;
- case "style":
- if (instance.hasAttribute("data-precedence")) return !0;
- break;
- case "script":
- if (
- ((type = instance.getAttribute("src")) &&
- instance.hasAttribute("async") &&
- !instance.hasAttribute("itemprop")) ||
- type !== (null == props.src ? null : props.src) ||
- instance.getAttribute("type") !==
- (null == props.type ? null : props.type) ||
- instance.getAttribute("crossorigin") !==
- (null == props.crossOrigin ? null : props.crossOrigin)
- )
- return !0;
+function canHydrateInstance(instance, type, props, inRootOrSingleton) {
+ for (; 1 === instance.nodeType; ) {
+ var anyProps = props;
+ if (instance.nodeName.toLowerCase() !== type.toLowerCase()) {
+ if (!inRootOrSingleton) break;
+ } else {
+ if (!inRootOrSingleton) return instance;
+ if (!instance[internalHoistableMarker])
+ switch (type) {
+ case "meta":
+ if (!instance.hasAttribute("itemprop")) break;
+ return instance;
+ case "link":
+ var rel = instance.getAttribute("rel");
+ if (
+ "stylesheet" === rel &&
+ instance.hasAttribute("data-precedence")
+ )
+ break;
+ else if (
+ rel !== anyProps.rel ||
+ instance.getAttribute("href") !==
+ (null == anyProps.href ? null : anyProps.href) ||
+ instance.getAttribute("crossorigin") !==
+ (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) ||
+ instance.getAttribute("title") !==
+ (null == anyProps.title ? null : anyProps.title)
+ )
+ break;
+ return instance;
+ case "style":
+ if (instance.hasAttribute("data-precedence")) break;
+ return instance;
+ case "script":
+ if (
+ (rel = instance.getAttribute("src")) &&
+ instance.hasAttribute("async") &&
+ !instance.hasAttribute("itemprop")
+ )
+ break;
+ else if (
+ rel !== (null == anyProps.src ? null : anyProps.src) ||
+ instance.getAttribute("type") !==
+ (null == anyProps.type ? null : anyProps.type) ||
+ instance.getAttribute("crossorigin") !==
+ (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)
+ )
+ break;
+ return instance;
+ default:
+ return instance;
+ }
+ }
+ instance = getNextHydratable(instance.nextSibling);
+ if (null === instance) break;
}
- return !1;
+ return null;
+}
+function canHydrateTextInstance(instance, text, inRootOrSingleton) {
+ if ("" === text) return null;
+ for (; 3 !== instance.nodeType; ) {
+ if (!inRootOrSingleton) return null;
+ instance = getNextHydratable(instance.nextSibling);
+ if (null === instance) return null;
+ }
+ return instance;
}
function getNextHydratable(node) {
for (; null != node; node = node.nextSibling) {
@@ -16980,17 +16969,17 @@ Internals.Events = [
restoreStateIfNeeded,
batchedUpdates$1
];
-var devToolsConfig$jscomp$inline_1865 = {
+var devToolsConfig$jscomp$inline_1858 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-classic-dfc141bd",
+ version: "18.3.0-www-classic-993a41e1",
rendererPackageName: "react-dom"
};
-var internals$jscomp$inline_2244 = {
- bundleType: devToolsConfig$jscomp$inline_1865.bundleType,
- version: devToolsConfig$jscomp$inline_1865.version,
- rendererPackageName: devToolsConfig$jscomp$inline_1865.rendererPackageName,
- rendererConfig: devToolsConfig$jscomp$inline_1865.rendererConfig,
+var internals$jscomp$inline_2237 = {
+ bundleType: devToolsConfig$jscomp$inline_1858.bundleType,
+ version: devToolsConfig$jscomp$inline_1858.version,
+ rendererPackageName: devToolsConfig$jscomp$inline_1858.rendererPackageName,
+ rendererConfig: devToolsConfig$jscomp$inline_1858.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -17006,26 +16995,26 @@ var internals$jscomp$inline_2244 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
- devToolsConfig$jscomp$inline_1865.findFiberByHostInstance ||
+ devToolsConfig$jscomp$inline_1858.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-www-classic-dfc141bd"
+ reconcilerVersion: "18.3.0-www-classic-993a41e1"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
- var hook$jscomp$inline_2245 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+ var hook$jscomp$inline_2238 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
- !hook$jscomp$inline_2245.isDisabled &&
- hook$jscomp$inline_2245.supportsFiber
+ !hook$jscomp$inline_2238.isDisabled &&
+ hook$jscomp$inline_2238.supportsFiber
)
try {
- (rendererID = hook$jscomp$inline_2245.inject(
- internals$jscomp$inline_2244
+ (rendererID = hook$jscomp$inline_2238.inject(
+ internals$jscomp$inline_2237
)),
- (injectedHook = hook$jscomp$inline_2245);
+ (injectedHook = hook$jscomp$inline_2238);
} catch (err) {}
}
assign(Internals, {
@@ -17407,4 +17396,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-www-classic-dfc141bd";
+exports.version = "18.3.0-www-classic-993a41e1";
diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js
index 356991a2ed..b41a48ef09 100644
--- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js
+++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js
@@ -1628,12 +1628,12 @@ function insertNonHydratedInstance(returnFiber, fiber) {
fiber.flags = (fiber.flags & -4097) | 2;
}
function tryHydrateInstance(fiber, nextInstance) {
- var type = fiber.type;
- nextInstance =
- 1 !== nextInstance.nodeType ||
- nextInstance.nodeName.toLowerCase() !== type.toLowerCase()
- ? null
- : nextInstance;
+ nextInstance = canHydrateInstance(
+ nextInstance,
+ fiber.type,
+ fiber.pendingProps,
+ rootOrSingletonContext
+ );
return null !== nextInstance
? ((fiber.stateNode = nextInstance),
(hydrationParentFiber = fiber),
@@ -1643,12 +1643,11 @@ function tryHydrateInstance(fiber, nextInstance) {
: !1;
}
function tryHydrateText(fiber, nextInstance) {
- nextInstance =
- "" === fiber.pendingProps
- ? null
- : 3 !== nextInstance.nodeType
- ? null
- : nextInstance;
+ nextInstance = canHydrateTextInstance(
+ nextInstance,
+ fiber.pendingProps,
+ rootOrSingletonContext
+ );
return null !== nextInstance
? ((fiber.stateNode = nextInstance),
(hydrationParentFiber = fiber),
@@ -1657,26 +1656,39 @@ function tryHydrateText(fiber, nextInstance) {
: !1;
}
function tryHydrateSuspense(fiber, nextInstance) {
- nextInstance = 8 !== nextInstance.nodeType ? null : nextInstance;
- if (null !== nextInstance) {
- var JSCompiler_inline_result =
- null !== treeContextProvider
- ? { id: treeContextId, overflow: treeContextOverflow }
- : null;
- fiber.memoizedState = {
- dehydrated: nextInstance,
- treeContext: JSCompiler_inline_result,
- retryLane: 1073741824
- };
- JSCompiler_inline_result = createFiber(18, null, null, 0);
- JSCompiler_inline_result.stateNode = nextInstance;
- JSCompiler_inline_result.return = fiber;
- fiber.child = JSCompiler_inline_result;
- hydrationParentFiber = fiber;
- nextHydratableInstance = null;
- return !0;
+ a: {
+ var instance = nextInstance;
+ for (nextInstance = rootOrSingletonContext; 8 !== instance.nodeType; ) {
+ if (!nextInstance) {
+ nextInstance = null;
+ break a;
+ }
+ instance = getNextHydratable(instance.nextSibling);
+ if (null === instance) {
+ nextInstance = null;
+ break a;
+ }
+ }
+ nextInstance = instance;
}
- return !1;
+ return null !== nextInstance
+ ? ((instance =
+ null !== treeContextProvider
+ ? { id: treeContextId, overflow: treeContextOverflow }
+ : null),
+ (fiber.memoizedState = {
+ dehydrated: nextInstance,
+ treeContext: instance,
+ retryLane: 1073741824
+ }),
+ (instance = createFiber(18, null, null, 0)),
+ (instance.stateNode = nextInstance),
+ (instance.return = fiber),
+ (fiber.child = instance),
+ (hydrationParentFiber = fiber),
+ (nextHydratableInstance = null),
+ !0)
+ : !1;
}
function shouldClientRenderOnMismatch(fiber) {
return 0 !== (fiber.mode & 1) && 0 === (fiber.flags & 128);
@@ -1684,33 +1696,6 @@ function shouldClientRenderOnMismatch(fiber) {
function throwOnHydrationMismatch() {
throw Error(formatProdErrorMessage(418));
}
-function advanceToFirstAttemptableInstance(fiber) {
- for (
- ;
- nextHydratableInstance &&
- shouldSkipHydratableForInstance(
- nextHydratableInstance,
- fiber.type,
- fiber.pendingProps
- );
-
- )
- nextHydratableInstance = getNextHydratable(
- nextHydratableInstance.nextSibling
- );
-}
-function advanceToFirstAttemptableTextInstance() {
- for (; nextHydratableInstance && 1 === nextHydratableInstance.nodeType; )
- nextHydratableInstance = getNextHydratable(
- nextHydratableInstance.nextSibling
- );
-}
-function advanceToFirstAttemptableSuspenseInstance() {
- for (; nextHydratableInstance && 1 === nextHydratableInstance.nodeType; )
- nextHydratableInstance = getNextHydratable(
- nextHydratableInstance.nextSibling
- );
-}
function prepareToHydrateHostInstance(fiber) {
var instance = fiber.stateNode,
type = fiber.type,
@@ -5464,10 +5449,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
? pushPrimaryTreeSuspenseHandler(workInProgress)
: reuseSuspenseHandlerOnStack(workInProgress);
isHydrating &&
- (((current = nextHydratableInstance),
- rootOrSingletonContext && advanceToFirstAttemptableSuspenseInstance(),
- (didSuspend = nextHydratableInstance),
- didSuspend)
+ (((didSuspend = current = nextHydratableInstance), didSuspend)
? tryHydrateSuspense(workInProgress, didSuspend) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
@@ -5475,8 +5457,6 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
didSuspend.nextSibling
)),
(JSCompiler_temp = hydrationParentFiber),
- rootOrSingletonContext &&
- advanceToFirstAttemptableSuspenseInstance(),
nextHydratableInstance &&
tryHydrateSuspense(workInProgress, nextHydratableInstance)
? deleteHydratableInstance(JSCompiler_temp, didSuspend)
@@ -11503,18 +11483,12 @@ beginWork = function (current, workInProgress, renderLanes) {
(Component = !(Component.async && (init || prevState))))
: (Component = !0),
Component)
- ? ((Component = nextHydratableInstance),
- rootOrSingletonContext &&
- advanceToFirstAttemptableInstance(workInProgress),
- (init = nextHydratableInstance),
- init)
+ ? ((init = Component = nextHydratableInstance), init)
? tryHydrateInstance(workInProgress, init) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
(nextHydratableInstance = getNextHydratable(init.nextSibling)),
(prevState = hydrationParentFiber),
- rootOrSingletonContext &&
- advanceToFirstAttemptableInstance(workInProgress),
nextHydratableInstance &&
tryHydrateInstance(workInProgress, nextHydratableInstance)
? deleteHydratableInstance(prevState, init)
@@ -11551,39 +11525,30 @@ beginWork = function (current, workInProgress, renderLanes) {
return (
null === current &&
isHydrating &&
- (((renderLanes = "" !== workInProgress.pendingProps),
- (current = nextHydratableInstance),
- rootOrSingletonContext &&
- renderLanes &&
- advanceToFirstAttemptableTextInstance(),
- (Component = nextHydratableInstance),
- Component && renderLanes)
- ? tryHydrateText(workInProgress, Component) ||
+ (((Component = "" !== workInProgress.pendingProps),
+ (current = renderLanes = nextHydratableInstance),
+ current && Component)
+ ? tryHydrateText(workInProgress, current) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
- (nextHydratableInstance = getNextHydratable(
- Component.nextSibling
- )),
- (init = hydrationParentFiber),
- rootOrSingletonContext &&
- renderLanes &&
- advanceToFirstAttemptableTextInstance(),
+ (nextHydratableInstance = getNextHydratable(current.nextSibling)),
+ (Component = hydrationParentFiber),
nextHydratableInstance &&
tryHydrateText(workInProgress, nextHydratableInstance)
- ? deleteHydratableInstance(init, Component)
+ ? deleteHydratableInstance(Component, current)
: (insertNonHydratedInstance(
hydrationParentFiber,
workInProgress
),
(isHydrating = !1),
(hydrationParentFiber = workInProgress),
- (nextHydratableInstance = current)))
+ (nextHydratableInstance = renderLanes)))
: (shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
insertNonHydratedInstance(hydrationParentFiber, workInProgress),
(isHydrating = !1),
(hydrationParentFiber = workInProgress),
- (nextHydratableInstance = current))),
+ (nextHydratableInstance = renderLanes))),
null
);
case 13:
@@ -13339,14 +13304,14 @@ var isInputEventSupported = !1;
if (canUseDOM) {
var JSCompiler_inline_result$jscomp$374;
if (canUseDOM) {
- var isSupported$jscomp$inline_1613 = "oninput" in document;
- if (!isSupported$jscomp$inline_1613) {
- var element$jscomp$inline_1614 = document.createElement("div");
- element$jscomp$inline_1614.setAttribute("oninput", "return;");
- isSupported$jscomp$inline_1613 =
- "function" === typeof element$jscomp$inline_1614.oninput;
+ var isSupported$jscomp$inline_1606 = "oninput" in document;
+ if (!isSupported$jscomp$inline_1606) {
+ var element$jscomp$inline_1607 = document.createElement("div");
+ element$jscomp$inline_1607.setAttribute("oninput", "return;");
+ isSupported$jscomp$inline_1606 =
+ "function" === typeof element$jscomp$inline_1607.oninput;
}
- JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1613;
+ JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1606;
} else JSCompiler_inline_result$jscomp$374 = !1;
isInputEventSupported =
JSCompiler_inline_result$jscomp$374 &&
@@ -13658,20 +13623,20 @@ function registerSimpleEvent(domEventName, reactName) {
registerTwoPhaseEvent(reactName, [domEventName]);
}
for (
- var i$jscomp$inline_1654 = 0;
- i$jscomp$inline_1654 < simpleEventPluginEvents.length;
- i$jscomp$inline_1654++
+ var i$jscomp$inline_1647 = 0;
+ i$jscomp$inline_1647 < simpleEventPluginEvents.length;
+ i$jscomp$inline_1647++
) {
- var eventName$jscomp$inline_1655 =
- simpleEventPluginEvents[i$jscomp$inline_1654],
- domEventName$jscomp$inline_1656 =
- eventName$jscomp$inline_1655.toLowerCase(),
- capitalizedEvent$jscomp$inline_1657 =
- eventName$jscomp$inline_1655[0].toUpperCase() +
- eventName$jscomp$inline_1655.slice(1);
+ var eventName$jscomp$inline_1648 =
+ simpleEventPluginEvents[i$jscomp$inline_1647],
+ domEventName$jscomp$inline_1649 =
+ eventName$jscomp$inline_1648.toLowerCase(),
+ capitalizedEvent$jscomp$inline_1650 =
+ eventName$jscomp$inline_1648[0].toUpperCase() +
+ eventName$jscomp$inline_1648.slice(1);
registerSimpleEvent(
- domEventName$jscomp$inline_1656,
- "on" + capitalizedEvent$jscomp$inline_1657
+ domEventName$jscomp$inline_1649,
+ "on" + capitalizedEvent$jscomp$inline_1650
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -15700,48 +15665,72 @@ function clearContainerSparingly(container) {
container.removeChild(node);
}
}
-function shouldSkipHydratableForInstance(instance, type, props) {
- if (1 !== instance.nodeType) return !1;
- if (
- instance.nodeName.toLowerCase() !== type.toLowerCase() ||
- instance[internalHoistableMarker]
- )
- return !0;
- switch (type) {
- case "meta":
- if (!instance.hasAttribute("itemprop")) return !0;
- break;
- case "link":
- type = instance.getAttribute("rel");
- if (
- ("stylesheet" === type && instance.hasAttribute("data-precedence")) ||
- type !== props.rel ||
- instance.getAttribute("href") !==
- (null == props.href ? null : props.href) ||
- instance.getAttribute("crossorigin") !==
- (null == props.crossOrigin ? null : props.crossOrigin) ||
- instance.getAttribute("title") !==
- (null == props.title ? null : props.title)
- )
- return !0;
- break;
- case "style":
- if (instance.hasAttribute("data-precedence")) return !0;
- break;
- case "script":
- if (
- ((type = instance.getAttribute("src")) &&
- instance.hasAttribute("async") &&
- !instance.hasAttribute("itemprop")) ||
- type !== (null == props.src ? null : props.src) ||
- instance.getAttribute("type") !==
- (null == props.type ? null : props.type) ||
- instance.getAttribute("crossorigin") !==
- (null == props.crossOrigin ? null : props.crossOrigin)
- )
- return !0;
+function canHydrateInstance(instance, type, props, inRootOrSingleton) {
+ for (; 1 === instance.nodeType; ) {
+ var anyProps = props;
+ if (instance.nodeName.toLowerCase() !== type.toLowerCase()) {
+ if (!inRootOrSingleton) break;
+ } else {
+ if (!inRootOrSingleton) return instance;
+ if (!instance[internalHoistableMarker])
+ switch (type) {
+ case "meta":
+ if (!instance.hasAttribute("itemprop")) break;
+ return instance;
+ case "link":
+ var rel = instance.getAttribute("rel");
+ if (
+ "stylesheet" === rel &&
+ instance.hasAttribute("data-precedence")
+ )
+ break;
+ else if (
+ rel !== anyProps.rel ||
+ instance.getAttribute("href") !==
+ (null == anyProps.href ? null : anyProps.href) ||
+ instance.getAttribute("crossorigin") !==
+ (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) ||
+ instance.getAttribute("title") !==
+ (null == anyProps.title ? null : anyProps.title)
+ )
+ break;
+ return instance;
+ case "style":
+ if (instance.hasAttribute("data-precedence")) break;
+ return instance;
+ case "script":
+ if (
+ (rel = instance.getAttribute("src")) &&
+ instance.hasAttribute("async") &&
+ !instance.hasAttribute("itemprop")
+ )
+ break;
+ else if (
+ rel !== (null == anyProps.src ? null : anyProps.src) ||
+ instance.getAttribute("type") !==
+ (null == anyProps.type ? null : anyProps.type) ||
+ instance.getAttribute("crossorigin") !==
+ (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)
+ )
+ break;
+ return instance;
+ default:
+ return instance;
+ }
+ }
+ instance = getNextHydratable(instance.nextSibling);
+ if (null === instance) break;
}
- return !1;
+ return null;
+}
+function canHydrateTextInstance(instance, text, inRootOrSingleton) {
+ if ("" === text) return null;
+ for (; 3 !== instance.nodeType; ) {
+ if (!inRootOrSingleton) return null;
+ instance = getNextHydratable(instance.nextSibling);
+ if (null === instance) return null;
+ }
+ return instance;
}
function getNextHydratable(node) {
for (; null != node; node = node.nextSibling) {
@@ -16562,17 +16551,17 @@ Internals.Events = [
restoreStateIfNeeded,
batchedUpdates$1
];
-var devToolsConfig$jscomp$inline_1824 = {
+var devToolsConfig$jscomp$inline_1817 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
- version: "18.3.0-www-modern-32c95640",
+ version: "18.3.0-www-modern-66e1909a",
rendererPackageName: "react-dom"
};
-var internals$jscomp$inline_2208 = {
- bundleType: devToolsConfig$jscomp$inline_1824.bundleType,
- version: devToolsConfig$jscomp$inline_1824.version,
- rendererPackageName: devToolsConfig$jscomp$inline_1824.rendererPackageName,
- rendererConfig: devToolsConfig$jscomp$inline_1824.rendererConfig,
+var internals$jscomp$inline_2201 = {
+ bundleType: devToolsConfig$jscomp$inline_1817.bundleType,
+ version: devToolsConfig$jscomp$inline_1817.version,
+ rendererPackageName: devToolsConfig$jscomp$inline_1817.rendererPackageName,
+ rendererConfig: devToolsConfig$jscomp$inline_1817.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -16589,26 +16578,26 @@ var internals$jscomp$inline_2208 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
- devToolsConfig$jscomp$inline_1824.findFiberByHostInstance ||
+ devToolsConfig$jscomp$inline_1817.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
- reconcilerVersion: "18.3.0-www-modern-32c95640"
+ reconcilerVersion: "18.3.0-www-modern-66e1909a"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
- var hook$jscomp$inline_2209 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+ var hook$jscomp$inline_2202 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
- !hook$jscomp$inline_2209.isDisabled &&
- hook$jscomp$inline_2209.supportsFiber
+ !hook$jscomp$inline_2202.isDisabled &&
+ hook$jscomp$inline_2202.supportsFiber
)
try {
- (rendererID = hook$jscomp$inline_2209.inject(
- internals$jscomp$inline_2208
+ (rendererID = hook$jscomp$inline_2202.inject(
+ internals$jscomp$inline_2201
)),
- (injectedHook = hook$jscomp$inline_2209);
+ (injectedHook = hook$jscomp$inline_2202);
} catch (err) {}
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
@@ -16918,4 +16907,4 @@ exports.unstable_createEventHandle = function (type, options) {
return eventHandle;
};
exports.unstable_runWithPriority = runWithPriority;
-exports.version = "18.3.0-www-modern-32c95640";
+exports.version = "18.3.0-www-modern-66e1909a";
diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js
index 9005310fbb..95a4dbaef9 100644
--- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js
+++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js
@@ -24549,7 +24549,7 @@ function createFiberRoot(
return root;
}
-var ReactVersion = "18.3.0-www-modern-32c95640";
+var ReactVersion = "18.3.0-www-modern-66e1909a";
// Might add PROFILE later.