From de5b760022419a1f59f52b320f591b56e1efb9ef Mon Sep 17 00:00:00 2001 From: acdlite Date: Wed, 7 Feb 2024 00:01:39 +0000 Subject: [PATCH] jsx(): Inline reserved prop checks (#28262) The JSX runtime (both the new one and the classic createElement runtime) check for reserved props like `key` and `ref` by doing a lookup in a plain object map with `hasOwnProperty`. There are only a few reserved props so this inlines the checks instead. DiffTrain build for [1beb94133a93a433669a893aef02dd5afec07394](https://github.com/facebook/react/commit/1beb94133a93a433669a893aef02dd5afec07394) --- .../facebook-www/JSXDEVRuntime-dev.classic.js | 13 +++---- .../facebook-www/JSXDEVRuntime-dev.modern.js | 13 +++---- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/React-dev.classic.js | 35 +++++++++---------- compiled/facebook-www/React-dev.modern.js | 35 +++++++++---------- compiled/facebook-www/React-prod.classic.js | 23 +++++++----- compiled/facebook-www/React-prod.modern.js | 23 +++++++----- .../facebook-www/React-profiling.classic.js | 23 +++++++----- .../facebook-www/React-profiling.modern.js | 23 +++++++----- .../ReactDOMTesting-dev.classic.js | 2 +- .../ReactDOMTesting-prod.classic.js | 6 ++-- .../facebook-www/ReactServer-dev.modern.js | 35 +++++++++---------- .../facebook-www/ReactServer-prod.modern.js | 23 +++++++----- 13 files changed, 138 insertions(+), 118 deletions(-) diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js index eaa0685b36409..6cdb18be0b1eb 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js @@ -898,12 +898,6 @@ if (__DEV__) { } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; var specialPropKeyWarningShown; var specialPropRefWarningShown; var didWarnAboutStringRefs; @@ -1134,8 +1128,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { props[propName] = config[propName]; } diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js index 2c32518168680..ee8066ae60ceb 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js @@ -898,12 +898,6 @@ if (__DEV__) { } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; var specialPropKeyWarningShown; var specialPropRefWarningShown; var didWarnAboutStringRefs; @@ -1134,8 +1128,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { props[propName] = config[propName]; } diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 4e333784a9d38..ab6da78d6c9bb 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -0d11563b4a96e0f4f2361cdf7375b12375688163 +1beb94133a93a433669a893aef02dd5afec07394 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index e20321ebfc755..d30a8012691ba 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -24,7 +24,7 @@ if (__DEV__) { ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } - var ReactVersion = "18.3.0-www-classic-12d69e63"; + var ReactVersion = "18.3.0-www-classic-715010bd"; // ATTENTION // When adding new symbols to this file, @@ -610,12 +610,6 @@ if (__DEV__) { current: null }; - var RESERVED_PROPS$1 = { - key: true, - ref: true, - __self: true, - __source: true - }; var specialPropKeyWarningShown$1, specialPropRefWarningShown$1, didWarnAboutStringRefs$1; @@ -839,8 +833,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { props[propName] = config[propName]; } @@ -969,8 +966,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props @@ -1678,12 +1678,6 @@ if (__DEV__) { } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; var specialPropKeyWarningShown; var specialPropRefWarningShown; var didWarnAboutStringRefs; @@ -1914,8 +1908,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { props[propName] = config[propName]; } diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 5d0d88f03a013..b8404f68e092a 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -24,7 +24,7 @@ if (__DEV__) { ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } - var ReactVersion = "18.3.0-www-modern-3d181aee"; + var ReactVersion = "18.3.0-www-modern-20a278f7"; // ATTENTION // When adding new symbols to this file, @@ -610,12 +610,6 @@ if (__DEV__) { current: null }; - var RESERVED_PROPS$1 = { - key: true, - ref: true, - __self: true, - __source: true - }; var specialPropKeyWarningShown$1, specialPropRefWarningShown$1, didWarnAboutStringRefs$1; @@ -839,8 +833,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { props[propName] = config[propName]; } @@ -969,8 +966,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props @@ -1678,12 +1678,6 @@ if (__DEV__) { } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; var specialPropKeyWarningShown; var specialPropRefWarningShown; var didWarnAboutStringRefs; @@ -1914,8 +1908,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { props[propName] = config[propName]; } diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 7599a9db4f368..0db0a45c98381 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -85,8 +85,7 @@ var isArrayImpl = Array.isArray, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, hasOwnProperty = Object.prototype.hasOwnProperty, - ReactCurrentOwner$1 = { current: null }, - RESERVED_PROPS$1 = { key: !0, ref: !0, __self: !0, __source: !0 }; + ReactCurrentOwner$1 = { current: null }; function createElement$1(type, config, children) { var propName, props = {}, @@ -97,7 +96,10 @@ function createElement$1(type, config, children) { void 0 !== config.key && (key = "" + config.key), config)) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; @@ -145,8 +147,7 @@ var ReactCurrentDispatcher = { current: null }, ReactCurrentBatchConfig: ReactCurrentBatchConfig, ReactCurrentOwner: ReactCurrentOwner$1 }, - ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, - RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 }; + ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function jsx$1(type, config, maybeKey) { var propName, props = {}, @@ -157,7 +158,10 @@ function jsx$1(type, config, maybeKey) { void 0 !== config.ref && (ref = config.ref); for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) @@ -382,7 +386,10 @@ exports.cloneElement = function (element, config, children) { var defaultProps = element.type.defaultProps; for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = void 0 === config[propName] && void 0 !== defaultProps ? defaultProps[propName] @@ -570,4 +577,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-classic-b2425be8"; +exports.version = "18.3.0-www-classic-a3f180e9"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 0667e50db9748..4892a0614eb05 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -84,8 +84,7 @@ var isArrayImpl = Array.isArray, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, hasOwnProperty = Object.prototype.hasOwnProperty, - ReactCurrentOwner$1 = { current: null }, - RESERVED_PROPS$1 = { key: !0, ref: !0, __self: !0, __source: !0 }; + ReactCurrentOwner$1 = { current: null }; function cloneAndReplaceKey(oldElement, newKey) { return { $$typeof: REACT_ELEMENT_TYPE, @@ -112,8 +111,7 @@ var ReactCurrentDispatcher = { current: null }, ReactCurrentBatchConfig: ReactCurrentBatchConfig, ReactCurrentOwner: ReactCurrentOwner$1 }, - ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, - RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 }; + ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function jsx$1(type, config, maybeKey) { var propName, props = {}, @@ -124,7 +122,10 @@ function jsx$1(type, config, maybeKey) { void 0 !== config.ref && (ref = config.ref); for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) @@ -349,7 +350,10 @@ exports.cloneElement = function (element, config, children) { var defaultProps = element.type.defaultProps; for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = void 0 === config[propName] && void 0 !== defaultProps ? defaultProps[propName] @@ -396,7 +400,10 @@ exports.createElement = function (type, config, children) { void 0 !== config.key && (key = "" + config.key), config)) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; @@ -562,4 +569,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-modern-1e4811e0"; +exports.version = "18.3.0-www-modern-97ff7924"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index f9ffe8e1ca7e7..3bdcc4259cad3 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -89,8 +89,7 @@ var isArrayImpl = Array.isArray, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, hasOwnProperty = Object.prototype.hasOwnProperty, - ReactCurrentOwner$1 = { current: null }, - RESERVED_PROPS$1 = { key: !0, ref: !0, __self: !0, __source: !0 }; + ReactCurrentOwner$1 = { current: null }; function createElement$1(type, config, children) { var propName, props = {}, @@ -101,7 +100,10 @@ function createElement$1(type, config, children) { void 0 !== config.key && (key = "" + config.key), config)) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; @@ -149,8 +151,7 @@ var ReactCurrentDispatcher = { current: null }, ReactCurrentBatchConfig: ReactCurrentBatchConfig, ReactCurrentOwner: ReactCurrentOwner$1 }, - ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, - RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 }; + ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function jsx$1(type, config, maybeKey) { var propName, props = {}, @@ -161,7 +162,10 @@ function jsx$1(type, config, maybeKey) { void 0 !== config.ref && (ref = config.ref); for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) @@ -386,7 +390,10 @@ exports.cloneElement = function (element, config, children) { var defaultProps = element.type.defaultProps; for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = void 0 === config[propName] && void 0 !== defaultProps ? defaultProps[propName] @@ -574,7 +581,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-classic-65d179d4"; +exports.version = "18.3.0-www-classic-a4e84017"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index 46be190a41459..396b3bed610b1 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -88,8 +88,7 @@ var isArrayImpl = Array.isArray, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, hasOwnProperty = Object.prototype.hasOwnProperty, - ReactCurrentOwner$1 = { current: null }, - RESERVED_PROPS$1 = { key: !0, ref: !0, __self: !0, __source: !0 }; + ReactCurrentOwner$1 = { current: null }; function cloneAndReplaceKey(oldElement, newKey) { return { $$typeof: REACT_ELEMENT_TYPE, @@ -116,8 +115,7 @@ var ReactCurrentDispatcher = { current: null }, ReactCurrentBatchConfig: ReactCurrentBatchConfig, ReactCurrentOwner: ReactCurrentOwner$1 }, - ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, - RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 }; + ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function jsx$1(type, config, maybeKey) { var propName, props = {}, @@ -128,7 +126,10 @@ function jsx$1(type, config, maybeKey) { void 0 !== config.ref && (ref = config.ref); for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) @@ -353,7 +354,10 @@ exports.cloneElement = function (element, config, children) { var defaultProps = element.type.defaultProps; for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = void 0 === config[propName] && void 0 !== defaultProps ? defaultProps[propName] @@ -400,7 +404,10 @@ exports.createElement = function (type, config, children) { void 0 !== config.key && (key = "" + config.key), config)) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; @@ -566,7 +573,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-modern-751434a6"; +exports.version = "18.3.0-www-modern-4076c0c0"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 4673f77101671..6dc8ea84c7755 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -36374,7 +36374,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-www-classic-b2425be8"; + var ReactVersion = "18.3.0-www-classic-a3f180e9"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 3d87c9573c22b..09e92a72b2db3 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -17490,7 +17490,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1828 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-65d179d4", + version: "18.3.0-www-classic-a4e84017", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2197 = { @@ -17520,7 +17520,7 @@ var internals$jscomp$inline_2197 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-65d179d4" + reconcilerVersion: "18.3.0-www-classic-a4e84017" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2198 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -18021,4 +18021,4 @@ exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); throw Error(formatProdErrorMessage(248)); }; -exports.version = "18.3.0-www-classic-65d179d4"; +exports.version = "18.3.0-www-classic-a4e84017"; diff --git a/compiled/facebook-www/ReactServer-dev.modern.js b/compiled/facebook-www/ReactServer-dev.modern.js index 5dc3fb472987c..90370f1d25b0a 100644 --- a/compiled/facebook-www/ReactServer-dev.modern.js +++ b/compiled/facebook-www/ReactServer-dev.modern.js @@ -402,12 +402,6 @@ if (__DEV__) { // $FlowFixMe[method-unbinding] var hasOwnProperty = Object.prototype.hasOwnProperty; - var RESERVED_PROPS$1 = { - key: true, - ref: true, - __self: true, - __source: true - }; var specialPropKeyWarningShown$1, specialPropRefWarningShown$1, didWarnAboutStringRefs$1; @@ -631,8 +625,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { props[propName] = config[propName]; } @@ -761,8 +758,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props @@ -1391,12 +1391,6 @@ if (__DEV__) { } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; var specialPropKeyWarningShown; var specialPropRefWarningShown; var didWarnAboutStringRefs; @@ -1627,8 +1621,11 @@ if (__DEV__) { for (propName in config) { if ( - hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) + hasOwnProperty.call(config, propName) && // Skip over reserved prop names + propName !== "key" && // TODO: These will no longer be reserved in the next major + propName !== "ref" && + propName !== "__self" && + propName !== "__source" ) { props[propName] = config[propName]; } @@ -2874,7 +2871,7 @@ if (__DEV__) { console["error"](error); }; - var ReactVersion = "18.3.0-www-modern-303a3284"; + var ReactVersion = "18.3.0-www-modern-e6ecad30"; // Patch fetch var Children = { diff --git a/compiled/facebook-www/ReactServer-prod.modern.js b/compiled/facebook-www/ReactServer-prod.modern.js index a08e6e3bc033f..bb9aeafcf3192 100644 --- a/compiled/facebook-www/ReactServer-prod.modern.js +++ b/compiled/facebook-www/ReactServer-prod.modern.js @@ -56,8 +56,7 @@ function getIteratorFn(maybeIterable) { maybeIterable["@@iterator"]; return "function" === typeof maybeIterable ? maybeIterable : null; } -var hasOwnProperty = Object.prototype.hasOwnProperty, - RESERVED_PROPS$1 = { key: !0, ref: !0, __self: !0, __source: !0 }; +var hasOwnProperty = Object.prototype.hasOwnProperty; function cloneAndReplaceKey(oldElement, newKey) { return { $$typeof: REACT_ELEMENT_TYPE, @@ -75,8 +74,7 @@ function isValidElement(object) { object.$$typeof === REACT_ELEMENT_TYPE ); } -var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, - RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 }; +var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function jsx$1(type, config, maybeKey) { var propName, props = {}, @@ -87,7 +85,10 @@ function jsx$1(type, config, maybeKey) { void 0 !== config.ref && (ref = config.ref); for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) @@ -345,7 +346,10 @@ exports.cloneElement = function (element, config, children) { var defaultProps = element.type.defaultProps; for (propName in config) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = void 0 === config[propName] && void 0 !== defaultProps ? defaultProps[propName] @@ -377,7 +381,10 @@ exports.createElement = function (type, config, children) { void 0 !== config.key && (key = "" + config.key), config)) hasOwnProperty.call(config, propName) && - !RESERVED_PROPS$1.hasOwnProperty(propName) && + "key" !== propName && + "ref" !== propName && + "__self" !== propName && + "__source" !== propName && (props[propName] = config[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; @@ -468,4 +475,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactCurrentDispatcher.current.useMemo(create, deps); }; -exports.version = "18.3.0-www-modern-6a0476d6"; +exports.version = "18.3.0-www-modern-48d2dc77";