From 0eeeadeecb1fce2d0b4a2fed5916777541b2ab86 Mon Sep 17 00:00:00 2001 From: jerrydev0927 Date: Wed, 19 Apr 2023 15:51:39 +0000 Subject: [PATCH] Switching checked to null should leave the current value (#26667) I accidentally made a behavior change in the refactor. It turns out that when switching off `checked` to an uncontrolled component, we used to revert to the concept of "initialChecked" which used to be stored on state. When there's a diff to this computed prop and the value of props.checked is null, then we end up in a case where it sets `checked` to `initialChecked`: https://github.com/facebook/react/blob/5cbe6258bc436b1683080a6d978c27849f1d9a22/packages/react-dom-bindings/src/client/ReactDOMInput.js#L69 Since we never changed `initialChecked` and it's not relevant if non-null `checked` changes value, the only way this "change" could trigger was if we move from having `checked` to having null. This wasn't really consistent with how `value` works, where we instead leave the current value in place regardless. So this is a "bug fix" that changes `checked` to be consistent with `value` and just leave the current value in place. This case should already have a warning in it regardless since it's going from controlled to uncontrolled. Related to that, there was also another issue observed in https://github.com/facebook/react/pull/26596#discussion_r1162295872 and https://github.com/facebook/react/pull/26588 We need to atomically apply mutations on radio buttons. I fixed this by setting the name to empty before doing mutations to value/checked/type in updateInput, and then set the name to whatever it should be. Setting the name is what ends up atomically applying the changes. --------- Co-authored-by: Sophie Alpert DiffTrain build for [1f248bdd7199979b050e4040ceecfe72dd977fd1](https://github.com/facebook/react/commit/1f248bdd7199979b050e4040ceecfe72dd977fd1) --- 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 | 225 +++---- compiled/facebook-www/ReactDOM-dev.modern.js | 225 +++---- .../facebook-www/ReactDOM-prod.classic.js | 418 ++++++------ compiled/facebook-www/ReactDOM-prod.modern.js | 390 +++++------ .../ReactDOM-profiling.classic.js | 404 ++++++----- .../facebook-www/ReactDOM-profiling.modern.js | 376 +++++------ .../ReactDOMTesting-dev.classic.js | 225 +++---- .../ReactDOMTesting-dev.modern.js | 225 +++---- .../ReactDOMTesting-prod.classic.js | 634 +++++++++--------- .../ReactDOMTesting-prod.modern.js | 390 +++++------ .../ReactTestRenderer-dev.modern.js | 2 +- 15 files changed, 1584 insertions(+), 1940 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 698d1cec7e..fff5fc45e9 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -c6db19f9cdec34bca3625a483a2f85181193b885 +1f248bdd7199979b050e4040ceecfe72dd977fd1 diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 260311ad76..a9d04c3f37 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-edf301ed"; +var ReactVersion = "18.3.0-www-modern-1cb1de96"; // 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 f84d28ca77..518d3fc4e1 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-145c42eb"; +var ReactVersion = "18.3.0-www-classic-3f9bce70"; 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 f16507c2ce..02e519a536 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -9637,7 +9637,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "18.3.0-www-modern-294eaa58", + version: "18.3.0-www-modern-f1859984", rendererPackageName: "react-art" }; var internals$jscomp$inline_1317 = { @@ -9668,7 +9668,7 @@ var internals$jscomp$inline_1317 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-294eaa58" + reconcilerVersion: "18.3.0-www-modern-f1859984" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1318 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 589ed500eb..450a8cdccc 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -3782,9 +3782,30 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { - var node = element; + var node = element; // Temporarily disconnect the input from any radio buttons. + // Changing the type or name as the same time as changing the checked value + // needs to be atomically applied. We can only ensure that by disconnecting + // the name while do the mutations and then reapply the name after that's done. + + node.name = ""; + + if ( + type != null && + typeof type !== "function" && + typeof type !== "symbol" && + typeof type !== "boolean" + ) { + { + checkAttributeStringCoercion(type, "type"); + } + + node.type = type; + } else { + node.removeAttribute("type"); + } if (value != null) { if (type === "number") { @@ -3850,6 +3871,21 @@ function updateInput( if (checked != null && node.checked !== !!checked) { node.checked = checked; } + + if ( + name != null && + typeof name !== "function" && + typeof name !== "symbol" && + typeof name !== "boolean" + ) { + { + checkAttributeStringCoercion(name, "name"); + } + + node.name = name; + } else { + node.removeAttribute("name"); + } } function initInput( element, @@ -3858,10 +3894,24 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { var node = element; + if ( + type != null && + typeof type !== "function" && + typeof type !== "symbol" && + typeof type !== "boolean" + ) { + { + checkAttributeStringCoercion(type, "type"); + } + + node.type = type; + } + if (value != null || defaultValue != null) { var isButton = type === "submit" || type === "reset"; // Avoid setting value attribute on submit/reset inputs as it overrides the // default value provided by the browser. See: #12872 @@ -3924,12 +3974,6 @@ function initInput( // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 // We need to temporarily unset name to avoid disrupting radio button groups. - var name = node.name; - - if (name !== "") { - node.name = ""; - } - var checkedOrDefault = checked != null ? checked : defaultChecked; // TODO: This 'function' or 'symbol' check isn't replicated in other places // so this semantic is inconsistent. @@ -3963,9 +4007,18 @@ function initInput( // 3. Otherwise, false node.defaultChecked = !node.defaultChecked; node.defaultChecked = !!initialChecked; - } + } // Name needs to be set at the end so that it applies atomically to connected radio buttons. + + if ( + name != null && + typeof name !== "function" && + typeof name !== "symbol" && + typeof name !== "boolean" + ) { + { + checkAttributeStringCoercion(name, "name"); + } - if (name !== "") { node.name = name; } } @@ -3978,7 +4031,8 @@ function restoreControlledInputState(element, props) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); var name = props.name; @@ -4034,7 +4088,8 @@ function restoreControlledInputState(element, props) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -33739,7 +33794,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-4a39e57d"; +var ReactVersion = "18.3.0-www-classic-9426eac3"; function createPortal$1( children, @@ -38828,6 +38883,7 @@ function setInitialProperties(domElement, tag, props) { // listeners still fire for the invalid event. listenToNonDelegatedEvent("invalid", domElement); + var name = null; var type = null; var value = null; var defaultValue = null; @@ -38846,35 +38902,18 @@ function setInitialProperties(domElement, tag, props) { } switch (propKey) { - case "type": { - // Fast path since 'type' is very common on inputs - if ( - propValue != null && - typeof propValue !== "function" && - typeof propValue !== "symbol" && - typeof propValue !== "boolean" - ) { - type = propValue; - - { - checkAttributeStringCoercion(propValue, propKey); - } - - domElement.setAttribute(propKey, propValue); - } + case "name": { + name = propValue; + break; + } + case "type": { + type = propValue; break; } case "checked": { checked = propValue; - var checkedValue = - propValue != null ? propValue : props.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; break; } @@ -38913,7 +38952,6 @@ function setInitialProperties(domElement, tag, props) { } // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateInputProps(domElement, props); initInput( domElement, @@ -38922,8 +38960,10 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, false ); + track(domElement); return; } @@ -39037,9 +39077,9 @@ function setInitialProperties(domElement, tag, props) { } // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateTextareaProps(domElement, props); initTextarea(domElement, _value2, _defaultValue2, children); + track(domElement); return; } @@ -39366,15 +39406,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && lastProp != null) { switch (propKey) { case "checked": { - if (!nextProps.hasOwnProperty(propKey)) { - var checkedValue = nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; - } - break; } @@ -39407,25 +39438,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) { switch (_propKey7) { case "type": { - type = nextProp; // Fast path since 'type' is very common on inputs - - if (nextProp !== _lastProp) { - if ( - nextProp != null && - typeof nextProp !== "function" && - typeof nextProp !== "symbol" && - typeof nextProp !== "boolean" - ) { - { - checkAttributeStringCoercion(nextProp, _propKey7); - } - - domElement.setAttribute(_propKey7, nextProp); - } else { - domElement.removeAttribute(_propKey7); - } - } - + type = nextProp; break; } @@ -39436,18 +39449,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "checked": { checked = nextProp; - - if (nextProp !== _lastProp) { - var _checkedValue = - nextProp != null ? nextProp : nextProps.defaultChecked; - - var _inputElement = domElement; - _inputElement.checked = - !!_checkedValue && - typeof _checkedValue !== "function" && - _checkedValue !== "symbol"; - } - break; } @@ -39535,23 +39536,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { didWarnControlledToUncontrolled = true; } - } // Update checked *before* name. - // In the middle of an update, it is possible to have multiple checked. - // When a checked radio tries to change name, browser makes another radio's checked false. - - if ( - name != null && - typeof name !== "function" && - typeof name !== "symbol" && - typeof name !== "boolean" - ) { - { - checkAttributeStringCoercion(name, "name"); - } - - domElement.setAttribute("name", name); - } else { - domElement.removeAttribute("name"); } // Update the wrapper around inputs *after* updating props. This has to // happen after updating the rest of props. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. @@ -39563,7 +39547,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; } @@ -39972,22 +39957,6 @@ function updatePropertiesWithDiff( switch (propKey) { case "type": { - // Fast path since 'type' is very common on inputs - if ( - propValue != null && - typeof propValue !== "function" && - typeof propValue !== "symbol" && - typeof propValue !== "boolean" - ) { - { - checkAttributeStringCoercion(propValue, propKey); - } - - domElement.setAttribute(propKey, propValue); - } else { - domElement.removeAttribute(propKey); - } - break; } @@ -39996,13 +39965,6 @@ function updatePropertiesWithDiff( } case "checked": { - var checkedValue = - propValue != null ? propValue : nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; break; } @@ -40078,23 +40040,6 @@ function updatePropertiesWithDiff( didWarnControlledToUncontrolled = true; } - } // Update checked *before* name. - // In the middle of an update, it is possible to have multiple checked. - // When a checked radio tries to change name, browser makes another radio's checked false. - - if ( - name != null && - typeof name !== "function" && - typeof name !== "symbol" && - typeof name !== "boolean" - ) { - { - checkAttributeStringCoercion(name, "name"); - } - - domElement.setAttribute("name", name); - } else { - domElement.removeAttribute("name"); } // Update the wrapper around inputs *after* updating props. This has to // happen after updating the rest of props. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. @@ -40106,7 +40051,8 @@ function updatePropertiesWithDiff( lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; } @@ -41257,7 +41203,6 @@ function diffHydratedProperties( listenToNonDelegatedEvent("invalid", domElement); // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateInputProps(domElement, props); // For input and textarea we current always set the value property at // post mount to force it to diverge from attributes. However, for // option and select we don't quite do the same thing and select @@ -41271,8 +41216,10 @@ function diffHydratedProperties( props.checked, props.defaultChecked, props.type, + props.name, true ); + track(domElement); break; case "option": @@ -41298,9 +41245,9 @@ function diffHydratedProperties( listenToNonDelegatedEvent("invalid", domElement); // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateTextareaProps(domElement, props); initTextarea(domElement, props.value, props.defaultValue, props.children); + track(domElement); break; } diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 583b3f3b1e..aff0a101eb 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -3616,9 +3616,30 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { - var node = element; + var node = element; // Temporarily disconnect the input from any radio buttons. + // Changing the type or name as the same time as changing the checked value + // needs to be atomically applied. We can only ensure that by disconnecting + // the name while do the mutations and then reapply the name after that's done. + + node.name = ""; + + if ( + type != null && + typeof type !== "function" && + typeof type !== "symbol" && + typeof type !== "boolean" + ) { + { + checkAttributeStringCoercion(type, "type"); + } + + node.type = type; + } else { + node.removeAttribute("type"); + } if (value != null) { if (type === "number") { @@ -3684,6 +3705,21 @@ function updateInput( if (checked != null && node.checked !== !!checked) { node.checked = checked; } + + if ( + name != null && + typeof name !== "function" && + typeof name !== "symbol" && + typeof name !== "boolean" + ) { + { + checkAttributeStringCoercion(name, "name"); + } + + node.name = name; + } else { + node.removeAttribute("name"); + } } function initInput( element, @@ -3692,10 +3728,24 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { var node = element; + if ( + type != null && + typeof type !== "function" && + typeof type !== "symbol" && + typeof type !== "boolean" + ) { + { + checkAttributeStringCoercion(type, "type"); + } + + node.type = type; + } + if (value != null || defaultValue != null) { var isButton = type === "submit" || type === "reset"; // Avoid setting value attribute on submit/reset inputs as it overrides the // default value provided by the browser. See: #12872 @@ -3758,12 +3808,6 @@ function initInput( // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 // We need to temporarily unset name to avoid disrupting radio button groups. - var name = node.name; - - if (name !== "") { - node.name = ""; - } - var checkedOrDefault = checked != null ? checked : defaultChecked; // TODO: This 'function' or 'symbol' check isn't replicated in other places // so this semantic is inconsistent. @@ -3797,9 +3841,18 @@ function initInput( // 3. Otherwise, false node.defaultChecked = !node.defaultChecked; node.defaultChecked = !!initialChecked; - } + } // Name needs to be set at the end so that it applies atomically to connected radio buttons. + + if ( + name != null && + typeof name !== "function" && + typeof name !== "symbol" && + typeof name !== "boolean" + ) { + { + checkAttributeStringCoercion(name, "name"); + } - if (name !== "") { node.name = name; } } @@ -3812,7 +3865,8 @@ function restoreControlledInputState(element, props) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); var name = props.name; @@ -3868,7 +3922,8 @@ function restoreControlledInputState(element, props) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -33576,7 +33631,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-294eaa58"; +var ReactVersion = "18.3.0-www-modern-f1859984"; function createPortal$1( children, @@ -39331,6 +39386,7 @@ function setInitialProperties(domElement, tag, props) { // listeners still fire for the invalid event. listenToNonDelegatedEvent("invalid", domElement); + var name = null; var type = null; var value = null; var defaultValue = null; @@ -39349,35 +39405,18 @@ function setInitialProperties(domElement, tag, props) { } switch (propKey) { - case "type": { - // Fast path since 'type' is very common on inputs - if ( - propValue != null && - typeof propValue !== "function" && - typeof propValue !== "symbol" && - typeof propValue !== "boolean" - ) { - type = propValue; - - { - checkAttributeStringCoercion(propValue, propKey); - } - - domElement.setAttribute(propKey, propValue); - } + case "name": { + name = propValue; + break; + } + case "type": { + type = propValue; break; } case "checked": { checked = propValue; - var checkedValue = - propValue != null ? propValue : props.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; break; } @@ -39416,7 +39455,6 @@ function setInitialProperties(domElement, tag, props) { } // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateInputProps(domElement, props); initInput( domElement, @@ -39425,8 +39463,10 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, false ); + track(domElement); return; } @@ -39537,9 +39577,9 @@ function setInitialProperties(domElement, tag, props) { } // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateTextareaProps(domElement, props); initTextarea(domElement, _value2, _defaultValue2); + track(domElement); return; } @@ -39866,15 +39906,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && lastProp != null) { switch (propKey) { case "checked": { - if (!nextProps.hasOwnProperty(propKey)) { - var checkedValue = nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; - } - break; } @@ -39907,25 +39938,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) { switch (_propKey7) { case "type": { - type = nextProp; // Fast path since 'type' is very common on inputs - - if (nextProp !== _lastProp) { - if ( - nextProp != null && - typeof nextProp !== "function" && - typeof nextProp !== "symbol" && - typeof nextProp !== "boolean" - ) { - { - checkAttributeStringCoercion(nextProp, _propKey7); - } - - domElement.setAttribute(_propKey7, nextProp); - } else { - domElement.removeAttribute(_propKey7); - } - } - + type = nextProp; break; } @@ -39936,18 +39949,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "checked": { checked = nextProp; - - if (nextProp !== _lastProp) { - var _checkedValue = - nextProp != null ? nextProp : nextProps.defaultChecked; - - var _inputElement = domElement; - _inputElement.checked = - !!_checkedValue && - typeof _checkedValue !== "function" && - _checkedValue !== "symbol"; - } - break; } @@ -40035,23 +40036,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { didWarnControlledToUncontrolled = true; } - } // Update checked *before* name. - // In the middle of an update, it is possible to have multiple checked. - // When a checked radio tries to change name, browser makes another radio's checked false. - - if ( - name != null && - typeof name !== "function" && - typeof name !== "symbol" && - typeof name !== "boolean" - ) { - { - checkAttributeStringCoercion(name, "name"); - } - - domElement.setAttribute("name", name); - } else { - domElement.removeAttribute("name"); } // Update the wrapper around inputs *after* updating props. This has to // happen after updating the rest of props. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. @@ -40063,7 +40047,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; } @@ -40472,22 +40457,6 @@ function updatePropertiesWithDiff( switch (propKey) { case "type": { - // Fast path since 'type' is very common on inputs - if ( - propValue != null && - typeof propValue !== "function" && - typeof propValue !== "symbol" && - typeof propValue !== "boolean" - ) { - { - checkAttributeStringCoercion(propValue, propKey); - } - - domElement.setAttribute(propKey, propValue); - } else { - domElement.removeAttribute(propKey); - } - break; } @@ -40496,13 +40465,6 @@ function updatePropertiesWithDiff( } case "checked": { - var checkedValue = - propValue != null ? propValue : nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; break; } @@ -40578,23 +40540,6 @@ function updatePropertiesWithDiff( didWarnControlledToUncontrolled = true; } - } // Update checked *before* name. - // In the middle of an update, it is possible to have multiple checked. - // When a checked radio tries to change name, browser makes another radio's checked false. - - if ( - name != null && - typeof name !== "function" && - typeof name !== "symbol" && - typeof name !== "boolean" - ) { - { - checkAttributeStringCoercion(name, "name"); - } - - domElement.setAttribute("name", name); - } else { - domElement.removeAttribute("name"); } // Update the wrapper around inputs *after* updating props. This has to // happen after updating the rest of props. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. @@ -40606,7 +40551,8 @@ function updatePropertiesWithDiff( lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; } @@ -41757,7 +41703,6 @@ function diffHydratedProperties( listenToNonDelegatedEvent("invalid", domElement); // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateInputProps(domElement, props); // For input and textarea we current always set the value property at // post mount to force it to diverge from attributes. However, for // option and select we don't quite do the same thing and select @@ -41771,8 +41716,10 @@ function diffHydratedProperties( props.checked, props.defaultChecked, props.type, + props.name, true ); + track(domElement); break; case "option": @@ -41798,9 +41745,9 @@ function diffHydratedProperties( listenToNonDelegatedEvent("invalid", domElement); // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateTextareaProps(domElement, props); initTextarea(domElement, props.value, props.defaultValue); + track(domElement); break; } diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index da71c79f0b..86b6a81294 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -974,8 +974,16 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { + element.name = ""; + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type + ? (element.type = type) + : element.removeAttribute("type"); if (null != value) if ("number" === type) { if ((0 === value && "" === element.value) || element.value != value) @@ -1006,6 +1014,12 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name + ? (element.name = name) + : element.removeAttribute("name"); } function initInput( element, @@ -1014,8 +1028,14 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type && + (element.type = type); if (null != value || null != defaultValue) { if ( (type = "submit" === type || "reset" === type) && @@ -1036,16 +1056,17 @@ function initInput( ? null != defaultValue && (element.defaultValue = defaultValueStr) : (element.defaultValue = initialValue); } - value = element.name; - "" !== value && (element.name = ""); - checked = null != checked ? checked : defaultChecked; - checked = - "function" !== typeof checked && "symbol" !== typeof checked && !!checked; - isHydrating || (element.checked = !!checked); + value = null != checked ? checked : defaultChecked; + value = "function" !== typeof value && "symbol" !== typeof value && !!value; + isHydrating || (element.checked = !!value); disableInputAttributeSyncing ? null != defaultChecked && (element.defaultChecked = !!defaultChecked) - : (element.defaultChecked = !!checked); - "" !== value && (element.name = value); + : (element.defaultChecked = !!value); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name && + (element.name = name); } function setDefaultValue(node, type, value) { ("number" === type && getActiveElement(node.ownerDocument) === node) || @@ -1346,7 +1367,8 @@ function restoreStateOfTarget(target) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); internalInstance = props.name; if ("radio" === props.type && null != internalInstance) { @@ -1373,7 +1395,8 @@ function restoreStateOfTarget(target) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -1689,7 +1712,6 @@ function prepareToHydrateHostInstance(fiber) { break; case "input": listenToNonDelegatedEvent("invalid", instance); - track(instance); initInput( instance, props.value, @@ -1697,16 +1719,18 @@ function prepareToHydrateHostInstance(fiber) { props.checked, props.defaultChecked, props.type, + props.name, !0 ); + track(instance); break; case "select": listenToNonDelegatedEvent("invalid", instance); break; case "textarea": listenToNonDelegatedEvent("invalid", instance), - track(instance), - initTextarea(instance, props.value, props.defaultValue, props.children); + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); } i = null; var children = props.children; @@ -12523,19 +12547,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$379; + var JSCompiler_inline_result$jscomp$377; 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_1612 = "oninput" in document; + if (!isSupported$jscomp$inline_1612) { + var element$jscomp$inline_1613 = document.createElement("div"); + element$jscomp$inline_1613.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1612 = + "function" === typeof element$jscomp$inline_1613.oninput; } - JSCompiler_inline_result$jscomp$379 = isSupported$jscomp$inline_1614; - } else JSCompiler_inline_result$jscomp$379 = !1; + JSCompiler_inline_result$jscomp$377 = isSupported$jscomp$inline_1612; + } else JSCompiler_inline_result$jscomp$377 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$379 && + JSCompiler_inline_result$jscomp$377 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -12844,20 +12868,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_1653 = 0; + i$jscomp$inline_1653 < simpleEventPluginEvents.length; + i$jscomp$inline_1653++ ) { - 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_1654 = + simpleEventPluginEvents[i$jscomp$inline_1653], + domEventName$jscomp$inline_1655 = + eventName$jscomp$inline_1654.toLowerCase(), + capitalizedEvent$jscomp$inline_1656 = + eventName$jscomp$inline_1654[0].toUpperCase() + + eventName$jscomp$inline_1654.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1657, - "on" + capitalizedEvent$jscomp$inline_1658 + domEventName$jscomp$inline_1655, + "on" + capitalizedEvent$jscomp$inline_1656 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14031,7 +14055,8 @@ function setInitialProperties(domElement, tag, props) { break; case "input": listenToNonDelegatedEvent("invalid", domElement); - var type = null, + var name = null, + type = null, value = null, defaultValue = null, checked = null, @@ -14041,22 +14066,14 @@ function setInitialProperties(domElement, tag, props) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { + case "name": + name = propValue; + break; case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue && - ((type = propValue), - domElement.setAttribute(propKey, propValue)); + type = propValue; break; case "checked": checked = propValue; - propValue = - null != propValue ? propValue : props.defaultChecked; - domElement.checked = - !!propValue && - "function" !== typeof propValue && - "symbol" !== propValue; break; case "defaultChecked": defaultChecked = propValue; @@ -14076,7 +14093,6 @@ function setInitialProperties(domElement, tag, props) { setProp(domElement, tag, propKey, propValue, props, null); } } - track(domElement); initInput( domElement, value, @@ -14084,31 +14100,33 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, !1 ); + track(domElement); return; case "select": listenToNonDelegatedEvent("invalid", domElement); - var propKey = (value = defaultValue = null); - for (type in props) + var propKey = (type = value = null); + for (name in props) if ( - props.hasOwnProperty(type) && - ((checked = props[type]), null != checked) + props.hasOwnProperty(name) && + ((defaultValue = props[name]), null != defaultValue) ) - switch (type) { + switch (name) { case "value": - defaultValue = checked; + value = defaultValue; break; case "defaultValue": - value = checked; + type = defaultValue; break; case "multiple": - propKey = checked; + propKey = defaultValue; default: - setProp(domElement, tag, type, checked, props, null); + setProp(domElement, tag, name, defaultValue, props, null); } - tag = defaultValue; - props = value; + tag = value; + props = type; domElement.multiple = !!propKey; null != tag ? updateOptions(domElement, !!propKey, tag, !1) @@ -14116,38 +14134,38 @@ function setInitialProperties(domElement, tag, props) { return; case "textarea": listenToNonDelegatedEvent("invalid", domElement); - defaultValue = type = propKey = null; - for (value in props) + value = name = propKey = null; + for (type in props) if ( - props.hasOwnProperty(value) && - ((checked = props[value]), null != checked) + props.hasOwnProperty(type) && + ((defaultValue = props[type]), null != defaultValue) ) - switch (value) { + switch (type) { case "value": - propKey = checked; + propKey = defaultValue; break; case "defaultValue": - type = checked; + name = defaultValue; break; case "children": - defaultValue = checked; + value = defaultValue; break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != defaultValue) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, value, checked, props); + setProp(domElement, tag, type, defaultValue, props); } + initTextarea(domElement, propKey, name, value); track(domElement); - initTextarea(domElement, propKey, type, defaultValue); return; case "option": - for (checked in props) + for (defaultValue in props) if ( - props.hasOwnProperty(checked) && - ((propKey = props[checked]), null != propKey) + props.hasOwnProperty(defaultValue) && + ((propKey = props[defaultValue]), null != propKey) ) - switch (checked) { + switch (defaultValue) { case "selected": domElement.selected = propKey && @@ -14155,7 +14173,7 @@ function setInitialProperties(domElement, tag, props) { "symbol" !== typeof propKey; break; default: - setProp(domElement, tag, checked, propKey, props); + setProp(domElement, tag, defaultValue, propKey, props); } return; case "dialog": @@ -14195,29 +14213,29 @@ function setInitialProperties(domElement, tag, props) { case "track": case "wbr": case "menuitem": - for (defaultChecked in props) + for (checked in props) if ( - props.hasOwnProperty(defaultChecked) && - ((propKey = props[defaultChecked]), null != propKey) + props.hasOwnProperty(checked) && + ((propKey = props[checked]), null != propKey) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": throw Error(formatProdErrorMessage(137, tag)); default: - setProp(domElement, tag, defaultChecked, propKey, props, null); + setProp(domElement, tag, checked, propKey, props, null); } return; default: if (isCustomElement(tag)) { - for (propValue in props) - props.hasOwnProperty(propValue) && - ((propKey = props[propValue]), + for (defaultChecked in props) + props.hasOwnProperty(defaultChecked) && + ((propKey = props[defaultChecked]), null != propKey && setPropOnCustomElement( domElement, tag, - propValue, + defaultChecked, propKey, props, null @@ -14225,11 +14243,10 @@ function setInitialProperties(domElement, tag, props) { return; } } - for (defaultValue in props) - props.hasOwnProperty(defaultValue) && - ((propKey = props[defaultValue]), - null != propKey && - setProp(domElement, tag, defaultValue, propKey, props, null)); + for (value in props) + props.hasOwnProperty(value) && + ((propKey = props[value]), + null != propKey && setProp(domElement, tag, value, propKey, props, null)); } function updateProperties(domElement, tag, lastProps, nextProps) { switch (tag) { @@ -14255,12 +14272,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - nextProps.hasOwnProperty(propKey) || - ((lastProp = nextProps.defaultChecked), - (domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp)); break; case "value": break; @@ -14281,26 +14292,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (propKey$213) { case "type": type = propKey; - propKey !== lastProp && - (null != propKey && - "function" !== typeof propKey && - "symbol" !== typeof propKey && - "boolean" !== typeof propKey - ? domElement.setAttribute(propKey$213, propKey) - : domElement.removeAttribute(propKey$213)); break; case "name": name = propKey; break; case "checked": checked = propKey; - propKey !== lastProp && - ((propKey = - null != propKey ? propKey : nextProps.defaultChecked), - (domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey)); break; case "defaultChecked": defaultChecked = propKey; @@ -14328,12 +14325,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -14341,7 +14332,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -14438,14 +14430,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { updateTextarea(domElement, propKey$213, propKey); return; case "option": - for (var propKey$231 in lastProps) + for (var propKey$229 in lastProps) if ( - ((propKey$213 = lastProps[propKey$231]), - lastProps.hasOwnProperty(propKey$231) && + ((propKey$213 = lastProps[propKey$229]), + lastProps.hasOwnProperty(propKey$229) && null != propKey$213 && - !nextProps.hasOwnProperty(propKey$231)) + !nextProps.hasOwnProperty(propKey$229)) ) - switch (propKey$231) { + switch (propKey$229) { case "selected": domElement.selected = !1; break; @@ -14453,7 +14445,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$231, + propKey$229, null, nextProps, propKey$213 @@ -14500,12 +14492,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$236 in lastProps) - (propKey$213 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && + for (var propKey$234 in lastProps) + (propKey$213 = lastProps[propKey$234]), + lastProps.hasOwnProperty(propKey$234) && null != propKey$213 && - !nextProps.hasOwnProperty(propKey$236) && - setProp(domElement, tag, propKey$236, null, nextProps, propKey$213); + !nextProps.hasOwnProperty(propKey$234) && + setProp(domElement, tag, propKey$234, null, nextProps, propKey$213); for (checked in nextProps) if ( ((propKey$213 = nextProps[checked]), @@ -14533,15 +14525,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$241 in lastProps) - (propKey$213 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && + for (var propKey$239 in lastProps) + (propKey$213 = lastProps[propKey$239]), + lastProps.hasOwnProperty(propKey$239) && null != propKey$213 && - !nextProps.hasOwnProperty(propKey$241) && + !nextProps.hasOwnProperty(propKey$239) && setPropOnCustomElement( domElement, tag, - propKey$241, + propKey$239, null, nextProps, propKey$213 @@ -14563,12 +14555,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; } } - for (var propKey$246 in lastProps) - (propKey$213 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && + for (var propKey$244 in lastProps) + (propKey$213 = lastProps[propKey$244]), + lastProps.hasOwnProperty(propKey$244) && null != propKey$213 && - !nextProps.hasOwnProperty(propKey$246) && - setProp(domElement, tag, propKey$246, null, nextProps, propKey$213); + !nextProps.hasOwnProperty(propKey$244) && + setProp(domElement, tag, propKey$244, null, nextProps, propKey$213); for (lastProp in nextProps) (propKey$213 = nextProps[lastProp]), (propKey = lastProps[lastProp]), @@ -14611,21 +14603,10 @@ function updatePropertiesWithDiff( propValue = updatePayload[i + 1]; switch (propKey) { case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue - ? domElement.setAttribute(propKey, propValue) - : domElement.removeAttribute(propKey); break; case "name": break; case "checked": - propKey = null != propValue ? propValue : nextProps.defaultChecked; - domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey; break; case "defaultChecked": break; @@ -14642,12 +14623,6 @@ function updatePropertiesWithDiff( setProp(domElement, tag, propKey, propValue, nextProps, null); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -14655,7 +14630,8 @@ function updatePropertiesWithDiff( lastProps, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -15093,14 +15069,14 @@ function preinit$1(href, options) { switch (as) { case "style": as = getResourcesFromRoot(resourceRoot).hoistableStyles; - var key$274 = getStyleKey(href), + var key$272 = getStyleKey(href), precedence = options.precedence || "default", - resource = as.get(key$274); + resource = as.get(key$272); if (resource) break; var state = { loading: 0, preload: null }; if ( (resource = resourceRoot.querySelector( - getStylesheetSelectorFromKey(key$274) + getStylesheetSelectorFromKey(key$272) )) ) state.loading = 1; @@ -15111,7 +15087,7 @@ function preinit$1(href, options) { "data-precedence": precedence, crossOrigin: options.crossOrigin }; - (options = preloadPropsMap.get(key$274)) && + (options = preloadPropsMap.get(key$272)) && adoptPreloadPropsForStylesheet(href, options); var link = (resource = ( resourceRoot.ownerDocument || resourceRoot @@ -15137,15 +15113,15 @@ function preinit$1(href, options) { count: 1, state: state }; - as.set(key$274, resource); + as.set(key$272, resource); break; case "script": (as = getResourcesFromRoot(resourceRoot).hoistableScripts), - (key$274 = getScriptKey(href)), - (precedence = as.get(key$274)), + (key$272 = getScriptKey(href)), + (precedence = as.get(key$272)), precedence || ((precedence = resourceRoot.querySelector( - "script[async]" + key$274 + "script[async]" + key$272 )), precedence || ((href = { @@ -15154,7 +15130,7 @@ function preinit$1(href, options) { crossOrigin: options.crossOrigin, integrity: options.integrity }), - (options = preloadPropsMap.get(key$274)) && + (options = preloadPropsMap.get(key$272)) && adoptPreloadPropsForScript(href, options), (options = resourceRoot.ownerDocument || resourceRoot), (precedence = options.createElement("script")), @@ -15167,13 +15143,13 @@ function preinit$1(href, options) { count: 1, state: null }), - as.set(key$274, precedence)); + as.set(key$272, precedence)); } else if ("style" === as || "script" === as) if ((resourceRoot = getDocumentForPreloads())) { - key$274 = escapeSelectorAttributeValueInsideDoubleQuotes(href); - precedence = key$274 = - 'link[rel="preload"][as="' + as + '"][href="' + key$274 + '"]'; + key$272 = escapeSelectorAttributeValueInsideDoubleQuotes(href); + precedence = key$272 = + 'link[rel="preload"][as="' + as + '"][href="' + key$272 + '"]'; switch (as) { case "style": precedence = getStyleKey(href); @@ -15190,7 +15166,7 @@ function preinit$1(href, options) { integrity: options.integrity }), preloadPropsMap.set(precedence, href), - null === resourceRoot.querySelector(key$274) && + null === resourceRoot.querySelector(key$272) && ((options = resourceRoot.createElement("link")), setInitialProperties(options, "link", href), markNodeAsHoistable(options), @@ -15223,17 +15199,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$283 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$284 = styles$283.get(type); - resource$284 || + var styles$281 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$282 = styles$281.get(type); + resource$282 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$284 = { + (resource$282 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$283.set(type, resource$284), + styles$281.set(type, resource$282), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15248,9 +15224,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$284.state + resource$282.state )); - return resource$284; + return resource$282; } return null; case "script": @@ -15322,36 +15298,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = key); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$289 = hoistableRoot.querySelector( + var instance$287 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$289) + if (instance$287) return ( - (resource.instance = instance$289), - markNodeAsHoistable(instance$289), - instance$289 + (resource.instance = instance$287), + markNodeAsHoistable(instance$287), + instance$287 ); key = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(key, styleProps); - instance$289 = ( + instance$287 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$289); - var linkInstance = instance$289; + markNodeAsHoistable(instance$287); + var linkInstance = instance$287; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$289, "link", key); + setInitialProperties(instance$287, "link", key); resource.state.loading |= 4; - insertStylesheet(instance$289, props.precedence, hoistableRoot); - return (resource.instance = instance$289); + insertStylesheet(instance$287, props.precedence, hoistableRoot); + return (resource.instance = instance$287); case "script": - instance$289 = getScriptKey(props.src); + instance$287 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$289 + "script[async]" + instance$287 )) ) return ( @@ -15360,7 +15336,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); key = props; - if ((styleProps = preloadPropsMap.get(instance$289))) + if ((styleProps = preloadPropsMap.get(instance$287))) (key = assign({}, props)), adoptPreloadPropsForScript(key, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16309,11 +16285,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$309); + var instance = getPublicRootInstance(root$307); originalCallback.call(instance); }; } - var root$309 = createHydrationContainer( + var root$307 = createHydrationContainer( initialChildren, callback, container, @@ -16325,23 +16301,23 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$309; - container[internalContainerInstanceKey] = root$309.current; + container._reactRootContainer = root$307; + container[internalContainerInstanceKey] = root$307.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$309; + return root$307; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$310 = callback; + var originalCallback$308 = callback; callback = function () { - var instance = getPublicRootInstance(root$311); - originalCallback$310.call(instance); + var instance = getPublicRootInstance(root$309); + originalCallback$308.call(instance); }; } - var root$311 = createFiberRoot( + var root$309 = createFiberRoot( container, 0, !1, @@ -16353,15 +16329,15 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$311; - container[internalContainerInstanceKey] = root$311.current; + container._reactRootContainer = root$309; + container[internalContainerInstanceKey] = root$309.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$311, parentComponent, callback); + updateContainer(initialChildren, root$309, parentComponent, callback); }); - return root$311; + return root$309; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -16420,17 +16396,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1856 = { +var devToolsConfig$jscomp$inline_1854 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-f6cc5f2f", + version: "18.3.0-www-classic-9ec9c909", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2222 = { - bundleType: devToolsConfig$jscomp$inline_1856.bundleType, - version: devToolsConfig$jscomp$inline_1856.version, - rendererPackageName: devToolsConfig$jscomp$inline_1856.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1856.rendererConfig, +var internals$jscomp$inline_2220 = { + bundleType: devToolsConfig$jscomp$inline_1854.bundleType, + version: devToolsConfig$jscomp$inline_1854.version, + rendererPackageName: devToolsConfig$jscomp$inline_1854.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1854.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16446,26 +16422,26 @@ var internals$jscomp$inline_2222 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1856.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1854.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-f6cc5f2f" + reconcilerVersion: "18.3.0-www-classic-9ec9c909" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2223 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2221 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2223.isDisabled && - hook$jscomp$inline_2223.supportsFiber + !hook$jscomp$inline_2221.isDisabled && + hook$jscomp$inline_2221.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2223.inject( - internals$jscomp$inline_2222 + (rendererID = hook$jscomp$inline_2221.inject( + internals$jscomp$inline_2220 )), - (injectedHook = hook$jscomp$inline_2223); + (injectedHook = hook$jscomp$inline_2221); } catch (err) {} } assign(Internals, { @@ -16693,4 +16669,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-f6cc5f2f"; +exports.version = "18.3.0-www-classic-9ec9c909"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 5dcc73df56..4cafdce540 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -823,8 +823,16 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { + element.name = ""; + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type + ? (element.type = type) + : element.removeAttribute("type"); if (null != value) if ("number" === type) { if ((0 === value && "" === element.value) || element.value != value) @@ -855,6 +863,12 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name + ? (element.name = name) + : element.removeAttribute("name"); } function initInput( element, @@ -863,8 +877,14 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type && + (element.type = type); if (null != value || null != defaultValue) { if ( (type = "submit" === type || "reset" === type) && @@ -885,16 +905,17 @@ function initInput( ? null != defaultValue && (element.defaultValue = defaultValueStr) : (element.defaultValue = initialValue); } - value = element.name; - "" !== value && (element.name = ""); - checked = null != checked ? checked : defaultChecked; - checked = - "function" !== typeof checked && "symbol" !== typeof checked && !!checked; - isHydrating || (element.checked = !!checked); + value = null != checked ? checked : defaultChecked; + value = "function" !== typeof value && "symbol" !== typeof value && !!value; + isHydrating || (element.checked = !!value); disableInputAttributeSyncing ? null != defaultChecked && (element.defaultChecked = !!defaultChecked) - : (element.defaultChecked = !!checked); - "" !== value && (element.name = value); + : (element.defaultChecked = !!value); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name && + (element.name = name); } function setDefaultValue(node, type, value) { ("number" === type && getActiveElement(node.ownerDocument) === node) || @@ -1186,7 +1207,8 @@ function restoreStateOfTarget(target) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); internalInstance = props.name; if ("radio" === props.type && null != internalInstance) { @@ -1213,7 +1235,8 @@ function restoreStateOfTarget(target) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -1577,7 +1600,6 @@ function prepareToHydrateHostInstance(fiber) { break; case "input": listenToNonDelegatedEvent("invalid", instance); - track(instance); initInput( instance, props.value, @@ -1585,16 +1607,18 @@ function prepareToHydrateHostInstance(fiber) { props.checked, props.defaultChecked, props.type, + props.name, !0 ); + track(instance); break; case "select": listenToNonDelegatedEvent("invalid", instance); break; case "textarea": listenToNonDelegatedEvent("invalid", instance), - track(instance), - initTextarea(instance, props.value, props.defaultValue); + initTextarea(instance, props.value, props.defaultValue), + track(instance); } i = null; var children = props.children; @@ -12755,19 +12779,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$376; + var JSCompiler_inline_result$jscomp$374; if (canUseDOM) { - 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; + var isSupported$jscomp$inline_1604 = "oninput" in document; + if (!isSupported$jscomp$inline_1604) { + var element$jscomp$inline_1605 = document.createElement("div"); + element$jscomp$inline_1605.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1604 = + "function" === typeof element$jscomp$inline_1605.oninput; } - JSCompiler_inline_result$jscomp$376 = isSupported$jscomp$inline_1606; - } else JSCompiler_inline_result$jscomp$376 = !1; + JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1604; + } else JSCompiler_inline_result$jscomp$374 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$376 && + JSCompiler_inline_result$jscomp$374 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13076,20 +13100,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1647 = 0; - i$jscomp$inline_1647 < simpleEventPluginEvents.length; - i$jscomp$inline_1647++ + var i$jscomp$inline_1645 = 0; + i$jscomp$inline_1645 < simpleEventPluginEvents.length; + i$jscomp$inline_1645++ ) { - 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); + var eventName$jscomp$inline_1646 = + simpleEventPluginEvents[i$jscomp$inline_1645], + domEventName$jscomp$inline_1647 = + eventName$jscomp$inline_1646.toLowerCase(), + capitalizedEvent$jscomp$inline_1648 = + eventName$jscomp$inline_1646[0].toUpperCase() + + eventName$jscomp$inline_1646.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1649, - "on" + capitalizedEvent$jscomp$inline_1650 + domEventName$jscomp$inline_1647, + "on" + capitalizedEvent$jscomp$inline_1648 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14263,7 +14287,8 @@ function setInitialProperties(domElement, tag, props) { break; case "input": listenToNonDelegatedEvent("invalid", domElement); - var type = null, + var name = null, + type = null, value = null, defaultValue = null, checked = null, @@ -14273,22 +14298,14 @@ function setInitialProperties(domElement, tag, props) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { + case "name": + name = propValue; + break; case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue && - ((type = propValue), - domElement.setAttribute(propKey, propValue)); + type = propValue; break; case "checked": checked = propValue; - propValue = - null != propValue ? propValue : props.defaultChecked; - domElement.checked = - !!propValue && - "function" !== typeof propValue && - "symbol" !== propValue; break; case "defaultChecked": defaultChecked = propValue; @@ -14308,7 +14325,6 @@ function setInitialProperties(domElement, tag, props) { setProp(domElement, tag, propKey, propValue, props, null); } } - track(domElement); initInput( domElement, value, @@ -14316,31 +14332,33 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, !1 ); + track(domElement); return; case "select": listenToNonDelegatedEvent("invalid", domElement); - var propKey = (value = defaultValue = null); - for (type in props) + var propKey = (type = value = null); + for (name in props) if ( - props.hasOwnProperty(type) && - ((checked = props[type]), null != checked) + props.hasOwnProperty(name) && + ((defaultValue = props[name]), null != defaultValue) ) - switch (type) { + switch (name) { case "value": - defaultValue = checked; + value = defaultValue; break; case "defaultValue": - value = checked; + type = defaultValue; break; case "multiple": - propKey = checked; + propKey = defaultValue; default: - setProp(domElement, tag, type, checked, props, null); + setProp(domElement, tag, name, defaultValue, props, null); } - tag = defaultValue; - props = value; + tag = value; + props = type; domElement.multiple = !!propKey; null != tag ? updateOptions(domElement, !!propKey, tag, !1) @@ -14348,37 +14366,37 @@ function setInitialProperties(domElement, tag, props) { return; case "textarea": listenToNonDelegatedEvent("invalid", domElement); - type = propKey = null; - for (value in props) + name = propKey = null; + for (type in props) if ( - props.hasOwnProperty(value) && - ((defaultValue = props[value]), null != defaultValue) + props.hasOwnProperty(type) && + ((value = props[type]), null != value) ) - switch (value) { + switch (type) { case "value": - propKey = defaultValue; + propKey = value; break; case "defaultValue": - type = defaultValue; + name = value; break; case "children": break; case "dangerouslySetInnerHTML": - if (null != defaultValue) throw Error(formatProdErrorMessage(91)); + if (null != value) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, value, defaultValue, props); + setProp(domElement, tag, type, value, props); } + initTextarea(domElement, propKey, name); track(domElement); - initTextarea(domElement, propKey, type); return; case "option": - for (checked in props) + for (defaultValue in props) if ( - props.hasOwnProperty(checked) && - ((propKey = props[checked]), null != propKey) + props.hasOwnProperty(defaultValue) && + ((propKey = props[defaultValue]), null != propKey) ) - switch (checked) { + switch (defaultValue) { case "selected": domElement.selected = propKey && @@ -14386,7 +14404,7 @@ function setInitialProperties(domElement, tag, props) { "symbol" !== typeof propKey; break; default: - setProp(domElement, tag, checked, propKey, props); + setProp(domElement, tag, defaultValue, propKey, props); } return; case "dialog": @@ -14426,29 +14444,29 @@ function setInitialProperties(domElement, tag, props) { case "track": case "wbr": case "menuitem": - for (defaultChecked in props) + for (checked in props) if ( - props.hasOwnProperty(defaultChecked) && - ((propKey = props[defaultChecked]), null != propKey) + props.hasOwnProperty(checked) && + ((propKey = props[checked]), null != propKey) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": throw Error(formatProdErrorMessage(137, tag)); default: - setProp(domElement, tag, defaultChecked, propKey, props, null); + setProp(domElement, tag, checked, propKey, props, null); } return; default: if (isCustomElement(tag)) { - for (propValue in props) - props.hasOwnProperty(propValue) && - ((propKey = props[propValue]), + for (defaultChecked in props) + props.hasOwnProperty(defaultChecked) && + ((propKey = props[defaultChecked]), null != propKey && setPropOnCustomElement( domElement, tag, - propValue, + defaultChecked, propKey, props, null @@ -14456,11 +14474,10 @@ function setInitialProperties(domElement, tag, props) { return; } } - for (defaultValue in props) - props.hasOwnProperty(defaultValue) && - ((propKey = props[defaultValue]), - null != propKey && - setProp(domElement, tag, defaultValue, propKey, props, null)); + for (value in props) + props.hasOwnProperty(value) && + ((propKey = props[value]), + null != propKey && setProp(domElement, tag, value, propKey, props, null)); } function updateProperties(domElement, tag, lastProps, nextProps) { switch (tag) { @@ -14486,12 +14503,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - nextProps.hasOwnProperty(propKey) || - ((lastProp = nextProps.defaultChecked), - (domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp)); break; case "value": break; @@ -14512,26 +14523,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (propKey$217) { case "type": type = propKey; - propKey !== lastProp && - (null != propKey && - "function" !== typeof propKey && - "symbol" !== typeof propKey && - "boolean" !== typeof propKey - ? domElement.setAttribute(propKey$217, propKey) - : domElement.removeAttribute(propKey$217)); break; case "name": name = propKey; break; case "checked": checked = propKey; - propKey !== lastProp && - ((propKey = - null != propKey ? propKey : nextProps.defaultChecked), - (domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey)); break; case "defaultChecked": defaultChecked = propKey; @@ -14559,12 +14556,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -14572,7 +14563,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -14669,14 +14661,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { updateTextarea(domElement, propKey$217, propKey); return; case "option": - for (var propKey$235 in lastProps) + for (var propKey$233 in lastProps) if ( - ((propKey$217 = lastProps[propKey$235]), - lastProps.hasOwnProperty(propKey$235) && + ((propKey$217 = lastProps[propKey$233]), + lastProps.hasOwnProperty(propKey$233) && null != propKey$217 && - !nextProps.hasOwnProperty(propKey$235)) + !nextProps.hasOwnProperty(propKey$233)) ) - switch (propKey$235) { + switch (propKey$233) { case "selected": domElement.selected = !1; break; @@ -14684,7 +14676,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$235, + propKey$233, null, nextProps, propKey$217 @@ -14731,12 +14723,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$240 in lastProps) - (propKey$217 = lastProps[propKey$240]), - lastProps.hasOwnProperty(propKey$240) && + for (var propKey$238 in lastProps) + (propKey$217 = lastProps[propKey$238]), + lastProps.hasOwnProperty(propKey$238) && null != propKey$217 && - !nextProps.hasOwnProperty(propKey$240) && - setProp(domElement, tag, propKey$240, null, nextProps, propKey$217); + !nextProps.hasOwnProperty(propKey$238) && + setProp(domElement, tag, propKey$238, null, nextProps, propKey$217); for (checked in nextProps) if ( ((propKey$217 = nextProps[checked]), @@ -14764,15 +14756,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$245 in lastProps) - (propKey$217 = lastProps[propKey$245]), - lastProps.hasOwnProperty(propKey$245) && + for (var propKey$243 in lastProps) + (propKey$217 = lastProps[propKey$243]), + lastProps.hasOwnProperty(propKey$243) && null != propKey$217 && - !nextProps.hasOwnProperty(propKey$245) && + !nextProps.hasOwnProperty(propKey$243) && setPropOnCustomElement( domElement, tag, - propKey$245, + propKey$243, null, nextProps, propKey$217 @@ -14794,12 +14786,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; } } - for (var propKey$250 in lastProps) - (propKey$217 = lastProps[propKey$250]), - lastProps.hasOwnProperty(propKey$250) && + for (var propKey$248 in lastProps) + (propKey$217 = lastProps[propKey$248]), + lastProps.hasOwnProperty(propKey$248) && null != propKey$217 && - !nextProps.hasOwnProperty(propKey$250) && - setProp(domElement, tag, propKey$250, null, nextProps, propKey$217); + !nextProps.hasOwnProperty(propKey$248) && + setProp(domElement, tag, propKey$248, null, nextProps, propKey$217); for (lastProp in nextProps) (propKey$217 = nextProps[lastProp]), (propKey = lastProps[lastProp]), @@ -14842,21 +14834,10 @@ function updatePropertiesWithDiff( propValue = updatePayload[i + 1]; switch (propKey) { case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue - ? domElement.setAttribute(propKey, propValue) - : domElement.removeAttribute(propKey); break; case "name": break; case "checked": - propKey = null != propValue ? propValue : nextProps.defaultChecked; - domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey; break; case "defaultChecked": break; @@ -14873,12 +14854,6 @@ function updatePropertiesWithDiff( setProp(domElement, tag, propKey, propValue, nextProps, null); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -14886,7 +14861,8 @@ function updatePropertiesWithDiff( lastProps, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -15310,14 +15286,14 @@ function preinit$1(href, options) { switch (as) { case "style": as = getResourcesFromRoot(resourceRoot).hoistableStyles; - var key$278 = getStyleKey(href), + var key$276 = getStyleKey(href), precedence = options.precedence || "default", - resource = as.get(key$278); + resource = as.get(key$276); if (resource) break; var state = { loading: 0, preload: null }; if ( (resource = resourceRoot.querySelector( - getStylesheetSelectorFromKey(key$278) + getStylesheetSelectorFromKey(key$276) )) ) state.loading = 1; @@ -15328,7 +15304,7 @@ function preinit$1(href, options) { "data-precedence": precedence, crossOrigin: options.crossOrigin }; - (options = preloadPropsMap.get(key$278)) && + (options = preloadPropsMap.get(key$276)) && adoptPreloadPropsForStylesheet(href, options); var link = (resource = ( resourceRoot.ownerDocument || resourceRoot @@ -15354,15 +15330,15 @@ function preinit$1(href, options) { count: 1, state: state }; - as.set(key$278, resource); + as.set(key$276, resource); break; case "script": (as = getResourcesFromRoot(resourceRoot).hoistableScripts), - (key$278 = getScriptKey(href)), - (precedence = as.get(key$278)), + (key$276 = getScriptKey(href)), + (precedence = as.get(key$276)), precedence || ((precedence = resourceRoot.querySelector( - "script[async]" + key$278 + "script[async]" + key$276 )), precedence || ((href = { @@ -15371,7 +15347,7 @@ function preinit$1(href, options) { crossOrigin: options.crossOrigin, integrity: options.integrity }), - (options = preloadPropsMap.get(key$278)) && + (options = preloadPropsMap.get(key$276)) && adoptPreloadPropsForScript(href, options), (options = resourceRoot.ownerDocument || resourceRoot), (precedence = options.createElement("script")), @@ -15384,13 +15360,13 @@ function preinit$1(href, options) { count: 1, state: null }), - as.set(key$278, precedence)); + as.set(key$276, precedence)); } else if ("style" === as || "script" === as) if ((resourceRoot = getDocumentForPreloads())) { - key$278 = escapeSelectorAttributeValueInsideDoubleQuotes(href); - precedence = key$278 = - 'link[rel="preload"][as="' + as + '"][href="' + key$278 + '"]'; + key$276 = escapeSelectorAttributeValueInsideDoubleQuotes(href); + precedence = key$276 = + 'link[rel="preload"][as="' + as + '"][href="' + key$276 + '"]'; switch (as) { case "style": precedence = getStyleKey(href); @@ -15407,7 +15383,7 @@ function preinit$1(href, options) { integrity: options.integrity }), preloadPropsMap.set(precedence, href), - null === resourceRoot.querySelector(key$278) && + null === resourceRoot.querySelector(key$276) && ((options = resourceRoot.createElement("link")), setInitialProperties(options, "link", href), markNodeAsHoistable(options), @@ -15440,17 +15416,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$287 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$288 = styles$287.get(type); - resource$288 || + var styles$285 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$286 = styles$285.get(type); + resource$286 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$288 = { + (resource$286 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$287.set(type, resource$288), + styles$285.set(type, resource$286), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15465,9 +15441,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$288.state + resource$286.state )); - return resource$288; + return resource$286; } return null; case "script": @@ -15539,36 +15515,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = key); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$293 = hoistableRoot.querySelector( + var instance$291 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$293) + if (instance$291) return ( - (resource.instance = instance$293), - markNodeAsHoistable(instance$293), - instance$293 + (resource.instance = instance$291), + markNodeAsHoistable(instance$291), + instance$291 ); key = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(key, styleProps); - instance$293 = ( + instance$291 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$293); - var linkInstance = instance$293; + markNodeAsHoistable(instance$291); + var linkInstance = instance$291; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$293, "link", key); + setInitialProperties(instance$291, "link", key); resource.state.loading |= 4; - insertStylesheet(instance$293, props.precedence, hoistableRoot); - return (resource.instance = instance$293); + insertStylesheet(instance$291, props.precedence, hoistableRoot); + return (resource.instance = instance$291); case "script": - instance$293 = getScriptKey(props.src); + instance$291 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$293 + "script[async]" + instance$291 )) ) return ( @@ -15577,7 +15553,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); key = props; - if ((styleProps = preloadPropsMap.get(instance$293))) + if ((styleProps = preloadPropsMap.get(instance$291))) (key = assign({}, props)), adoptPreloadPropsForScript(key, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -15947,17 +15923,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1815 = { +var devToolsConfig$jscomp$inline_1813 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-a246c2d9", + version: "18.3.0-www-modern-bef2a863", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2186 = { - bundleType: devToolsConfig$jscomp$inline_1815.bundleType, - version: devToolsConfig$jscomp$inline_1815.version, - rendererPackageName: devToolsConfig$jscomp$inline_1815.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1815.rendererConfig, +var internals$jscomp$inline_2184 = { + bundleType: devToolsConfig$jscomp$inline_1813.bundleType, + version: devToolsConfig$jscomp$inline_1813.version, + rendererPackageName: devToolsConfig$jscomp$inline_1813.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1813.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -15974,26 +15950,26 @@ var internals$jscomp$inline_2186 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1815.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1813.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-a246c2d9" + reconcilerVersion: "18.3.0-www-modern-bef2a863" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2187 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2185 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2187.isDisabled && - hook$jscomp$inline_2187.supportsFiber + !hook$jscomp$inline_2185.isDisabled && + hook$jscomp$inline_2185.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2187.inject( - internals$jscomp$inline_2186 + (rendererID = hook$jscomp$inline_2185.inject( + internals$jscomp$inline_2184 )), - (injectedHook = hook$jscomp$inline_2187); + (injectedHook = hook$jscomp$inline_2185); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; @@ -16149,4 +16125,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-a246c2d9"; +exports.version = "18.3.0-www-modern-bef2a863"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 1a92ab09ba..30ec1c3dd5 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -1118,8 +1118,16 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { + element.name = ""; + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type + ? (element.type = type) + : element.removeAttribute("type"); if (null != value) if ("number" === type) { if ((0 === value && "" === element.value) || element.value != value) @@ -1150,6 +1158,12 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name + ? (element.name = name) + : element.removeAttribute("name"); } function initInput( element, @@ -1158,8 +1172,14 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type && + (element.type = type); if (null != value || null != defaultValue) { if ( (type = "submit" === type || "reset" === type) && @@ -1180,16 +1200,17 @@ function initInput( ? null != defaultValue && (element.defaultValue = defaultValueStr) : (element.defaultValue = initialValue); } - value = element.name; - "" !== value && (element.name = ""); - checked = null != checked ? checked : defaultChecked; - checked = - "function" !== typeof checked && "symbol" !== typeof checked && !!checked; - isHydrating || (element.checked = !!checked); + value = null != checked ? checked : defaultChecked; + value = "function" !== typeof value && "symbol" !== typeof value && !!value; + isHydrating || (element.checked = !!value); disableInputAttributeSyncing ? null != defaultChecked && (element.defaultChecked = !!defaultChecked) - : (element.defaultChecked = !!checked); - "" !== value && (element.name = value); + : (element.defaultChecked = !!value); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name && + (element.name = name); } function setDefaultValue(node, type, value) { ("number" === type && getActiveElement(node.ownerDocument) === node) || @@ -1490,7 +1511,8 @@ function restoreStateOfTarget(target) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); internalInstance = props.name; if ("radio" === props.type && null != internalInstance) { @@ -1517,7 +1539,8 @@ function restoreStateOfTarget(target) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -1833,7 +1856,6 @@ function prepareToHydrateHostInstance(fiber) { break; case "input": listenToNonDelegatedEvent("invalid", instance); - track(instance); initInput( instance, props.value, @@ -1841,16 +1863,18 @@ function prepareToHydrateHostInstance(fiber) { props.checked, props.defaultChecked, props.type, + props.name, !0 ); + track(instance); break; case "select": listenToNonDelegatedEvent("invalid", instance); break; case "textarea": listenToNonDelegatedEvent("invalid", instance), - track(instance), - initTextarea(instance, props.value, props.defaultValue, props.children); + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); } i = null; var children = props.children; @@ -13297,19 +13321,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$400; + var JSCompiler_inline_result$jscomp$398; if (canUseDOM) { - var isSupported$jscomp$inline_1695 = "oninput" in document; - if (!isSupported$jscomp$inline_1695) { - var element$jscomp$inline_1696 = document.createElement("div"); - element$jscomp$inline_1696.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1695 = - "function" === typeof element$jscomp$inline_1696.oninput; + var isSupported$jscomp$inline_1693 = "oninput" in document; + if (!isSupported$jscomp$inline_1693) { + var element$jscomp$inline_1694 = document.createElement("div"); + element$jscomp$inline_1694.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1693 = + "function" === typeof element$jscomp$inline_1694.oninput; } - JSCompiler_inline_result$jscomp$400 = isSupported$jscomp$inline_1695; - } else JSCompiler_inline_result$jscomp$400 = !1; + JSCompiler_inline_result$jscomp$398 = isSupported$jscomp$inline_1693; + } else JSCompiler_inline_result$jscomp$398 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$400 && + JSCompiler_inline_result$jscomp$398 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13618,20 +13642,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1736 = 0; - i$jscomp$inline_1736 < simpleEventPluginEvents.length; - i$jscomp$inline_1736++ + var i$jscomp$inline_1734 = 0; + i$jscomp$inline_1734 < simpleEventPluginEvents.length; + i$jscomp$inline_1734++ ) { - var eventName$jscomp$inline_1737 = - simpleEventPluginEvents[i$jscomp$inline_1736], - domEventName$jscomp$inline_1738 = - eventName$jscomp$inline_1737.toLowerCase(), - capitalizedEvent$jscomp$inline_1739 = - eventName$jscomp$inline_1737[0].toUpperCase() + - eventName$jscomp$inline_1737.slice(1); + var eventName$jscomp$inline_1735 = + simpleEventPluginEvents[i$jscomp$inline_1734], + domEventName$jscomp$inline_1736 = + eventName$jscomp$inline_1735.toLowerCase(), + capitalizedEvent$jscomp$inline_1737 = + eventName$jscomp$inline_1735[0].toUpperCase() + + eventName$jscomp$inline_1735.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1738, - "on" + capitalizedEvent$jscomp$inline_1739 + domEventName$jscomp$inline_1736, + "on" + capitalizedEvent$jscomp$inline_1737 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14805,7 +14829,8 @@ function setInitialProperties(domElement, tag, props) { break; case "input": listenToNonDelegatedEvent("invalid", domElement); - var type = null, + var name = null, + type = null, value = null, defaultValue = null, checked = null, @@ -14815,22 +14840,14 @@ function setInitialProperties(domElement, tag, props) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { + case "name": + name = propValue; + break; case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue && - ((type = propValue), - domElement.setAttribute(propKey, propValue)); + type = propValue; break; case "checked": checked = propValue; - propValue = - null != propValue ? propValue : props.defaultChecked; - domElement.checked = - !!propValue && - "function" !== typeof propValue && - "symbol" !== propValue; break; case "defaultChecked": defaultChecked = propValue; @@ -14850,7 +14867,6 @@ function setInitialProperties(domElement, tag, props) { setProp(domElement, tag, propKey, propValue, props, null); } } - track(domElement); initInput( domElement, value, @@ -14858,31 +14874,33 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, !1 ); + track(domElement); return; case "select": listenToNonDelegatedEvent("invalid", domElement); - var propKey = (value = defaultValue = null); - for (type in props) + var propKey = (type = value = null); + for (name in props) if ( - props.hasOwnProperty(type) && - ((checked = props[type]), null != checked) + props.hasOwnProperty(name) && + ((defaultValue = props[name]), null != defaultValue) ) - switch (type) { + switch (name) { case "value": - defaultValue = checked; + value = defaultValue; break; case "defaultValue": - value = checked; + type = defaultValue; break; case "multiple": - propKey = checked; + propKey = defaultValue; default: - setProp(domElement, tag, type, checked, props, null); + setProp(domElement, tag, name, defaultValue, props, null); } - tag = defaultValue; - props = value; + tag = value; + props = type; domElement.multiple = !!propKey; null != tag ? updateOptions(domElement, !!propKey, tag, !1) @@ -14890,38 +14908,38 @@ function setInitialProperties(domElement, tag, props) { return; case "textarea": listenToNonDelegatedEvent("invalid", domElement); - defaultValue = type = propKey = null; - for (value in props) + value = name = propKey = null; + for (type in props) if ( - props.hasOwnProperty(value) && - ((checked = props[value]), null != checked) + props.hasOwnProperty(type) && + ((defaultValue = props[type]), null != defaultValue) ) - switch (value) { + switch (type) { case "value": - propKey = checked; + propKey = defaultValue; break; case "defaultValue": - type = checked; + name = defaultValue; break; case "children": - defaultValue = checked; + value = defaultValue; break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != defaultValue) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, value, checked, props); + setProp(domElement, tag, type, defaultValue, props); } + initTextarea(domElement, propKey, name, value); track(domElement); - initTextarea(domElement, propKey, type, defaultValue); return; case "option": - for (checked in props) + for (defaultValue in props) if ( - props.hasOwnProperty(checked) && - ((propKey = props[checked]), null != propKey) + props.hasOwnProperty(defaultValue) && + ((propKey = props[defaultValue]), null != propKey) ) - switch (checked) { + switch (defaultValue) { case "selected": domElement.selected = propKey && @@ -14929,7 +14947,7 @@ function setInitialProperties(domElement, tag, props) { "symbol" !== typeof propKey; break; default: - setProp(domElement, tag, checked, propKey, props); + setProp(domElement, tag, defaultValue, propKey, props); } return; case "dialog": @@ -14969,29 +14987,29 @@ function setInitialProperties(domElement, tag, props) { case "track": case "wbr": case "menuitem": - for (defaultChecked in props) + for (checked in props) if ( - props.hasOwnProperty(defaultChecked) && - ((propKey = props[defaultChecked]), null != propKey) + props.hasOwnProperty(checked) && + ((propKey = props[checked]), null != propKey) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": throw Error(formatProdErrorMessage(137, tag)); default: - setProp(domElement, tag, defaultChecked, propKey, props, null); + setProp(domElement, tag, checked, propKey, props, null); } return; default: if (isCustomElement(tag)) { - for (propValue in props) - props.hasOwnProperty(propValue) && - ((propKey = props[propValue]), + for (defaultChecked in props) + props.hasOwnProperty(defaultChecked) && + ((propKey = props[defaultChecked]), null != propKey && setPropOnCustomElement( domElement, tag, - propValue, + defaultChecked, propKey, props, null @@ -14999,11 +15017,10 @@ function setInitialProperties(domElement, tag, props) { return; } } - for (defaultValue in props) - props.hasOwnProperty(defaultValue) && - ((propKey = props[defaultValue]), - null != propKey && - setProp(domElement, tag, defaultValue, propKey, props, null)); + for (value in props) + props.hasOwnProperty(value) && + ((propKey = props[value]), + null != propKey && setProp(domElement, tag, value, propKey, props, null)); } function updateProperties(domElement, tag, lastProps, nextProps) { switch (tag) { @@ -15029,12 +15046,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - nextProps.hasOwnProperty(propKey) || - ((lastProp = nextProps.defaultChecked), - (domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp)); break; case "value": break; @@ -15055,26 +15066,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (propKey$234) { case "type": type = propKey; - propKey !== lastProp && - (null != propKey && - "function" !== typeof propKey && - "symbol" !== typeof propKey && - "boolean" !== typeof propKey - ? domElement.setAttribute(propKey$234, propKey) - : domElement.removeAttribute(propKey$234)); break; case "name": name = propKey; break; case "checked": checked = propKey; - propKey !== lastProp && - ((propKey = - null != propKey ? propKey : nextProps.defaultChecked), - (domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey)); break; case "defaultChecked": defaultChecked = propKey; @@ -15102,12 +15099,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -15115,7 +15106,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -15212,14 +15204,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { updateTextarea(domElement, propKey$234, propKey); return; case "option": - for (var propKey$252 in lastProps) + for (var propKey$250 in lastProps) if ( - ((propKey$234 = lastProps[propKey$252]), - lastProps.hasOwnProperty(propKey$252) && + ((propKey$234 = lastProps[propKey$250]), + lastProps.hasOwnProperty(propKey$250) && null != propKey$234 && - !nextProps.hasOwnProperty(propKey$252)) + !nextProps.hasOwnProperty(propKey$250)) ) - switch (propKey$252) { + switch (propKey$250) { case "selected": domElement.selected = !1; break; @@ -15227,7 +15219,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$252, + propKey$250, null, nextProps, propKey$234 @@ -15274,12 +15266,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$257 in lastProps) - (propKey$234 = lastProps[propKey$257]), - lastProps.hasOwnProperty(propKey$257) && + for (var propKey$255 in lastProps) + (propKey$234 = lastProps[propKey$255]), + lastProps.hasOwnProperty(propKey$255) && null != propKey$234 && - !nextProps.hasOwnProperty(propKey$257) && - setProp(domElement, tag, propKey$257, null, nextProps, propKey$234); + !nextProps.hasOwnProperty(propKey$255) && + setProp(domElement, tag, propKey$255, null, nextProps, propKey$234); for (checked in nextProps) if ( ((propKey$234 = nextProps[checked]), @@ -15307,15 +15299,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$262 in lastProps) - (propKey$234 = lastProps[propKey$262]), - lastProps.hasOwnProperty(propKey$262) && + for (var propKey$260 in lastProps) + (propKey$234 = lastProps[propKey$260]), + lastProps.hasOwnProperty(propKey$260) && null != propKey$234 && - !nextProps.hasOwnProperty(propKey$262) && + !nextProps.hasOwnProperty(propKey$260) && setPropOnCustomElement( domElement, tag, - propKey$262, + propKey$260, null, nextProps, propKey$234 @@ -15337,12 +15329,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; } } - for (var propKey$267 in lastProps) - (propKey$234 = lastProps[propKey$267]), - lastProps.hasOwnProperty(propKey$267) && + for (var propKey$265 in lastProps) + (propKey$234 = lastProps[propKey$265]), + lastProps.hasOwnProperty(propKey$265) && null != propKey$234 && - !nextProps.hasOwnProperty(propKey$267) && - setProp(domElement, tag, propKey$267, null, nextProps, propKey$234); + !nextProps.hasOwnProperty(propKey$265) && + setProp(domElement, tag, propKey$265, null, nextProps, propKey$234); for (lastProp in nextProps) (propKey$234 = nextProps[lastProp]), (propKey = lastProps[lastProp]), @@ -15385,21 +15377,10 @@ function updatePropertiesWithDiff( propValue = updatePayload[i + 1]; switch (propKey) { case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue - ? domElement.setAttribute(propKey, propValue) - : domElement.removeAttribute(propKey); break; case "name": break; case "checked": - propKey = null != propValue ? propValue : nextProps.defaultChecked; - domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey; break; case "defaultChecked": break; @@ -15416,12 +15397,6 @@ function updatePropertiesWithDiff( setProp(domElement, tag, propKey, propValue, nextProps, null); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -15429,7 +15404,8 @@ function updatePropertiesWithDiff( lastProps, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -15867,14 +15843,14 @@ function preinit$1(href, options) { switch (as) { case "style": as = getResourcesFromRoot(resourceRoot).hoistableStyles; - var key$295 = getStyleKey(href), + var key$293 = getStyleKey(href), precedence = options.precedence || "default", - resource = as.get(key$295); + resource = as.get(key$293); if (resource) break; var state = { loading: 0, preload: null }; if ( (resource = resourceRoot.querySelector( - getStylesheetSelectorFromKey(key$295) + getStylesheetSelectorFromKey(key$293) )) ) state.loading = 1; @@ -15885,7 +15861,7 @@ function preinit$1(href, options) { "data-precedence": precedence, crossOrigin: options.crossOrigin }; - (options = preloadPropsMap.get(key$295)) && + (options = preloadPropsMap.get(key$293)) && adoptPreloadPropsForStylesheet(href, options); var link = (resource = ( resourceRoot.ownerDocument || resourceRoot @@ -15911,15 +15887,15 @@ function preinit$1(href, options) { count: 1, state: state }; - as.set(key$295, resource); + as.set(key$293, resource); break; case "script": (as = getResourcesFromRoot(resourceRoot).hoistableScripts), - (key$295 = getScriptKey(href)), - (precedence = as.get(key$295)), + (key$293 = getScriptKey(href)), + (precedence = as.get(key$293)), precedence || ((precedence = resourceRoot.querySelector( - "script[async]" + key$295 + "script[async]" + key$293 )), precedence || ((href = { @@ -15928,7 +15904,7 @@ function preinit$1(href, options) { crossOrigin: options.crossOrigin, integrity: options.integrity }), - (options = preloadPropsMap.get(key$295)) && + (options = preloadPropsMap.get(key$293)) && adoptPreloadPropsForScript(href, options), (options = resourceRoot.ownerDocument || resourceRoot), (precedence = options.createElement("script")), @@ -15941,13 +15917,13 @@ function preinit$1(href, options) { count: 1, state: null }), - as.set(key$295, precedence)); + as.set(key$293, precedence)); } else if ("style" === as || "script" === as) if ((resourceRoot = getDocumentForPreloads())) { - key$295 = escapeSelectorAttributeValueInsideDoubleQuotes(href); - precedence = key$295 = - 'link[rel="preload"][as="' + as + '"][href="' + key$295 + '"]'; + key$293 = escapeSelectorAttributeValueInsideDoubleQuotes(href); + precedence = key$293 = + 'link[rel="preload"][as="' + as + '"][href="' + key$293 + '"]'; switch (as) { case "style": precedence = getStyleKey(href); @@ -15964,7 +15940,7 @@ function preinit$1(href, options) { integrity: options.integrity }), preloadPropsMap.set(precedence, href), - null === resourceRoot.querySelector(key$295) && + null === resourceRoot.querySelector(key$293) && ((options = resourceRoot.createElement("link")), setInitialProperties(options, "link", href), markNodeAsHoistable(options), @@ -15997,17 +15973,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$304 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$305 = styles$304.get(type); - resource$305 || + var styles$302 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$303 = styles$302.get(type); + resource$303 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$305 = { + (resource$303 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$304.set(type, resource$305), + styles$302.set(type, resource$303), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -16022,9 +15998,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$305.state + resource$303.state )); - return resource$305; + return resource$303; } return null; case "script": @@ -16096,36 +16072,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = key); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$310 = hoistableRoot.querySelector( + var instance$308 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$310) + if (instance$308) return ( - (resource.instance = instance$310), - markNodeAsHoistable(instance$310), - instance$310 + (resource.instance = instance$308), + markNodeAsHoistable(instance$308), + instance$308 ); key = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(key, styleProps); - instance$310 = ( + instance$308 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$310); - var linkInstance = instance$310; + markNodeAsHoistable(instance$308); + var linkInstance = instance$308; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$310, "link", key); + setInitialProperties(instance$308, "link", key); resource.state.loading |= 4; - insertStylesheet(instance$310, props.precedence, hoistableRoot); - return (resource.instance = instance$310); + insertStylesheet(instance$308, props.precedence, hoistableRoot); + return (resource.instance = instance$308); case "script": - instance$310 = getScriptKey(props.src); + instance$308 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$310 + "script[async]" + instance$308 )) ) return ( @@ -16134,7 +16110,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); key = props; - if ((styleProps = preloadPropsMap.get(instance$310))) + if ((styleProps = preloadPropsMap.get(instance$308))) (key = assign({}, props)), adoptPreloadPropsForScript(key, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17083,11 +17059,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$330); + var instance = getPublicRootInstance(root$328); originalCallback.call(instance); }; } - var root$330 = createHydrationContainer( + var root$328 = createHydrationContainer( initialChildren, callback, container, @@ -17099,23 +17075,23 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$330; - container[internalContainerInstanceKey] = root$330.current; + container._reactRootContainer = root$328; + container[internalContainerInstanceKey] = root$328.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$330; + return root$328; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$331 = callback; + var originalCallback$329 = callback; callback = function () { - var instance = getPublicRootInstance(root$332); - originalCallback$331.call(instance); + var instance = getPublicRootInstance(root$330); + originalCallback$329.call(instance); }; } - var root$332 = createFiberRoot( + var root$330 = createFiberRoot( container, 0, !1, @@ -17127,15 +17103,15 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$332; - container[internalContainerInstanceKey] = root$332.current; + container._reactRootContainer = root$330; + container[internalContainerInstanceKey] = root$330.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$332, parentComponent, callback); + updateContainer(initialChildren, root$330, parentComponent, callback); }); - return root$332; + return root$330; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -17194,10 +17170,10 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1937 = { +var devToolsConfig$jscomp$inline_1935 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-e8d232f6", + version: "18.3.0-www-classic-2255f71b", rendererPackageName: "react-dom" }; (function (internals) { @@ -17215,10 +17191,10 @@ var devToolsConfig$jscomp$inline_1937 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1937.bundleType, - version: devToolsConfig$jscomp$inline_1937.version, - rendererPackageName: devToolsConfig$jscomp$inline_1937.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1937.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1935.bundleType, + version: devToolsConfig$jscomp$inline_1935.version, + rendererPackageName: devToolsConfig$jscomp$inline_1935.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1935.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17234,14 +17210,14 @@ var devToolsConfig$jscomp$inline_1937 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1937.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1935.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-e8d232f6" + reconcilerVersion: "18.3.0-www-classic-2255f71b" }); assign(Internals, { ReactBrowserEventEmitter: { @@ -17468,7 +17444,7 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-e8d232f6"; +exports.version = "18.3.0-www-classic-2255f71b"; /* 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 57bc818fac..191111e902 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -967,8 +967,16 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { + element.name = ""; + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type + ? (element.type = type) + : element.removeAttribute("type"); if (null != value) if ("number" === type) { if ((0 === value && "" === element.value) || element.value != value) @@ -999,6 +1007,12 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name + ? (element.name = name) + : element.removeAttribute("name"); } function initInput( element, @@ -1007,8 +1021,14 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type && + (element.type = type); if (null != value || null != defaultValue) { if ( (type = "submit" === type || "reset" === type) && @@ -1029,16 +1049,17 @@ function initInput( ? null != defaultValue && (element.defaultValue = defaultValueStr) : (element.defaultValue = initialValue); } - value = element.name; - "" !== value && (element.name = ""); - checked = null != checked ? checked : defaultChecked; - checked = - "function" !== typeof checked && "symbol" !== typeof checked && !!checked; - isHydrating || (element.checked = !!checked); + value = null != checked ? checked : defaultChecked; + value = "function" !== typeof value && "symbol" !== typeof value && !!value; + isHydrating || (element.checked = !!value); disableInputAttributeSyncing ? null != defaultChecked && (element.defaultChecked = !!defaultChecked) - : (element.defaultChecked = !!checked); - "" !== value && (element.name = value); + : (element.defaultChecked = !!value); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name && + (element.name = name); } function setDefaultValue(node, type, value) { ("number" === type && getActiveElement(node.ownerDocument) === node) || @@ -1330,7 +1351,8 @@ function restoreStateOfTarget(target) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); internalInstance = props.name; if ("radio" === props.type && null != internalInstance) { @@ -1357,7 +1379,8 @@ function restoreStateOfTarget(target) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -1721,7 +1744,6 @@ function prepareToHydrateHostInstance(fiber) { break; case "input": listenToNonDelegatedEvent("invalid", instance); - track(instance); initInput( instance, props.value, @@ -1729,16 +1751,18 @@ function prepareToHydrateHostInstance(fiber) { props.checked, props.defaultChecked, props.type, + props.name, !0 ); + track(instance); break; case "select": listenToNonDelegatedEvent("invalid", instance); break; case "textarea": listenToNonDelegatedEvent("invalid", instance), - track(instance), - initTextarea(instance, props.value, props.defaultValue); + initTextarea(instance, props.value, props.defaultValue), + track(instance); } i = null; var children = props.children; @@ -13523,19 +13547,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$397; + var JSCompiler_inline_result$jscomp$395; if (canUseDOM) { - var isSupported$jscomp$inline_1687 = "oninput" in document; - if (!isSupported$jscomp$inline_1687) { - var element$jscomp$inline_1688 = document.createElement("div"); - element$jscomp$inline_1688.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1687 = - "function" === typeof element$jscomp$inline_1688.oninput; + var isSupported$jscomp$inline_1685 = "oninput" in document; + if (!isSupported$jscomp$inline_1685) { + var element$jscomp$inline_1686 = document.createElement("div"); + element$jscomp$inline_1686.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1685 = + "function" === typeof element$jscomp$inline_1686.oninput; } - JSCompiler_inline_result$jscomp$397 = isSupported$jscomp$inline_1687; - } else JSCompiler_inline_result$jscomp$397 = !1; + JSCompiler_inline_result$jscomp$395 = isSupported$jscomp$inline_1685; + } else JSCompiler_inline_result$jscomp$395 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$397 && + JSCompiler_inline_result$jscomp$395 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13844,20 +13868,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1728 = 0; - i$jscomp$inline_1728 < simpleEventPluginEvents.length; - i$jscomp$inline_1728++ + var i$jscomp$inline_1726 = 0; + i$jscomp$inline_1726 < simpleEventPluginEvents.length; + i$jscomp$inline_1726++ ) { - var eventName$jscomp$inline_1729 = - simpleEventPluginEvents[i$jscomp$inline_1728], - domEventName$jscomp$inline_1730 = - eventName$jscomp$inline_1729.toLowerCase(), - capitalizedEvent$jscomp$inline_1731 = - eventName$jscomp$inline_1729[0].toUpperCase() + - eventName$jscomp$inline_1729.slice(1); + var eventName$jscomp$inline_1727 = + simpleEventPluginEvents[i$jscomp$inline_1726], + domEventName$jscomp$inline_1728 = + eventName$jscomp$inline_1727.toLowerCase(), + capitalizedEvent$jscomp$inline_1729 = + eventName$jscomp$inline_1727[0].toUpperCase() + + eventName$jscomp$inline_1727.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1730, - "on" + capitalizedEvent$jscomp$inline_1731 + domEventName$jscomp$inline_1728, + "on" + capitalizedEvent$jscomp$inline_1729 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15031,7 +15055,8 @@ function setInitialProperties(domElement, tag, props) { break; case "input": listenToNonDelegatedEvent("invalid", domElement); - var type = null, + var name = null, + type = null, value = null, defaultValue = null, checked = null, @@ -15041,22 +15066,14 @@ function setInitialProperties(domElement, tag, props) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { + case "name": + name = propValue; + break; case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue && - ((type = propValue), - domElement.setAttribute(propKey, propValue)); + type = propValue; break; case "checked": checked = propValue; - propValue = - null != propValue ? propValue : props.defaultChecked; - domElement.checked = - !!propValue && - "function" !== typeof propValue && - "symbol" !== propValue; break; case "defaultChecked": defaultChecked = propValue; @@ -15076,7 +15093,6 @@ function setInitialProperties(domElement, tag, props) { setProp(domElement, tag, propKey, propValue, props, null); } } - track(domElement); initInput( domElement, value, @@ -15084,31 +15100,33 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, !1 ); + track(domElement); return; case "select": listenToNonDelegatedEvent("invalid", domElement); - var propKey = (value = defaultValue = null); - for (type in props) + var propKey = (type = value = null); + for (name in props) if ( - props.hasOwnProperty(type) && - ((checked = props[type]), null != checked) + props.hasOwnProperty(name) && + ((defaultValue = props[name]), null != defaultValue) ) - switch (type) { + switch (name) { case "value": - defaultValue = checked; + value = defaultValue; break; case "defaultValue": - value = checked; + type = defaultValue; break; case "multiple": - propKey = checked; + propKey = defaultValue; default: - setProp(domElement, tag, type, checked, props, null); + setProp(domElement, tag, name, defaultValue, props, null); } - tag = defaultValue; - props = value; + tag = value; + props = type; domElement.multiple = !!propKey; null != tag ? updateOptions(domElement, !!propKey, tag, !1) @@ -15116,37 +15134,37 @@ function setInitialProperties(domElement, tag, props) { return; case "textarea": listenToNonDelegatedEvent("invalid", domElement); - type = propKey = null; - for (value in props) + name = propKey = null; + for (type in props) if ( - props.hasOwnProperty(value) && - ((defaultValue = props[value]), null != defaultValue) + props.hasOwnProperty(type) && + ((value = props[type]), null != value) ) - switch (value) { + switch (type) { case "value": - propKey = defaultValue; + propKey = value; break; case "defaultValue": - type = defaultValue; + name = value; break; case "children": break; case "dangerouslySetInnerHTML": - if (null != defaultValue) throw Error(formatProdErrorMessage(91)); + if (null != value) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, value, defaultValue, props); + setProp(domElement, tag, type, value, props); } + initTextarea(domElement, propKey, name); track(domElement); - initTextarea(domElement, propKey, type); return; case "option": - for (checked in props) + for (defaultValue in props) if ( - props.hasOwnProperty(checked) && - ((propKey = props[checked]), null != propKey) + props.hasOwnProperty(defaultValue) && + ((propKey = props[defaultValue]), null != propKey) ) - switch (checked) { + switch (defaultValue) { case "selected": domElement.selected = propKey && @@ -15154,7 +15172,7 @@ function setInitialProperties(domElement, tag, props) { "symbol" !== typeof propKey; break; default: - setProp(domElement, tag, checked, propKey, props); + setProp(domElement, tag, defaultValue, propKey, props); } return; case "dialog": @@ -15194,29 +15212,29 @@ function setInitialProperties(domElement, tag, props) { case "track": case "wbr": case "menuitem": - for (defaultChecked in props) + for (checked in props) if ( - props.hasOwnProperty(defaultChecked) && - ((propKey = props[defaultChecked]), null != propKey) + props.hasOwnProperty(checked) && + ((propKey = props[checked]), null != propKey) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": throw Error(formatProdErrorMessage(137, tag)); default: - setProp(domElement, tag, defaultChecked, propKey, props, null); + setProp(domElement, tag, checked, propKey, props, null); } return; default: if (isCustomElement(tag)) { - for (propValue in props) - props.hasOwnProperty(propValue) && - ((propKey = props[propValue]), + for (defaultChecked in props) + props.hasOwnProperty(defaultChecked) && + ((propKey = props[defaultChecked]), null != propKey && setPropOnCustomElement( domElement, tag, - propValue, + defaultChecked, propKey, props, null @@ -15224,11 +15242,10 @@ function setInitialProperties(domElement, tag, props) { return; } } - for (defaultValue in props) - props.hasOwnProperty(defaultValue) && - ((propKey = props[defaultValue]), - null != propKey && - setProp(domElement, tag, defaultValue, propKey, props, null)); + for (value in props) + props.hasOwnProperty(value) && + ((propKey = props[value]), + null != propKey && setProp(domElement, tag, value, propKey, props, null)); } function updateProperties(domElement, tag, lastProps, nextProps) { switch (tag) { @@ -15254,12 +15271,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - nextProps.hasOwnProperty(propKey) || - ((lastProp = nextProps.defaultChecked), - (domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp)); break; case "value": break; @@ -15280,26 +15291,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (propKey$238) { case "type": type = propKey; - propKey !== lastProp && - (null != propKey && - "function" !== typeof propKey && - "symbol" !== typeof propKey && - "boolean" !== typeof propKey - ? domElement.setAttribute(propKey$238, propKey) - : domElement.removeAttribute(propKey$238)); break; case "name": name = propKey; break; case "checked": checked = propKey; - propKey !== lastProp && - ((propKey = - null != propKey ? propKey : nextProps.defaultChecked), - (domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey)); break; case "defaultChecked": defaultChecked = propKey; @@ -15327,12 +15324,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -15340,7 +15331,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -15437,14 +15429,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { updateTextarea(domElement, propKey$238, propKey); return; case "option": - for (var propKey$256 in lastProps) + for (var propKey$254 in lastProps) if ( - ((propKey$238 = lastProps[propKey$256]), - lastProps.hasOwnProperty(propKey$256) && + ((propKey$238 = lastProps[propKey$254]), + lastProps.hasOwnProperty(propKey$254) && null != propKey$238 && - !nextProps.hasOwnProperty(propKey$256)) + !nextProps.hasOwnProperty(propKey$254)) ) - switch (propKey$256) { + switch (propKey$254) { case "selected": domElement.selected = !1; break; @@ -15452,7 +15444,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$256, + propKey$254, null, nextProps, propKey$238 @@ -15499,12 +15491,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$261 in lastProps) - (propKey$238 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && + for (var propKey$259 in lastProps) + (propKey$238 = lastProps[propKey$259]), + lastProps.hasOwnProperty(propKey$259) && null != propKey$238 && - !nextProps.hasOwnProperty(propKey$261) && - setProp(domElement, tag, propKey$261, null, nextProps, propKey$238); + !nextProps.hasOwnProperty(propKey$259) && + setProp(domElement, tag, propKey$259, null, nextProps, propKey$238); for (checked in nextProps) if ( ((propKey$238 = nextProps[checked]), @@ -15532,15 +15524,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$266 in lastProps) - (propKey$238 = lastProps[propKey$266]), - lastProps.hasOwnProperty(propKey$266) && + for (var propKey$264 in lastProps) + (propKey$238 = lastProps[propKey$264]), + lastProps.hasOwnProperty(propKey$264) && null != propKey$238 && - !nextProps.hasOwnProperty(propKey$266) && + !nextProps.hasOwnProperty(propKey$264) && setPropOnCustomElement( domElement, tag, - propKey$266, + propKey$264, null, nextProps, propKey$238 @@ -15562,12 +15554,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; } } - for (var propKey$271 in lastProps) - (propKey$238 = lastProps[propKey$271]), - lastProps.hasOwnProperty(propKey$271) && + for (var propKey$269 in lastProps) + (propKey$238 = lastProps[propKey$269]), + lastProps.hasOwnProperty(propKey$269) && null != propKey$238 && - !nextProps.hasOwnProperty(propKey$271) && - setProp(domElement, tag, propKey$271, null, nextProps, propKey$238); + !nextProps.hasOwnProperty(propKey$269) && + setProp(domElement, tag, propKey$269, null, nextProps, propKey$238); for (lastProp in nextProps) (propKey$238 = nextProps[lastProp]), (propKey = lastProps[lastProp]), @@ -15610,21 +15602,10 @@ function updatePropertiesWithDiff( propValue = updatePayload[i + 1]; switch (propKey) { case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue - ? domElement.setAttribute(propKey, propValue) - : domElement.removeAttribute(propKey); break; case "name": break; case "checked": - propKey = null != propValue ? propValue : nextProps.defaultChecked; - domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey; break; case "defaultChecked": break; @@ -15641,12 +15622,6 @@ function updatePropertiesWithDiff( setProp(domElement, tag, propKey, propValue, nextProps, null); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -15654,7 +15629,8 @@ function updatePropertiesWithDiff( lastProps, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -16078,14 +16054,14 @@ function preinit$1(href, options) { switch (as) { case "style": as = getResourcesFromRoot(resourceRoot).hoistableStyles; - var key$299 = getStyleKey(href), + var key$297 = getStyleKey(href), precedence = options.precedence || "default", - resource = as.get(key$299); + resource = as.get(key$297); if (resource) break; var state = { loading: 0, preload: null }; if ( (resource = resourceRoot.querySelector( - getStylesheetSelectorFromKey(key$299) + getStylesheetSelectorFromKey(key$297) )) ) state.loading = 1; @@ -16096,7 +16072,7 @@ function preinit$1(href, options) { "data-precedence": precedence, crossOrigin: options.crossOrigin }; - (options = preloadPropsMap.get(key$299)) && + (options = preloadPropsMap.get(key$297)) && adoptPreloadPropsForStylesheet(href, options); var link = (resource = ( resourceRoot.ownerDocument || resourceRoot @@ -16122,15 +16098,15 @@ function preinit$1(href, options) { count: 1, state: state }; - as.set(key$299, resource); + as.set(key$297, resource); break; case "script": (as = getResourcesFromRoot(resourceRoot).hoistableScripts), - (key$299 = getScriptKey(href)), - (precedence = as.get(key$299)), + (key$297 = getScriptKey(href)), + (precedence = as.get(key$297)), precedence || ((precedence = resourceRoot.querySelector( - "script[async]" + key$299 + "script[async]" + key$297 )), precedence || ((href = { @@ -16139,7 +16115,7 @@ function preinit$1(href, options) { crossOrigin: options.crossOrigin, integrity: options.integrity }), - (options = preloadPropsMap.get(key$299)) && + (options = preloadPropsMap.get(key$297)) && adoptPreloadPropsForScript(href, options), (options = resourceRoot.ownerDocument || resourceRoot), (precedence = options.createElement("script")), @@ -16152,13 +16128,13 @@ function preinit$1(href, options) { count: 1, state: null }), - as.set(key$299, precedence)); + as.set(key$297, precedence)); } else if ("style" === as || "script" === as) if ((resourceRoot = getDocumentForPreloads())) { - key$299 = escapeSelectorAttributeValueInsideDoubleQuotes(href); - precedence = key$299 = - 'link[rel="preload"][as="' + as + '"][href="' + key$299 + '"]'; + key$297 = escapeSelectorAttributeValueInsideDoubleQuotes(href); + precedence = key$297 = + 'link[rel="preload"][as="' + as + '"][href="' + key$297 + '"]'; switch (as) { case "style": precedence = getStyleKey(href); @@ -16175,7 +16151,7 @@ function preinit$1(href, options) { integrity: options.integrity }), preloadPropsMap.set(precedence, href), - null === resourceRoot.querySelector(key$299) && + null === resourceRoot.querySelector(key$297) && ((options = resourceRoot.createElement("link")), setInitialProperties(options, "link", href), markNodeAsHoistable(options), @@ -16208,17 +16184,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$308 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$309 = styles$308.get(type); - resource$309 || + var styles$306 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$307 = styles$306.get(type); + resource$307 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$309 = { + (resource$307 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$308.set(type, resource$309), + styles$306.set(type, resource$307), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -16233,9 +16209,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$309.state + resource$307.state )); - return resource$309; + return resource$307; } return null; case "script": @@ -16307,36 +16283,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = key); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$314 = hoistableRoot.querySelector( + var instance$312 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$314) + if (instance$312) return ( - (resource.instance = instance$314), - markNodeAsHoistable(instance$314), - instance$314 + (resource.instance = instance$312), + markNodeAsHoistable(instance$312), + instance$312 ); key = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(key, styleProps); - instance$314 = ( + instance$312 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$314); - var linkInstance = instance$314; + markNodeAsHoistable(instance$312); + var linkInstance = instance$312; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$314, "link", key); + setInitialProperties(instance$312, "link", key); resource.state.loading |= 4; - insertStylesheet(instance$314, props.precedence, hoistableRoot); - return (resource.instance = instance$314); + insertStylesheet(instance$312, props.precedence, hoistableRoot); + return (resource.instance = instance$312); case "script": - instance$314 = getScriptKey(props.src); + instance$312 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$314 + "script[async]" + instance$312 )) ) return ( @@ -16345,7 +16321,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); key = props; - if ((styleProps = preloadPropsMap.get(instance$314))) + if ((styleProps = preloadPropsMap.get(instance$312))) (key = assign({}, props)), adoptPreloadPropsForScript(key, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16715,10 +16691,10 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1896 = { +var devToolsConfig$jscomp$inline_1894 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-7ce8ddda", + version: "18.3.0-www-modern-9359f11b", rendererPackageName: "react-dom" }; (function (internals) { @@ -16736,10 +16712,10 @@ var devToolsConfig$jscomp$inline_1896 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1896.bundleType, - version: devToolsConfig$jscomp$inline_1896.version, - rendererPackageName: devToolsConfig$jscomp$inline_1896.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1896.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1894.bundleType, + version: devToolsConfig$jscomp$inline_1894.version, + rendererPackageName: devToolsConfig$jscomp$inline_1894.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1894.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16756,14 +16732,14 @@ var devToolsConfig$jscomp$inline_1896 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1896.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1894.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-7ce8ddda" + reconcilerVersion: "18.3.0-www-modern-9359f11b" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = function (children, container) { @@ -16918,7 +16894,7 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-7ce8ddda"; +exports.version = "18.3.0-www-modern-9359f11b"; /* 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 7374a4bd11..4b656a7da3 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -3816,9 +3816,30 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { - var node = element; + var node = element; // Temporarily disconnect the input from any radio buttons. + // Changing the type or name as the same time as changing the checked value + // needs to be atomically applied. We can only ensure that by disconnecting + // the name while do the mutations and then reapply the name after that's done. + + node.name = ""; + + if ( + type != null && + typeof type !== "function" && + typeof type !== "symbol" && + typeof type !== "boolean" + ) { + { + checkAttributeStringCoercion(type, "type"); + } + + node.type = type; + } else { + node.removeAttribute("type"); + } if (value != null) { if (type === "number") { @@ -3884,6 +3905,21 @@ function updateInput( if (checked != null && node.checked !== !!checked) { node.checked = checked; } + + if ( + name != null && + typeof name !== "function" && + typeof name !== "symbol" && + typeof name !== "boolean" + ) { + { + checkAttributeStringCoercion(name, "name"); + } + + node.name = name; + } else { + node.removeAttribute("name"); + } } function initInput( element, @@ -3892,10 +3928,24 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { var node = element; + if ( + type != null && + typeof type !== "function" && + typeof type !== "symbol" && + typeof type !== "boolean" + ) { + { + checkAttributeStringCoercion(type, "type"); + } + + node.type = type; + } + if (value != null || defaultValue != null) { var isButton = type === "submit" || type === "reset"; // Avoid setting value attribute on submit/reset inputs as it overrides the // default value provided by the browser. See: #12872 @@ -3958,12 +4008,6 @@ function initInput( // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 // We need to temporarily unset name to avoid disrupting radio button groups. - var name = node.name; - - if (name !== "") { - node.name = ""; - } - var checkedOrDefault = checked != null ? checked : defaultChecked; // TODO: This 'function' or 'symbol' check isn't replicated in other places // so this semantic is inconsistent. @@ -3997,9 +4041,18 @@ function initInput( // 3. Otherwise, false node.defaultChecked = !node.defaultChecked; node.defaultChecked = !!initialChecked; - } + } // Name needs to be set at the end so that it applies atomically to connected radio buttons. + + if ( + name != null && + typeof name !== "function" && + typeof name !== "symbol" && + typeof name !== "boolean" + ) { + { + checkAttributeStringCoercion(name, "name"); + } - if (name !== "") { node.name = name; } } @@ -4012,7 +4065,8 @@ function restoreControlledInputState(element, props) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); var name = props.name; @@ -4068,7 +4122,8 @@ function restoreControlledInputState(element, props) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -7749,6 +7804,7 @@ function setInitialProperties(domElement, tag, props) { // listeners still fire for the invalid event. listenToNonDelegatedEvent("invalid", domElement); + var name = null; var type = null; var value = null; var defaultValue = null; @@ -7767,35 +7823,18 @@ function setInitialProperties(domElement, tag, props) { } switch (propKey) { - case "type": { - // Fast path since 'type' is very common on inputs - if ( - propValue != null && - typeof propValue !== "function" && - typeof propValue !== "symbol" && - typeof propValue !== "boolean" - ) { - type = propValue; - - { - checkAttributeStringCoercion(propValue, propKey); - } - - domElement.setAttribute(propKey, propValue); - } + case "name": { + name = propValue; + break; + } + case "type": { + type = propValue; break; } case "checked": { checked = propValue; - var checkedValue = - propValue != null ? propValue : props.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; break; } @@ -7834,7 +7873,6 @@ function setInitialProperties(domElement, tag, props) { } // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateInputProps(domElement, props); initInput( domElement, @@ -7843,8 +7881,10 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, false ); + track(domElement); return; } @@ -7958,9 +7998,9 @@ function setInitialProperties(domElement, tag, props) { } // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateTextareaProps(domElement, props); initTextarea(domElement, _value2, _defaultValue2, children); + track(domElement); return; } @@ -8287,15 +8327,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && lastProp != null) { switch (propKey) { case "checked": { - if (!nextProps.hasOwnProperty(propKey)) { - var checkedValue = nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; - } - break; } @@ -8328,25 +8359,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) { switch (_propKey7) { case "type": { - type = nextProp; // Fast path since 'type' is very common on inputs - - if (nextProp !== _lastProp) { - if ( - nextProp != null && - typeof nextProp !== "function" && - typeof nextProp !== "symbol" && - typeof nextProp !== "boolean" - ) { - { - checkAttributeStringCoercion(nextProp, _propKey7); - } - - domElement.setAttribute(_propKey7, nextProp); - } else { - domElement.removeAttribute(_propKey7); - } - } - + type = nextProp; break; } @@ -8357,18 +8370,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "checked": { checked = nextProp; - - if (nextProp !== _lastProp) { - var _checkedValue = - nextProp != null ? nextProp : nextProps.defaultChecked; - - var _inputElement = domElement; - _inputElement.checked = - !!_checkedValue && - typeof _checkedValue !== "function" && - _checkedValue !== "symbol"; - } - break; } @@ -8456,23 +8457,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { didWarnControlledToUncontrolled = true; } - } // Update checked *before* name. - // In the middle of an update, it is possible to have multiple checked. - // When a checked radio tries to change name, browser makes another radio's checked false. - - if ( - name != null && - typeof name !== "function" && - typeof name !== "symbol" && - typeof name !== "boolean" - ) { - { - checkAttributeStringCoercion(name, "name"); - } - - domElement.setAttribute("name", name); - } else { - domElement.removeAttribute("name"); } // Update the wrapper around inputs *after* updating props. This has to // happen after updating the rest of props. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. @@ -8484,7 +8468,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; } @@ -8893,22 +8878,6 @@ function updatePropertiesWithDiff( switch (propKey) { case "type": { - // Fast path since 'type' is very common on inputs - if ( - propValue != null && - typeof propValue !== "function" && - typeof propValue !== "symbol" && - typeof propValue !== "boolean" - ) { - { - checkAttributeStringCoercion(propValue, propKey); - } - - domElement.setAttribute(propKey, propValue); - } else { - domElement.removeAttribute(propKey); - } - break; } @@ -8917,13 +8886,6 @@ function updatePropertiesWithDiff( } case "checked": { - var checkedValue = - propValue != null ? propValue : nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; break; } @@ -8999,23 +8961,6 @@ function updatePropertiesWithDiff( didWarnControlledToUncontrolled = true; } - } // Update checked *before* name. - // In the middle of an update, it is possible to have multiple checked. - // When a checked radio tries to change name, browser makes another radio's checked false. - - if ( - name != null && - typeof name !== "function" && - typeof name !== "symbol" && - typeof name !== "boolean" - ) { - { - checkAttributeStringCoercion(name, "name"); - } - - domElement.setAttribute("name", name); - } else { - domElement.removeAttribute("name"); } // Update the wrapper around inputs *after* updating props. This has to // happen after updating the rest of props. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. @@ -9027,7 +8972,8 @@ function updatePropertiesWithDiff( lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; } @@ -10178,7 +10124,6 @@ function diffHydratedProperties( listenToNonDelegatedEvent("invalid", domElement); // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateInputProps(domElement, props); // For input and textarea we current always set the value property at // post mount to force it to diverge from attributes. However, for // option and select we don't quite do the same thing and select @@ -10192,8 +10137,10 @@ function diffHydratedProperties( props.checked, props.defaultChecked, props.type, + props.name, true ); + track(domElement); break; case "option": @@ -10219,9 +10166,9 @@ function diffHydratedProperties( listenToNonDelegatedEvent("invalid", domElement); // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateTextareaProps(domElement, props); initTextarea(domElement, props.value, props.defaultValue, props.children); + track(domElement); break; } @@ -37688,7 +37635,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-b1d73382"; +var ReactVersion = "18.3.0-www-classic-1a16a1cc"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 9742f0d039..743a32487f 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -3752,9 +3752,30 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { - var node = element; + var node = element; // Temporarily disconnect the input from any radio buttons. + // Changing the type or name as the same time as changing the checked value + // needs to be atomically applied. We can only ensure that by disconnecting + // the name while do the mutations and then reapply the name after that's done. + + node.name = ""; + + if ( + type != null && + typeof type !== "function" && + typeof type !== "symbol" && + typeof type !== "boolean" + ) { + { + checkAttributeStringCoercion(type, "type"); + } + + node.type = type; + } else { + node.removeAttribute("type"); + } if (value != null) { if (type === "number") { @@ -3820,6 +3841,21 @@ function updateInput( if (checked != null && node.checked !== !!checked) { node.checked = checked; } + + if ( + name != null && + typeof name !== "function" && + typeof name !== "symbol" && + typeof name !== "boolean" + ) { + { + checkAttributeStringCoercion(name, "name"); + } + + node.name = name; + } else { + node.removeAttribute("name"); + } } function initInput( element, @@ -3828,10 +3864,24 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { var node = element; + if ( + type != null && + typeof type !== "function" && + typeof type !== "symbol" && + typeof type !== "boolean" + ) { + { + checkAttributeStringCoercion(type, "type"); + } + + node.type = type; + } + if (value != null || defaultValue != null) { var isButton = type === "submit" || type === "reset"; // Avoid setting value attribute on submit/reset inputs as it overrides the // default value provided by the browser. See: #12872 @@ -3894,12 +3944,6 @@ function initInput( // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 // We need to temporarily unset name to avoid disrupting radio button groups. - var name = node.name; - - if (name !== "") { - node.name = ""; - } - var checkedOrDefault = checked != null ? checked : defaultChecked; // TODO: This 'function' or 'symbol' check isn't replicated in other places // so this semantic is inconsistent. @@ -3933,9 +3977,18 @@ function initInput( // 3. Otherwise, false node.defaultChecked = !node.defaultChecked; node.defaultChecked = !!initialChecked; - } + } // Name needs to be set at the end so that it applies atomically to connected radio buttons. + + if ( + name != null && + typeof name !== "function" && + typeof name !== "symbol" && + typeof name !== "boolean" + ) { + { + checkAttributeStringCoercion(name, "name"); + } - if (name !== "") { node.name = name; } } @@ -3948,7 +4001,8 @@ function restoreControlledInputState(element, props) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); var name = props.name; @@ -4004,7 +4058,8 @@ function restoreControlledInputState(element, props) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -34195,7 +34250,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-d3066f93"; +var ReactVersion = "18.3.0-www-modern-0537f638"; function createPortal$1( children, @@ -39950,6 +40005,7 @@ function setInitialProperties(domElement, tag, props) { // listeners still fire for the invalid event. listenToNonDelegatedEvent("invalid", domElement); + var name = null; var type = null; var value = null; var defaultValue = null; @@ -39968,35 +40024,18 @@ function setInitialProperties(domElement, tag, props) { } switch (propKey) { - case "type": { - // Fast path since 'type' is very common on inputs - if ( - propValue != null && - typeof propValue !== "function" && - typeof propValue !== "symbol" && - typeof propValue !== "boolean" - ) { - type = propValue; - - { - checkAttributeStringCoercion(propValue, propKey); - } - - domElement.setAttribute(propKey, propValue); - } + case "name": { + name = propValue; + break; + } + case "type": { + type = propValue; break; } case "checked": { checked = propValue; - var checkedValue = - propValue != null ? propValue : props.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; break; } @@ -40035,7 +40074,6 @@ function setInitialProperties(domElement, tag, props) { } // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateInputProps(domElement, props); initInput( domElement, @@ -40044,8 +40082,10 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, false ); + track(domElement); return; } @@ -40156,9 +40196,9 @@ function setInitialProperties(domElement, tag, props) { } // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateTextareaProps(domElement, props); initTextarea(domElement, _value2, _defaultValue2); + track(domElement); return; } @@ -40485,15 +40525,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && lastProp != null) { switch (propKey) { case "checked": { - if (!nextProps.hasOwnProperty(propKey)) { - var checkedValue = nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; - } - break; } @@ -40526,25 +40557,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) { switch (_propKey7) { case "type": { - type = nextProp; // Fast path since 'type' is very common on inputs - - if (nextProp !== _lastProp) { - if ( - nextProp != null && - typeof nextProp !== "function" && - typeof nextProp !== "symbol" && - typeof nextProp !== "boolean" - ) { - { - checkAttributeStringCoercion(nextProp, _propKey7); - } - - domElement.setAttribute(_propKey7, nextProp); - } else { - domElement.removeAttribute(_propKey7); - } - } - + type = nextProp; break; } @@ -40555,18 +40568,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "checked": { checked = nextProp; - - if (nextProp !== _lastProp) { - var _checkedValue = - nextProp != null ? nextProp : nextProps.defaultChecked; - - var _inputElement = domElement; - _inputElement.checked = - !!_checkedValue && - typeof _checkedValue !== "function" && - _checkedValue !== "symbol"; - } - break; } @@ -40654,23 +40655,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { didWarnControlledToUncontrolled = true; } - } // Update checked *before* name. - // In the middle of an update, it is possible to have multiple checked. - // When a checked radio tries to change name, browser makes another radio's checked false. - - if ( - name != null && - typeof name !== "function" && - typeof name !== "symbol" && - typeof name !== "boolean" - ) { - { - checkAttributeStringCoercion(name, "name"); - } - - domElement.setAttribute("name", name); - } else { - domElement.removeAttribute("name"); } // Update the wrapper around inputs *after* updating props. This has to // happen after updating the rest of props. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. @@ -40682,7 +40666,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; } @@ -41091,22 +41076,6 @@ function updatePropertiesWithDiff( switch (propKey) { case "type": { - // Fast path since 'type' is very common on inputs - if ( - propValue != null && - typeof propValue !== "function" && - typeof propValue !== "symbol" && - typeof propValue !== "boolean" - ) { - { - checkAttributeStringCoercion(propValue, propKey); - } - - domElement.setAttribute(propKey, propValue); - } else { - domElement.removeAttribute(propKey); - } - break; } @@ -41115,13 +41084,6 @@ function updatePropertiesWithDiff( } case "checked": { - var checkedValue = - propValue != null ? propValue : nextProps.defaultChecked; - var inputElement = domElement; - inputElement.checked = - !!checkedValue && - typeof checkedValue !== "function" && - checkedValue !== "symbol"; break; } @@ -41197,23 +41159,6 @@ function updatePropertiesWithDiff( didWarnControlledToUncontrolled = true; } - } // Update checked *before* name. - // In the middle of an update, it is possible to have multiple checked. - // When a checked radio tries to change name, browser makes another radio's checked false. - - if ( - name != null && - typeof name !== "function" && - typeof name !== "symbol" && - typeof name !== "boolean" - ) { - { - checkAttributeStringCoercion(name, "name"); - } - - domElement.setAttribute("name", name); - } else { - domElement.removeAttribute("name"); } // Update the wrapper around inputs *after* updating props. This has to // happen after updating the rest of props. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. @@ -41225,7 +41170,8 @@ function updatePropertiesWithDiff( lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; } @@ -42376,7 +42322,6 @@ function diffHydratedProperties( listenToNonDelegatedEvent("invalid", domElement); // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateInputProps(domElement, props); // For input and textarea we current always set the value property at // post mount to force it to diverge from attributes. However, for // option and select we don't quite do the same thing and select @@ -42390,8 +42335,10 @@ function diffHydratedProperties( props.checked, props.defaultChecked, props.type, + props.name, true ); + track(domElement); break; case "option": @@ -42417,9 +42364,9 @@ function diffHydratedProperties( listenToNonDelegatedEvent("invalid", domElement); // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. - track(domElement); validateTextareaProps(domElement, props); initTextarea(domElement, props.value, props.defaultValue); + track(domElement); break; } diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 7514b7d261..49d95fa02e 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -980,8 +980,16 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { + element.name = ""; + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type + ? (element.type = type) + : element.removeAttribute("type"); if (null != value) if ("number" === type) { if ((0 === value && "" === element.value) || element.value != value) @@ -1012,6 +1020,12 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name + ? (element.name = name) + : element.removeAttribute("name"); } function initInput( element, @@ -1020,8 +1034,14 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type && + (element.type = type); if (null != value || null != defaultValue) { if ( (type = "submit" === type || "reset" === type) && @@ -1042,16 +1062,17 @@ function initInput( ? null != defaultValue && (element.defaultValue = defaultValueStr) : (element.defaultValue = initialValue); } - value = element.name; - "" !== value && (element.name = ""); - checked = null != checked ? checked : defaultChecked; - checked = - "function" !== typeof checked && "symbol" !== typeof checked && !!checked; - isHydrating || (element.checked = !!checked); + value = null != checked ? checked : defaultChecked; + value = "function" !== typeof value && "symbol" !== typeof value && !!value; + isHydrating || (element.checked = !!value); disableInputAttributeSyncing ? null != defaultChecked && (element.defaultChecked = !!defaultChecked) - : (element.defaultChecked = !!checked); - "" !== value && (element.name = value); + : (element.defaultChecked = !!value); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name && + (element.name = name); } function setDefaultValue(node, type, value) { ("number" === type && getActiveElement(node.ownerDocument) === node) || @@ -1681,7 +1702,8 @@ function setInitialProperties(domElement, tag, props) { break; case "input": listenToNonDelegatedEvent("invalid", domElement); - var type = null, + var name = null, + type = null, value = null, defaultValue = null, checked = null, @@ -1691,22 +1713,14 @@ function setInitialProperties(domElement, tag, props) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { + case "name": + name = propValue; + break; case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue && - ((type = propValue), - domElement.setAttribute(propKey, propValue)); + type = propValue; break; case "checked": checked = propValue; - propValue = - null != propValue ? propValue : props.defaultChecked; - domElement.checked = - !!propValue && - "function" !== typeof propValue && - "symbol" !== propValue; break; case "defaultChecked": defaultChecked = propValue; @@ -1726,7 +1740,6 @@ function setInitialProperties(domElement, tag, props) { setProp(domElement, tag, propKey, propValue, props, null); } } - track(domElement); initInput( domElement, value, @@ -1734,31 +1747,33 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, !1 ); + track(domElement); return; case "select": listenToNonDelegatedEvent("invalid", domElement); - var propKey = (value = defaultValue = null); - for (type in props) + var propKey = (type = value = null); + for (name in props) if ( - props.hasOwnProperty(type) && - ((checked = props[type]), null != checked) + props.hasOwnProperty(name) && + ((defaultValue = props[name]), null != defaultValue) ) - switch (type) { + switch (name) { case "value": - defaultValue = checked; + value = defaultValue; break; case "defaultValue": - value = checked; + type = defaultValue; break; case "multiple": - propKey = checked; + propKey = defaultValue; default: - setProp(domElement, tag, type, checked, props, null); + setProp(domElement, tag, name, defaultValue, props, null); } - tag = defaultValue; - props = value; + tag = value; + props = type; domElement.multiple = !!propKey; null != tag ? updateOptions(domElement, !!propKey, tag, !1) @@ -1766,38 +1781,38 @@ function setInitialProperties(domElement, tag, props) { return; case "textarea": listenToNonDelegatedEvent("invalid", domElement); - defaultValue = type = propKey = null; - for (value in props) + value = name = propKey = null; + for (type in props) if ( - props.hasOwnProperty(value) && - ((checked = props[value]), null != checked) + props.hasOwnProperty(type) && + ((defaultValue = props[type]), null != defaultValue) ) - switch (value) { + switch (type) { case "value": - propKey = checked; + propKey = defaultValue; break; case "defaultValue": - type = checked; + name = defaultValue; break; case "children": - defaultValue = checked; + value = defaultValue; break; case "dangerouslySetInnerHTML": - if (null != checked) throw Error(formatProdErrorMessage(91)); + if (null != defaultValue) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, value, checked, props); + setProp(domElement, tag, type, defaultValue, props); } + initTextarea(domElement, propKey, name, value); track(domElement); - initTextarea(domElement, propKey, type, defaultValue); return; case "option": - for (checked in props) + for (defaultValue in props) if ( - props.hasOwnProperty(checked) && - ((propKey = props[checked]), null != propKey) + props.hasOwnProperty(defaultValue) && + ((propKey = props[defaultValue]), null != propKey) ) - switch (checked) { + switch (defaultValue) { case "selected": domElement.selected = propKey && @@ -1805,7 +1820,7 @@ function setInitialProperties(domElement, tag, props) { "symbol" !== typeof propKey; break; default: - setProp(domElement, tag, checked, propKey, props); + setProp(domElement, tag, defaultValue, propKey, props); } return; case "dialog": @@ -1845,29 +1860,29 @@ function setInitialProperties(domElement, tag, props) { case "track": case "wbr": case "menuitem": - for (defaultChecked in props) + for (checked in props) if ( - props.hasOwnProperty(defaultChecked) && - ((propKey = props[defaultChecked]), null != propKey) + props.hasOwnProperty(checked) && + ((propKey = props[checked]), null != propKey) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": throw Error(formatProdErrorMessage(137, tag)); default: - setProp(domElement, tag, defaultChecked, propKey, props, null); + setProp(domElement, tag, checked, propKey, props, null); } return; default: if (isCustomElement(tag)) { - for (propValue in props) - props.hasOwnProperty(propValue) && - ((propKey = props[propValue]), + for (defaultChecked in props) + props.hasOwnProperty(defaultChecked) && + ((propKey = props[defaultChecked]), null != propKey && setPropOnCustomElement( domElement, tag, - propValue, + defaultChecked, propKey, props, null @@ -1875,11 +1890,10 @@ function setInitialProperties(domElement, tag, props) { return; } } - for (defaultValue in props) - props.hasOwnProperty(defaultValue) && - ((propKey = props[defaultValue]), - null != propKey && - setProp(domElement, tag, defaultValue, propKey, props, null)); + for (value in props) + props.hasOwnProperty(value) && + ((propKey = props[value]), + null != propKey && setProp(domElement, tag, value, propKey, props, null)); } function updateProperties(domElement, tag, lastProps, nextProps) { switch (tag) { @@ -1905,12 +1919,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - nextProps.hasOwnProperty(propKey) || - ((lastProp = nextProps.defaultChecked), - (domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp)); break; case "value": break; @@ -1931,26 +1939,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (propKey$36) { case "type": type = propKey; - propKey !== lastProp && - (null != propKey && - "function" !== typeof propKey && - "symbol" !== typeof propKey && - "boolean" !== typeof propKey - ? domElement.setAttribute(propKey$36, propKey) - : domElement.removeAttribute(propKey$36)); break; case "name": name = propKey; break; case "checked": checked = propKey; - propKey !== lastProp && - ((propKey = - null != propKey ? propKey : nextProps.defaultChecked), - (domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey)); break; case "defaultChecked": defaultChecked = propKey; @@ -1978,12 +1972,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -1991,7 +1979,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -2088,19 +2077,19 @@ function updateProperties(domElement, tag, lastProps, nextProps) { updateTextarea(domElement, propKey$36, propKey); return; case "option": - for (var propKey$54 in lastProps) + for (var propKey$52 in lastProps) if ( - ((propKey$36 = lastProps[propKey$54]), - lastProps.hasOwnProperty(propKey$54) && + ((propKey$36 = lastProps[propKey$52]), + lastProps.hasOwnProperty(propKey$52) && null != propKey$36 && - !nextProps.hasOwnProperty(propKey$54)) + !nextProps.hasOwnProperty(propKey$52)) ) - switch (propKey$54) { + switch (propKey$52) { case "selected": domElement.selected = !1; break; default: - setProp(domElement, tag, propKey$54, null, nextProps, propKey$36); + setProp(domElement, tag, propKey$52, null, nextProps, propKey$36); } for (lastDefaultValue in nextProps) if ( @@ -2143,12 +2132,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$59 in lastProps) - (propKey$36 = lastProps[propKey$59]), - lastProps.hasOwnProperty(propKey$59) && + for (var propKey$57 in lastProps) + (propKey$36 = lastProps[propKey$57]), + lastProps.hasOwnProperty(propKey$57) && null != propKey$36 && - !nextProps.hasOwnProperty(propKey$59) && - setProp(domElement, tag, propKey$59, null, nextProps, propKey$36); + !nextProps.hasOwnProperty(propKey$57) && + setProp(domElement, tag, propKey$57, null, nextProps, propKey$36); for (checked in nextProps) if ( ((propKey$36 = nextProps[checked]), @@ -2169,15 +2158,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$64 in lastProps) - (propKey$36 = lastProps[propKey$64]), - lastProps.hasOwnProperty(propKey$64) && + for (var propKey$62 in lastProps) + (propKey$36 = lastProps[propKey$62]), + lastProps.hasOwnProperty(propKey$62) && null != propKey$36 && - !nextProps.hasOwnProperty(propKey$64) && + !nextProps.hasOwnProperty(propKey$62) && setPropOnCustomElement( domElement, tag, - propKey$64, + propKey$62, null, nextProps, propKey$36 @@ -2199,12 +2188,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; } } - for (var propKey$69 in lastProps) - (propKey$36 = lastProps[propKey$69]), - lastProps.hasOwnProperty(propKey$69) && + for (var propKey$67 in lastProps) + (propKey$36 = lastProps[propKey$67]), + lastProps.hasOwnProperty(propKey$67) && null != propKey$36 && - !nextProps.hasOwnProperty(propKey$69) && - setProp(domElement, tag, propKey$69, null, nextProps, propKey$36); + !nextProps.hasOwnProperty(propKey$67) && + setProp(domElement, tag, propKey$67, null, nextProps, propKey$36); for (lastProp in nextProps) (propKey$36 = nextProps[lastProp]), (propKey = lastProps[lastProp]), @@ -2247,21 +2236,10 @@ function updatePropertiesWithDiff( propValue = updatePayload[i + 1]; switch (propKey) { case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue - ? domElement.setAttribute(propKey, propValue) - : domElement.removeAttribute(propKey); break; case "name": break; case "checked": - propKey = null != propValue ? propValue : nextProps.defaultChecked; - domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey; break; case "defaultChecked": break; @@ -2278,12 +2256,6 @@ function updatePropertiesWithDiff( setProp(domElement, tag, propKey, propValue, nextProps, null); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -2291,7 +2263,8 @@ function updatePropertiesWithDiff( lastProps, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -2416,7 +2389,8 @@ function restoreStateOfTarget(target) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); internalInstance = props.name; if ("radio" === props.type && null != internalInstance) { @@ -2443,7 +2417,8 @@ function restoreStateOfTarget(target) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -2759,7 +2734,6 @@ function prepareToHydrateHostInstance(fiber) { break; case "input": listenToNonDelegatedEvent("invalid", instance); - track(instance); initInput( instance, props.value, @@ -2767,16 +2741,18 @@ function prepareToHydrateHostInstance(fiber) { props.checked, props.defaultChecked, props.type, + props.name, !0 ); + track(instance); break; case "select": listenToNonDelegatedEvent("invalid", instance); break; case "textarea": listenToNonDelegatedEvent("invalid", instance), - track(instance), - initTextarea(instance, props.value, props.defaultValue, props.children); + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); } i = null; var children = props.children; @@ -4274,10 +4250,10 @@ createFunctionComponentUpdateQueue = function () { function use(usable) { if (null !== usable && "object" === typeof usable) { if ("function" === typeof usable.then) { - var index$121 = thenableIndexCounter; + var index$119 = thenableIndexCounter; thenableIndexCounter += 1; null === thenableState && (thenableState = []); - usable = trackUsedThenable(thenableState, usable, index$121); + usable = trackUsedThenable(thenableState, usable, index$119); null === currentlyRenderingFiber$1.alternate && (null === workInProgressHook ? null === currentlyRenderingFiber$1.memoizedState @@ -4765,14 +4741,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$127 = enqueueUpdate(provider, fiber, lane); - null !== root$127 && - (scheduleUpdateOnFiber(root$127, provider, lane), - entangleTransitions(root$127, provider, lane)); + var root$125 = enqueueUpdate(provider, fiber, lane); + null !== root$125 && + (scheduleUpdateOnFiber(root$125, provider, lane), + entangleTransitions(root$125, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$127 && + null !== root$125 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4975,15 +4951,15 @@ var HooksDispatcherOnMount = { getServerSnapshot = getServerSnapshot(); } else { getServerSnapshot = getSnapshot(); - var root$123 = workInProgressRoot; - if (null === root$123) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root$123, renderLanes$1) || + var root$121 = workInProgressRoot; + if (null === root$121) throw Error(formatProdErrorMessage(349)); + includesBlockingLane(root$121, renderLanes$1) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } hook.memoizedState = getServerSnapshot; - root$123 = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = root$123; - mountEffect(subscribeToStore.bind(null, fiber, root$123, subscribe), [ + root$121 = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = root$121; + mountEffect(subscribeToStore.bind(null, fiber, root$121, subscribe), [ subscribe ]); fiber.flags |= 2048; @@ -4992,7 +4968,7 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - root$123, + root$121, getServerSnapshot, getSnapshot ), @@ -5488,10 +5464,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$138 = workInProgress.stateNode; + root$136 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$138.incompleteTransitions.has(transition)) { + if (!root$136.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5499,11 +5475,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$138.incompleteTransitions.set(transition, markerInstance); + root$136.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$138.incompleteTransitions.forEach(function (markerInstance) { + root$136.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -6200,14 +6176,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { } JSCompiler_temp = current.memoizedState; if (null !== JSCompiler_temp) { - var dehydrated$145 = JSCompiler_temp.dehydrated; - if (null !== dehydrated$145) + var dehydrated$143 = JSCompiler_temp.dehydrated; + if (null !== dehydrated$143) return updateDehydratedSuspenseComponent( current, workInProgress, didSuspend, nextProps, - dehydrated$145, + dehydrated$143, JSCompiler_temp, renderLanes ); @@ -6217,7 +6193,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { showFallback = nextProps.fallback; didSuspend = workInProgress.mode; JSCompiler_temp = current.child; - dehydrated$145 = JSCompiler_temp.sibling; + dehydrated$143 = JSCompiler_temp.sibling; var primaryChildProps = { mode: "hidden", children: nextProps.children }; 0 === (didSuspend & 1) && workInProgress.child !== JSCompiler_temp ? ((nextProps = workInProgress.child), @@ -6226,8 +6202,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (workInProgress.deletions = null)) : ((nextProps = createWorkInProgress(JSCompiler_temp, primaryChildProps)), (nextProps.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)); - null !== dehydrated$145 - ? (showFallback = createWorkInProgress(dehydrated$145, showFallback)) + null !== dehydrated$143 + ? (showFallback = createWorkInProgress(dehydrated$143, showFallback)) : ((showFallback = createFiberFromFragment( showFallback, didSuspend, @@ -6246,10 +6222,10 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ? (didSuspend = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = didSuspend.cachePool), null !== JSCompiler_temp - ? ((dehydrated$145 = CacheContext._currentValue), + ? ((dehydrated$143 = CacheContext._currentValue), (JSCompiler_temp = - JSCompiler_temp.parent !== dehydrated$145 - ? { parent: dehydrated$145, pool: dehydrated$145 } + JSCompiler_temp.parent !== dehydrated$143 + ? { parent: dehydrated$143, pool: dehydrated$143 } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), (didSuspend = { @@ -6263,23 +6239,23 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), - (dehydrated$145 = showFallback.updateQueue), + (dehydrated$143 = showFallback.updateQueue), (primaryChildProps = current.updateQueue), - null === dehydrated$145 + null === dehydrated$143 ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null }) - : dehydrated$145 === primaryChildProps + : dehydrated$143 === primaryChildProps ? (showFallback.updateQueue = { transitions: didSuspend, markerInstances: JSCompiler_temp, retryQueue: null !== primaryChildProps ? primaryChildProps.retryQueue : null }) - : ((dehydrated$145.transitions = didSuspend), - (dehydrated$145.markerInstances = JSCompiler_temp)))); + : ((dehydrated$143.transitions = didSuspend), + (dehydrated$143.markerInstances = JSCompiler_temp)))); showFallback.childLanes = current.childLanes & ~renderLanes; workInProgress.memoizedState = SUSPENDED_MARKER; return nextProps; @@ -7346,14 +7322,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$176 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$176 = lastTailNode), + for (var lastTailNode$174 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$174 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$176 + null === lastTailNode$174 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$176.sibling = null); + : (lastTailNode$174.sibling = null); } } function bubbleProperties(completedWork) { @@ -7363,19 +7339,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$177 = completedWork.child; null !== child$177; ) - (newChildLanes |= child$177.lanes | child$177.childLanes), - (subtreeFlags |= child$177.subtreeFlags & 31457280), - (subtreeFlags |= child$177.flags & 31457280), - (child$177.return = completedWork), - (child$177 = child$177.sibling); + for (var child$175 = completedWork.child; null !== child$175; ) + (newChildLanes |= child$175.lanes | child$175.childLanes), + (subtreeFlags |= child$175.subtreeFlags & 31457280), + (subtreeFlags |= child$175.flags & 31457280), + (child$175.return = completedWork), + (child$175 = child$175.sibling); else - for (child$177 = completedWork.child; null !== child$177; ) - (newChildLanes |= child$177.lanes | child$177.childLanes), - (subtreeFlags |= child$177.subtreeFlags), - (subtreeFlags |= child$177.flags), - (child$177.return = completedWork), - (child$177 = child$177.sibling); + for (child$175 = completedWork.child; null !== child$175; ) + (newChildLanes |= child$175.lanes | child$175.childLanes), + (subtreeFlags |= child$175.subtreeFlags), + (subtreeFlags |= child$175.flags), + (child$175.return = completedWork), + (child$175 = child$175.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -8113,8 +8089,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$207) { - captureCommitPhaseError(current, nearestMountedAncestor, error$207); + } catch (error$205) { + captureCommitPhaseError(current, nearestMountedAncestor, error$205); } else ref.current = null; } @@ -8151,7 +8127,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$266) { + } catch (e$264) { JSCompiler_temp = null; break a; } @@ -8417,11 +8393,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$209) { + } catch (error$207) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$209 + error$207 ); } } @@ -9101,8 +9077,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$222) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$222); + } catch (error$220) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$220); } } break; @@ -9284,11 +9260,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$223) { + } catch (error$221) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$223 + error$221 ); } break; @@ -9324,8 +9300,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$224) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$224); + } catch (error$222) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$222); } } if ( @@ -9350,8 +9326,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root ), (flags[internalPropsKey] = root); - } catch (error$227) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$227); + } catch (error$225) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$225); } break; case 6: @@ -9364,8 +9340,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags = finishedWork.memoizedProps; try { current.nodeValue = flags; - } catch (error$228) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$228); + } catch (error$226) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$226); } } break; @@ -9379,8 +9355,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$229) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$229); + } catch (error$227) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$227); } break; case 4: @@ -9410,8 +9386,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$231) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$231); + } catch (error$229) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$229); } current = finishedWork.updateQueue; null !== current && @@ -9489,11 +9465,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$212) { + } catch (error$210) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$212 + error$210 ); } } else if ( @@ -9568,21 +9544,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$213 = JSCompiler_inline_result.stateNode; + var parent$211 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$213, ""), + (setTextContent(parent$211, ""), (JSCompiler_inline_result.flags &= -33)); - var before$214 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$214, parent$213); + var before$212 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$212, parent$211); break; case 3: case 4: - var parent$215 = JSCompiler_inline_result.stateNode.containerInfo, - before$216 = getHostSibling(finishedWork); + var parent$213 = JSCompiler_inline_result.stateNode.containerInfo, + before$214 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$216, - parent$215 + before$214, + parent$213 ); break; default: @@ -10052,9 +10028,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$241 = finishedWork.stateNode; + var instance$239 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$241._visibility & 4 + ? instance$239._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10067,7 +10043,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$241._visibility |= 4), + : ((instance$239._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10075,7 +10051,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$241._visibility |= 4), + : ((instance$239._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10088,7 +10064,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$241 + instance$239 ); break; case 24: @@ -10630,13 +10606,13 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$250 = firstScheduledRoot; null !== root$250; ) { + for (var root$248 = firstScheduledRoot; null !== root$248; ) { if ( - (!onlyLegacy || 0 === root$250.tag) && + (!onlyLegacy || 0 === root$248.tag) && 0 !== (getNextLanes( - root$250, - root$250 === workInProgressRoot$jscomp$0 + root$248, + root$248 === workInProgressRoot$jscomp$0 ? workInProgressRootRenderLanes$jscomp$0 : 0 ) & @@ -10644,7 +10620,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { ) try { didPerformSomeWork = !0; - var root = root$250; + var root = root$248; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); flushPassiveEffects(); @@ -10687,7 +10663,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } catch (error) { null === errors ? (errors = [error]) : errors.push(error); } - root$250 = root$250.next; + root$248 = root$248.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11007,16 +10983,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout = renderRootSync(root, lanes); if (2 === didTimeout) { errorRetryLanes = lanes; - var errorRetryLanes$253 = getLanesToRetrySynchronouslyOnError( + var errorRetryLanes$251 = getLanesToRetrySynchronouslyOnError( root, errorRetryLanes ); - 0 !== errorRetryLanes$253 && - ((lanes = errorRetryLanes$253), + 0 !== errorRetryLanes$251 && + ((lanes = errorRetryLanes$251), (didTimeout = recoverFromConcurrentError( root, errorRetryLanes, - errorRetryLanes$253 + errorRetryLanes$251 ))); } if (1 === didTimeout) @@ -11350,8 +11326,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$255) { - handleThrow(root, thrownValue$255); + } catch (thrownValue$253) { + handleThrow(root, thrownValue$253); } while (1); resetContextDependencies(); @@ -11457,8 +11433,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$257) { - handleThrow(root, thrownValue$257); + } catch (thrownValue$255) { + handleThrow(root, thrownValue$255); } while (1); resetContextDependencies(); @@ -11625,10 +11601,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) { }; suspenseBoundary.updateQueue = newOffscreenQueue; } else { - var retryQueue$133 = offscreenQueue.retryQueue; - null === retryQueue$133 + var retryQueue$131 = offscreenQueue.retryQueue; + null === retryQueue$131 ? (offscreenQueue.retryQueue = new Set([wakeable])) - : retryQueue$133.add(wakeable); + : retryQueue$131.add(wakeable); } } break; @@ -11812,12 +11788,12 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - var shouldFireAfterActiveInstanceBlur$261 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$259 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$261 && + shouldFireAfterActiveInstanceBlur$259 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11896,7 +11872,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$262 = rootWithPendingPassiveEffects, + var root$260 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); @@ -11912,7 +11888,7 @@ function flushPassiveEffects() { } finally { (currentUpdatePriority = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), - releaseRootPooledCache(root$262, remainingLanes); + releaseRootPooledCache(root$260, remainingLanes); } } return !1; @@ -13208,12 +13184,12 @@ function getPublicRootInstance(container) { function attemptSynchronousHydration(fiber) { switch (fiber.tag) { case 3: - var root$264 = fiber.stateNode; - if (root$264.current.memoizedState.isDehydrated) { - var lanes = getHighestPriorityLanes(root$264.pendingLanes); + var root$262 = fiber.stateNode; + if (root$262.current.memoizedState.isDehydrated) { + var lanes = getHighestPriorityLanes(root$262.pendingLanes); 0 !== lanes && - (markRootEntangled(root$264, lanes | 2), - ensureRootIsScheduled(root$264), + (markRootEntangled(root$262, lanes | 2), + ensureRootIsScheduled(root$262), 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), flushSyncWorkAcrossRoots_impl(!1))); @@ -13779,19 +13755,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$382; + var JSCompiler_inline_result$jscomp$380; if (canUseDOM) { - var isSupported$jscomp$inline_1659 = "oninput" in document; - if (!isSupported$jscomp$inline_1659) { - var element$jscomp$inline_1660 = document.createElement("div"); - element$jscomp$inline_1660.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1659 = - "function" === typeof element$jscomp$inline_1660.oninput; + var isSupported$jscomp$inline_1657 = "oninput" in document; + if (!isSupported$jscomp$inline_1657) { + var element$jscomp$inline_1658 = document.createElement("div"); + element$jscomp$inline_1658.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1657 = + "function" === typeof element$jscomp$inline_1658.oninput; } - JSCompiler_inline_result$jscomp$382 = isSupported$jscomp$inline_1659; - } else JSCompiler_inline_result$jscomp$382 = !1; + JSCompiler_inline_result$jscomp$380 = isSupported$jscomp$inline_1657; + } else JSCompiler_inline_result$jscomp$380 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$382 && + JSCompiler_inline_result$jscomp$380 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14100,20 +14076,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1700 = 0; - i$jscomp$inline_1700 < simpleEventPluginEvents.length; - i$jscomp$inline_1700++ + var i$jscomp$inline_1698 = 0; + i$jscomp$inline_1698 < simpleEventPluginEvents.length; + i$jscomp$inline_1698++ ) { - var eventName$jscomp$inline_1701 = - simpleEventPluginEvents[i$jscomp$inline_1700], - domEventName$jscomp$inline_1702 = - eventName$jscomp$inline_1701.toLowerCase(), - capitalizedEvent$jscomp$inline_1703 = - eventName$jscomp$inline_1701[0].toUpperCase() + - eventName$jscomp$inline_1701.slice(1); + var eventName$jscomp$inline_1699 = + simpleEventPluginEvents[i$jscomp$inline_1698], + domEventName$jscomp$inline_1700 = + eventName$jscomp$inline_1699.toLowerCase(), + capitalizedEvent$jscomp$inline_1701 = + eventName$jscomp$inline_1699[0].toUpperCase() + + eventName$jscomp$inline_1699.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1702, - "on" + capitalizedEvent$jscomp$inline_1703 + domEventName$jscomp$inline_1700, + "on" + capitalizedEvent$jscomp$inline_1701 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15015,11 +14991,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$274); + var instance = getPublicRootInstance(root$272); originalCallback.call(instance); }; } - var root$274 = createHydrationContainer( + var root$272 = createHydrationContainer( initialChildren, callback, container, @@ -15031,23 +15007,23 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$274; - container[internalContainerInstanceKey] = root$274.current; + container._reactRootContainer = root$272; + container[internalContainerInstanceKey] = root$272.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(); - return root$274; + return root$272; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$275 = callback; + var originalCallback$273 = callback; callback = function () { - var instance = getPublicRootInstance(root$276); - originalCallback$275.call(instance); + var instance = getPublicRootInstance(root$274); + originalCallback$273.call(instance); }; } - var root$276 = createFiberRoot( + var root$274 = createFiberRoot( container, 0, !1, @@ -15059,15 +15035,15 @@ function legacyCreateRootFromDOMContainer( noopOnRecoverableError, null ); - container._reactRootContainer = root$276; - container[internalContainerInstanceKey] = root$276.current; + container._reactRootContainer = root$274; + container[internalContainerInstanceKey] = root$274.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSync$1(function () { - updateContainer(initialChildren, root$276, parentComponent, callback); + updateContainer(initialChildren, root$274, parentComponent, callback); }); - return root$276; + return root$274; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -15126,17 +15102,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1814 = { +var devToolsConfig$jscomp$inline_1812 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-145c42eb", + version: "18.3.0-www-classic-3f9bce70", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2252 = { - bundleType: devToolsConfig$jscomp$inline_1814.bundleType, - version: devToolsConfig$jscomp$inline_1814.version, - rendererPackageName: devToolsConfig$jscomp$inline_1814.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1814.rendererConfig, +var internals$jscomp$inline_2250 = { + bundleType: devToolsConfig$jscomp$inline_1812.bundleType, + version: devToolsConfig$jscomp$inline_1812.version, + rendererPackageName: devToolsConfig$jscomp$inline_1812.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1812.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -15152,26 +15128,26 @@ var internals$jscomp$inline_2252 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1814.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1812.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-145c42eb" + reconcilerVersion: "18.3.0-www-classic-3f9bce70" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2253 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2251 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2253.isDisabled && - hook$jscomp$inline_2253.supportsFiber + !hook$jscomp$inline_2251.isDisabled && + hook$jscomp$inline_2251.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2253.inject( - internals$jscomp$inline_2252 + (rendererID = hook$jscomp$inline_2251.inject( + internals$jscomp$inline_2250 )), - (injectedHook = hook$jscomp$inline_2253); + (injectedHook = hook$jscomp$inline_2251); } catch (err) {} } var tagToRoleMappings = { @@ -15645,14 +15621,14 @@ function preinit(href, options) { switch (as) { case "style": as = getResourcesFromRoot(resourceRoot).hoistableStyles; - var key$279 = getStyleKey(href), + var key$277 = getStyleKey(href), precedence = options.precedence || "default", - resource = as.get(key$279); + resource = as.get(key$277); if (resource) break; var state = { loading: 0, preload: null }; if ( (resource = resourceRoot.querySelector( - getStylesheetSelectorFromKey(key$279) + getStylesheetSelectorFromKey(key$277) )) ) state.loading = 1; @@ -15663,7 +15639,7 @@ function preinit(href, options) { "data-precedence": precedence, crossOrigin: options.crossOrigin }; - (options = preloadPropsMap.get(key$279)) && + (options = preloadPropsMap.get(key$277)) && adoptPreloadPropsForStylesheet(href, options); var link = (resource = ( resourceRoot.ownerDocument || resourceRoot @@ -15689,15 +15665,15 @@ function preinit(href, options) { count: 1, state: state }; - as.set(key$279, resource); + as.set(key$277, resource); break; case "script": (as = getResourcesFromRoot(resourceRoot).hoistableScripts), - (key$279 = getScriptKey(href)), - (precedence = as.get(key$279)), + (key$277 = getScriptKey(href)), + (precedence = as.get(key$277)), precedence || ((precedence = resourceRoot.querySelector( - "script[async]" + key$279 + "script[async]" + key$277 )), precedence || ((href = { @@ -15706,7 +15682,7 @@ function preinit(href, options) { crossOrigin: options.crossOrigin, integrity: options.integrity }), - (options = preloadPropsMap.get(key$279)) && + (options = preloadPropsMap.get(key$277)) && adoptPreloadPropsForScript(href, options), (options = resourceRoot.ownerDocument || resourceRoot), (precedence = options.createElement("script")), @@ -15719,13 +15695,13 @@ function preinit(href, options) { count: 1, state: null }), - as.set(key$279, precedence)); + as.set(key$277, precedence)); } else if ("style" === as || "script" === as) if ((resourceRoot = getDocumentForPreloads())) { - key$279 = escapeSelectorAttributeValueInsideDoubleQuotes(href); - precedence = key$279 = - 'link[rel="preload"][as="' + as + '"][href="' + key$279 + '"]'; + key$277 = escapeSelectorAttributeValueInsideDoubleQuotes(href); + precedence = key$277 = + 'link[rel="preload"][as="' + as + '"][href="' + key$277 + '"]'; switch (as) { case "style": precedence = getStyleKey(href); @@ -15742,7 +15718,7 @@ function preinit(href, options) { integrity: options.integrity }), preloadPropsMap.set(precedence, href), - null === resourceRoot.querySelector(key$279) && + null === resourceRoot.querySelector(key$277) && ((options = resourceRoot.createElement("link")), setInitialProperties(options, "link", href), markNodeAsHoistable(options), @@ -15775,17 +15751,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$288 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$289 = styles$288.get(type); - resource$289 || + var styles$286 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$287 = styles$286.get(type); + resource$287 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$289 = { + (resource$287 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$288.set(type, resource$289), + styles$286.set(type, resource$287), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15800,9 +15776,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$289.state + resource$287.state )); - return resource$289; + return resource$287; } return null; case "script": @@ -15874,36 +15850,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = key); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$294 = hoistableRoot.querySelector( + var instance$292 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$294) + if (instance$292) return ( - (resource.instance = instance$294), - markNodeAsHoistable(instance$294), - instance$294 + (resource.instance = instance$292), + markNodeAsHoistable(instance$292), + instance$292 ); key = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(key, styleProps); - instance$294 = ( + instance$292 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$294); - var linkInstance = instance$294; + markNodeAsHoistable(instance$292); + var linkInstance = instance$292; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$294, "link", key); + setInitialProperties(instance$292, "link", key); resource.state.loading |= 4; - insertStylesheet(instance$294, props.precedence, hoistableRoot); - return (resource.instance = instance$294); + insertStylesheet(instance$292, props.precedence, hoistableRoot); + return (resource.instance = instance$292); case "script": - instance$294 = getScriptKey(props.src); + instance$292 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$294 + "script[async]" + instance$292 )) ) return ( @@ -15912,7 +15888,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); key = props; - if ((styleProps = preloadPropsMap.get(instance$294))) + if ((styleProps = preloadPropsMap.get(instance$292))) (key = assign({}, props)), adoptPreloadPropsForScript(key, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17159,4 +17135,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-145c42eb"; +exports.version = "18.3.0-www-classic-3f9bce70"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 89b22e0267..9d2e29bf46 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -964,8 +964,16 @@ function updateInput( lastDefaultValue, checked, defaultChecked, - type + type, + name ) { + element.name = ""; + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type + ? (element.type = type) + : element.removeAttribute("type"); if (null != value) if ("number" === type) { if ((0 === value && "" === element.value) || element.value != value) @@ -996,6 +1004,12 @@ function updateInput( null != checked && element.checked !== !!checked && (element.checked = checked); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name + ? (element.name = name) + : element.removeAttribute("name"); } function initInput( element, @@ -1004,8 +1018,14 @@ function initInput( checked, defaultChecked, type, + name, isHydrating ) { + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type && + (element.type = type); if (null != value || null != defaultValue) { if ( (type = "submit" === type || "reset" === type) && @@ -1026,16 +1046,17 @@ function initInput( ? null != defaultValue && (element.defaultValue = defaultValueStr) : (element.defaultValue = initialValue); } - value = element.name; - "" !== value && (element.name = ""); - checked = null != checked ? checked : defaultChecked; - checked = - "function" !== typeof checked && "symbol" !== typeof checked && !!checked; - isHydrating || (element.checked = !!checked); + value = null != checked ? checked : defaultChecked; + value = "function" !== typeof value && "symbol" !== typeof value && !!value; + isHydrating || (element.checked = !!value); disableInputAttributeSyncing ? null != defaultChecked && (element.defaultChecked = !!defaultChecked) - : (element.defaultChecked = !!checked); - "" !== value && (element.name = value); + : (element.defaultChecked = !!value); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name && + (element.name = name); } function setDefaultValue(node, type, value) { ("number" === type && getActiveElement(node.ownerDocument) === node) || @@ -1327,7 +1348,8 @@ function restoreStateOfTarget(target) { props.defaultValue, props.checked, props.defaultChecked, - props.type + props.type, + props.name ); internalInstance = props.name; if ("radio" === props.type && null != internalInstance) { @@ -1354,7 +1376,8 @@ function restoreStateOfTarget(target) { otherProps.defaultValue, otherProps.checked, otherProps.defaultChecked, - otherProps.type + otherProps.type, + otherProps.name ); } } @@ -1718,7 +1741,6 @@ function prepareToHydrateHostInstance(fiber) { break; case "input": listenToNonDelegatedEvent("invalid", instance); - track(instance); initInput( instance, props.value, @@ -1726,16 +1748,18 @@ function prepareToHydrateHostInstance(fiber) { props.checked, props.defaultChecked, props.type, + props.name, !0 ); + track(instance); break; case "select": listenToNonDelegatedEvent("invalid", instance); break; case "textarea": listenToNonDelegatedEvent("invalid", instance), - track(instance), - initTextarea(instance, props.value, props.defaultValue); + initTextarea(instance, props.value, props.defaultValue), + track(instance); } i = null; var children = props.children; @@ -13082,19 +13106,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$378; + var JSCompiler_inline_result$jscomp$376; if (canUseDOM) { - var isSupported$jscomp$inline_1635 = "oninput" in document; - if (!isSupported$jscomp$inline_1635) { - var element$jscomp$inline_1636 = document.createElement("div"); - element$jscomp$inline_1636.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1635 = - "function" === typeof element$jscomp$inline_1636.oninput; + var isSupported$jscomp$inline_1633 = "oninput" in document; + if (!isSupported$jscomp$inline_1633) { + var element$jscomp$inline_1634 = document.createElement("div"); + element$jscomp$inline_1634.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1633 = + "function" === typeof element$jscomp$inline_1634.oninput; } - JSCompiler_inline_result$jscomp$378 = isSupported$jscomp$inline_1635; - } else JSCompiler_inline_result$jscomp$378 = !1; + JSCompiler_inline_result$jscomp$376 = isSupported$jscomp$inline_1633; + } else JSCompiler_inline_result$jscomp$376 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$378 && + JSCompiler_inline_result$jscomp$376 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13403,20 +13427,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1676 = 0; - i$jscomp$inline_1676 < simpleEventPluginEvents.length; - i$jscomp$inline_1676++ + var i$jscomp$inline_1674 = 0; + i$jscomp$inline_1674 < simpleEventPluginEvents.length; + i$jscomp$inline_1674++ ) { - var eventName$jscomp$inline_1677 = - simpleEventPluginEvents[i$jscomp$inline_1676], - domEventName$jscomp$inline_1678 = - eventName$jscomp$inline_1677.toLowerCase(), - capitalizedEvent$jscomp$inline_1679 = - eventName$jscomp$inline_1677[0].toUpperCase() + - eventName$jscomp$inline_1677.slice(1); + var eventName$jscomp$inline_1675 = + simpleEventPluginEvents[i$jscomp$inline_1674], + domEventName$jscomp$inline_1676 = + eventName$jscomp$inline_1675.toLowerCase(), + capitalizedEvent$jscomp$inline_1677 = + eventName$jscomp$inline_1675[0].toUpperCase() + + eventName$jscomp$inline_1675.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1678, - "on" + capitalizedEvent$jscomp$inline_1679 + domEventName$jscomp$inline_1676, + "on" + capitalizedEvent$jscomp$inline_1677 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14590,7 +14614,8 @@ function setInitialProperties(domElement, tag, props) { break; case "input": listenToNonDelegatedEvent("invalid", domElement); - var type = null, + var name = null, + type = null, value = null, defaultValue = null, checked = null, @@ -14600,22 +14625,14 @@ function setInitialProperties(domElement, tag, props) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { + case "name": + name = propValue; + break; case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue && - ((type = propValue), - domElement.setAttribute(propKey, propValue)); + type = propValue; break; case "checked": checked = propValue; - propValue = - null != propValue ? propValue : props.defaultChecked; - domElement.checked = - !!propValue && - "function" !== typeof propValue && - "symbol" !== propValue; break; case "defaultChecked": defaultChecked = propValue; @@ -14635,7 +14652,6 @@ function setInitialProperties(domElement, tag, props) { setProp(domElement, tag, propKey, propValue, props, null); } } - track(domElement); initInput( domElement, value, @@ -14643,31 +14659,33 @@ function setInitialProperties(domElement, tag, props) { checked, defaultChecked, type, + name, !1 ); + track(domElement); return; case "select": listenToNonDelegatedEvent("invalid", domElement); - var propKey = (value = defaultValue = null); - for (type in props) + var propKey = (type = value = null); + for (name in props) if ( - props.hasOwnProperty(type) && - ((checked = props[type]), null != checked) + props.hasOwnProperty(name) && + ((defaultValue = props[name]), null != defaultValue) ) - switch (type) { + switch (name) { case "value": - defaultValue = checked; + value = defaultValue; break; case "defaultValue": - value = checked; + type = defaultValue; break; case "multiple": - propKey = checked; + propKey = defaultValue; default: - setProp(domElement, tag, type, checked, props, null); + setProp(domElement, tag, name, defaultValue, props, null); } - tag = defaultValue; - props = value; + tag = value; + props = type; domElement.multiple = !!propKey; null != tag ? updateOptions(domElement, !!propKey, tag, !1) @@ -14675,37 +14693,37 @@ function setInitialProperties(domElement, tag, props) { return; case "textarea": listenToNonDelegatedEvent("invalid", domElement); - type = propKey = null; - for (value in props) + name = propKey = null; + for (type in props) if ( - props.hasOwnProperty(value) && - ((defaultValue = props[value]), null != defaultValue) + props.hasOwnProperty(type) && + ((value = props[type]), null != value) ) - switch (value) { + switch (type) { case "value": - propKey = defaultValue; + propKey = value; break; case "defaultValue": - type = defaultValue; + name = value; break; case "children": break; case "dangerouslySetInnerHTML": - if (null != defaultValue) throw Error(formatProdErrorMessage(91)); + if (null != value) throw Error(formatProdErrorMessage(91)); break; default: - setProp(domElement, tag, value, defaultValue, props); + setProp(domElement, tag, type, value, props); } + initTextarea(domElement, propKey, name); track(domElement); - initTextarea(domElement, propKey, type); return; case "option": - for (checked in props) + for (defaultValue in props) if ( - props.hasOwnProperty(checked) && - ((propKey = props[checked]), null != propKey) + props.hasOwnProperty(defaultValue) && + ((propKey = props[defaultValue]), null != propKey) ) - switch (checked) { + switch (defaultValue) { case "selected": domElement.selected = propKey && @@ -14713,7 +14731,7 @@ function setInitialProperties(domElement, tag, props) { "symbol" !== typeof propKey; break; default: - setProp(domElement, tag, checked, propKey, props); + setProp(domElement, tag, defaultValue, propKey, props); } return; case "dialog": @@ -14753,29 +14771,29 @@ function setInitialProperties(domElement, tag, props) { case "track": case "wbr": case "menuitem": - for (defaultChecked in props) + for (checked in props) if ( - props.hasOwnProperty(defaultChecked) && - ((propKey = props[defaultChecked]), null != propKey) + props.hasOwnProperty(checked) && + ((propKey = props[checked]), null != propKey) ) - switch (defaultChecked) { + switch (checked) { case "children": case "dangerouslySetInnerHTML": throw Error(formatProdErrorMessage(137, tag)); default: - setProp(domElement, tag, defaultChecked, propKey, props, null); + setProp(domElement, tag, checked, propKey, props, null); } return; default: if (isCustomElement(tag)) { - for (propValue in props) - props.hasOwnProperty(propValue) && - ((propKey = props[propValue]), + for (defaultChecked in props) + props.hasOwnProperty(defaultChecked) && + ((propKey = props[defaultChecked]), null != propKey && setPropOnCustomElement( domElement, tag, - propValue, + defaultChecked, propKey, props, null @@ -14783,11 +14801,10 @@ function setInitialProperties(domElement, tag, props) { return; } } - for (defaultValue in props) - props.hasOwnProperty(defaultValue) && - ((propKey = props[defaultValue]), - null != propKey && - setProp(domElement, tag, defaultValue, propKey, props, null)); + for (value in props) + props.hasOwnProperty(value) && + ((propKey = props[value]), + null != propKey && setProp(domElement, tag, value, propKey, props, null)); } function updateProperties(domElement, tag, lastProps, nextProps) { switch (tag) { @@ -14813,12 +14830,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { if (lastProps.hasOwnProperty(propKey) && null != lastProp) switch (propKey) { case "checked": - nextProps.hasOwnProperty(propKey) || - ((lastProp = nextProps.defaultChecked), - (domElement.checked = - !!lastProp && - "function" !== typeof lastProp && - "symbol" !== lastProp)); break; case "value": break; @@ -14839,26 +14850,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { switch (propKey$218) { case "type": type = propKey; - propKey !== lastProp && - (null != propKey && - "function" !== typeof propKey && - "symbol" !== typeof propKey && - "boolean" !== typeof propKey - ? domElement.setAttribute(propKey$218, propKey) - : domElement.removeAttribute(propKey$218)); break; case "name": name = propKey; break; case "checked": checked = propKey; - propKey !== lastProp && - ((propKey = - null != propKey ? propKey : nextProps.defaultChecked), - (domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey)); break; case "defaultChecked": defaultChecked = propKey; @@ -14886,12 +14883,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -14899,7 +14890,8 @@ function updateProperties(domElement, tag, lastProps, nextProps) { lastDefaultValue, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -14996,14 +14988,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { updateTextarea(domElement, propKey$218, propKey); return; case "option": - for (var propKey$236 in lastProps) + for (var propKey$234 in lastProps) if ( - ((propKey$218 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && + ((propKey$218 = lastProps[propKey$234]), + lastProps.hasOwnProperty(propKey$234) && null != propKey$218 && - !nextProps.hasOwnProperty(propKey$236)) + !nextProps.hasOwnProperty(propKey$234)) ) - switch (propKey$236) { + switch (propKey$234) { case "selected": domElement.selected = !1; break; @@ -15011,7 +15003,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$236, + propKey$234, null, nextProps, propKey$218 @@ -15058,12 +15050,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$241 in lastProps) - (propKey$218 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && + for (var propKey$239 in lastProps) + (propKey$218 = lastProps[propKey$239]), + lastProps.hasOwnProperty(propKey$239) && null != propKey$218 && - !nextProps.hasOwnProperty(propKey$241) && - setProp(domElement, tag, propKey$241, null, nextProps, propKey$218); + !nextProps.hasOwnProperty(propKey$239) && + setProp(domElement, tag, propKey$239, null, nextProps, propKey$218); for (checked in nextProps) if ( ((propKey$218 = nextProps[checked]), @@ -15091,15 +15083,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$246 in lastProps) - (propKey$218 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && + for (var propKey$244 in lastProps) + (propKey$218 = lastProps[propKey$244]), + lastProps.hasOwnProperty(propKey$244) && null != propKey$218 && - !nextProps.hasOwnProperty(propKey$246) && + !nextProps.hasOwnProperty(propKey$244) && setPropOnCustomElement( domElement, tag, - propKey$246, + propKey$244, null, nextProps, propKey$218 @@ -15121,12 +15113,12 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; } } - for (var propKey$251 in lastProps) - (propKey$218 = lastProps[propKey$251]), - lastProps.hasOwnProperty(propKey$251) && + for (var propKey$249 in lastProps) + (propKey$218 = lastProps[propKey$249]), + lastProps.hasOwnProperty(propKey$249) && null != propKey$218 && - !nextProps.hasOwnProperty(propKey$251) && - setProp(domElement, tag, propKey$251, null, nextProps, propKey$218); + !nextProps.hasOwnProperty(propKey$249) && + setProp(domElement, tag, propKey$249, null, nextProps, propKey$218); for (lastProp in nextProps) (propKey$218 = nextProps[lastProp]), (propKey = lastProps[lastProp]), @@ -15169,21 +15161,10 @@ function updatePropertiesWithDiff( propValue = updatePayload[i + 1]; switch (propKey) { case "type": - null != propValue && - "function" !== typeof propValue && - "symbol" !== typeof propValue && - "boolean" !== typeof propValue - ? domElement.setAttribute(propKey, propValue) - : domElement.removeAttribute(propKey); break; case "name": break; case "checked": - propKey = null != propValue ? propValue : nextProps.defaultChecked; - domElement.checked = - !!propKey && - "function" !== typeof propKey && - "symbol" !== propKey; break; case "defaultChecked": break; @@ -15200,12 +15181,6 @@ function updatePropertiesWithDiff( setProp(domElement, tag, propKey, propValue, nextProps, null); } } - null != name && - "function" !== typeof name && - "symbol" !== typeof name && - "boolean" !== typeof name - ? domElement.setAttribute("name", name) - : domElement.removeAttribute("name"); updateInput( domElement, value, @@ -15213,7 +15188,8 @@ function updatePropertiesWithDiff( lastProps, checked, defaultChecked, - type + type, + name ); return; case "select": @@ -15694,14 +15670,14 @@ function preinit$1(href, options) { switch (as) { case "style": as = getResourcesFromRoot(resourceRoot).hoistableStyles; - var key$279 = getStyleKey(href), + var key$277 = getStyleKey(href), precedence = options.precedence || "default", - resource = as.get(key$279); + resource = as.get(key$277); if (resource) break; var state = { loading: 0, preload: null }; if ( (resource = resourceRoot.querySelector( - getStylesheetSelectorFromKey(key$279) + getStylesheetSelectorFromKey(key$277) )) ) state.loading = 1; @@ -15712,7 +15688,7 @@ function preinit$1(href, options) { "data-precedence": precedence, crossOrigin: options.crossOrigin }; - (options = preloadPropsMap.get(key$279)) && + (options = preloadPropsMap.get(key$277)) && adoptPreloadPropsForStylesheet(href, options); var link = (resource = ( resourceRoot.ownerDocument || resourceRoot @@ -15738,15 +15714,15 @@ function preinit$1(href, options) { count: 1, state: state }; - as.set(key$279, resource); + as.set(key$277, resource); break; case "script": (as = getResourcesFromRoot(resourceRoot).hoistableScripts), - (key$279 = getScriptKey(href)), - (precedence = as.get(key$279)), + (key$277 = getScriptKey(href)), + (precedence = as.get(key$277)), precedence || ((precedence = resourceRoot.querySelector( - "script[async]" + key$279 + "script[async]" + key$277 )), precedence || ((href = { @@ -15755,7 +15731,7 @@ function preinit$1(href, options) { crossOrigin: options.crossOrigin, integrity: options.integrity }), - (options = preloadPropsMap.get(key$279)) && + (options = preloadPropsMap.get(key$277)) && adoptPreloadPropsForScript(href, options), (options = resourceRoot.ownerDocument || resourceRoot), (precedence = options.createElement("script")), @@ -15768,13 +15744,13 @@ function preinit$1(href, options) { count: 1, state: null }), - as.set(key$279, precedence)); + as.set(key$277, precedence)); } else if ("style" === as || "script" === as) if ((resourceRoot = getDocumentForPreloads())) { - key$279 = escapeSelectorAttributeValueInsideDoubleQuotes(href); - precedence = key$279 = - 'link[rel="preload"][as="' + as + '"][href="' + key$279 + '"]'; + key$277 = escapeSelectorAttributeValueInsideDoubleQuotes(href); + precedence = key$277 = + 'link[rel="preload"][as="' + as + '"][href="' + key$277 + '"]'; switch (as) { case "style": precedence = getStyleKey(href); @@ -15791,7 +15767,7 @@ function preinit$1(href, options) { integrity: options.integrity }), preloadPropsMap.set(precedence, href), - null === resourceRoot.querySelector(key$279) && + null === resourceRoot.querySelector(key$277) && ((options = resourceRoot.createElement("link")), setInitialProperties(options, "link", href), markNodeAsHoistable(options), @@ -15824,17 +15800,17 @@ function getResource(type, currentProps, pendingProps) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$288 = getResourcesFromRoot(currentProps).hoistableStyles, - resource$289 = styles$288.get(type); - resource$289 || + var styles$286 = getResourcesFromRoot(currentProps).hoistableStyles, + resource$287 = styles$286.get(type); + resource$287 || ((currentProps = currentProps.ownerDocument || currentProps), - (resource$289 = { + (resource$287 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$288.set(type, resource$289), + styles$286.set(type, resource$287), preloadPropsMap.has(type) || preloadStylesheet( currentProps, @@ -15849,9 +15825,9 @@ function getResource(type, currentProps, pendingProps) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$289.state + resource$287.state )); - return resource$289; + return resource$287; } return null; case "script": @@ -15923,36 +15899,36 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = key); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$294 = hoistableRoot.querySelector( + var instance$292 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$294) + if (instance$292) return ( - (resource.instance = instance$294), - markNodeAsHoistable(instance$294), - instance$294 + (resource.instance = instance$292), + markNodeAsHoistable(instance$292), + instance$292 ); key = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(key, styleProps); - instance$294 = ( + instance$292 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$294); - var linkInstance = instance$294; + markNodeAsHoistable(instance$292); + var linkInstance = instance$292; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$294, "link", key); + setInitialProperties(instance$292, "link", key); resource.state.loading |= 4; - insertStylesheet(instance$294, props.precedence, hoistableRoot); - return (resource.instance = instance$294); + insertStylesheet(instance$292, props.precedence, hoistableRoot); + return (resource.instance = instance$292); case "script": - instance$294 = getScriptKey(props.src); + instance$292 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - "script[async]" + instance$294 + "script[async]" + instance$292 )) ) return ( @@ -15961,7 +15937,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); key = props; - if ((styleProps = preloadPropsMap.get(instance$294))) + if ((styleProps = preloadPropsMap.get(instance$292))) (key = assign({}, props)), adoptPreloadPropsForScript(key, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16331,17 +16307,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1844 = { +var devToolsConfig$jscomp$inline_1842 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-edf301ed", + version: "18.3.0-www-modern-1cb1de96", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2220 = { - bundleType: devToolsConfig$jscomp$inline_1844.bundleType, - version: devToolsConfig$jscomp$inline_1844.version, - rendererPackageName: devToolsConfig$jscomp$inline_1844.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1844.rendererConfig, +var internals$jscomp$inline_2218 = { + bundleType: devToolsConfig$jscomp$inline_1842.bundleType, + version: devToolsConfig$jscomp$inline_1842.version, + rendererPackageName: devToolsConfig$jscomp$inline_1842.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1842.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16358,26 +16334,26 @@ var internals$jscomp$inline_2220 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1844.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1842.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-edf301ed" + reconcilerVersion: "18.3.0-www-modern-1cb1de96" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2221 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2219 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2221.isDisabled && - hook$jscomp$inline_2221.supportsFiber + !hook$jscomp$inline_2219.isDisabled && + hook$jscomp$inline_2219.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2221.inject( - internals$jscomp$inline_2220 + (rendererID = hook$jscomp$inline_2219.inject( + internals$jscomp$inline_2218 )), - (injectedHook = hook$jscomp$inline_2221); + (injectedHook = hook$jscomp$inline_2219); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; @@ -16684,4 +16660,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-edf301ed"; +exports.version = "18.3.0-www-modern-1cb1de96"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index e345f93026..724cb44ed1 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -24355,7 +24355,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-edf301ed"; +var ReactVersion = "18.3.0-www-modern-1cb1de96"; // Might add PROFILE later.