From fcad6372e24e9624c4898e2b15ffcbb877afb964 Mon Sep 17 00:00:00 2001 From: acdlite Date: Wed, 7 Feb 2024 01:07:36 +0000 Subject: [PATCH] jsx(): Treat __self and __source as normal props (#28257) These used to be reserved props because the classic React.createElement runtime passed this data as props, whereas the jsxDEV() runtime passes them as separate arguments. This brings us incrementally closer to being able to pass the props object directly through to React instead of cloning a subset into a new object. The React.createElement runtime is unaffected. DiffTrain build for commit https://github.com/facebook/react/commit/91caa96e4261704d42333f5e02ba32d870379fc4. --- .../cjs/ReactTestRenderer-dev.js | 2 +- .../cjs/ReactTestRenderer-prod.js | 4 +-- .../cjs/ReactTestRenderer-profiling.js | 4 +-- .../vendor/react/cjs/JSXDEVRuntime-dev.js | 8 ++---- .../vendor/react/cjs/JSXRuntime-dev.js | 8 ++---- .../vendor/react/cjs/JSXRuntime-prod.js | 4 +-- .../vendor/react/cjs/JSXRuntime-profiling.js | 4 +-- .../RKJSModules/vendor/react/cjs/React-dev.js | 28 ++++++++++++------- .../vendor/react/cjs/React-prod.js | 6 ++-- .../vendor/react/cjs/React-profiling.js | 6 ++-- .../Libraries/Renderer/REVISION | 2 +- 11 files changed, 36 insertions(+), 40 deletions(-) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js index e3c8a0db6c..6368725d2e 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -25725,7 +25725,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-canary-f07ac1e26-20240206"; + var ReactVersion = "18.3.0-canary-91caa96e4-20240206"; // Might add PROFILE later. diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js index 3c6754fb73..97dabf4e83 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -9157,7 +9157,7 @@ var devToolsConfig$jscomp$inline_1012 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-f07ac1e26-20240206", + version: "18.3.0-canary-91caa96e4-20240206", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1190 = { @@ -9188,7 +9188,7 @@ var internals$jscomp$inline_1190 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-f07ac1e26-20240206" + reconcilerVersion: "18.3.0-canary-91caa96e4-20240206" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1191 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 64163df22d..8ffcec9a6e 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -9585,7 +9585,7 @@ var devToolsConfig$jscomp$inline_1054 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-f07ac1e26-20240206", + version: "18.3.0-canary-91caa96e4-20240206", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1231 = { @@ -9616,7 +9616,7 @@ var internals$jscomp$inline_1231 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-f07ac1e26-20240206" + reconcilerVersion: "18.3.0-canary-91caa96e4-20240206" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1232 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXDEVRuntime-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXDEVRuntime-dev.js index 10931bbae6..e38b3293a8 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXDEVRuntime-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXDEVRuntime-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -794,10 +794,8 @@ if (__DEV__) { for (propName in config) { if ( 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" + propName !== "key" && // TODO: `ref` will no longer be reserved in the next major + propName !== "ref" ) { props[propName] = config[propName]; } diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-dev.js index 67778ca3d6..4400d2ccbd 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<4e6cfb0b86828f5be0c6c8e34f4fdb7a>> + * @generated SignedSource<> */ "use strict"; @@ -794,10 +794,8 @@ if (__DEV__) { for (propName in config) { if ( 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" + propName !== "key" && // TODO: `ref` will no longer be reserved in the next major + propName !== "ref" ) { props[propName] = config[propName]; } diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-prod.js index b84a6bf3c9..df25b67452 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<9119a43311c6e3bbc52baa1c4dfff7c0>> */ "use strict"; @@ -29,8 +29,6 @@ function jsx$1(type, config, maybeKey) { hasOwnProperty.call(config, propName) && "key" !== propName && "ref" !== propName && - "__self" !== propName && - "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-profiling.js index b84a6bf3c9..df25b67452 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<9119a43311c6e3bbc52baa1c4dfff7c0>> */ "use strict"; @@ -29,8 +29,6 @@ function jsx$1(type, config, maybeKey) { hasOwnProperty.call(config, propName) && "key" !== propName && "ref" !== propName && - "__self" !== propName && - "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js index e0cf0f460f..88e0a84e0d 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<593daac7ac70a57cfd731bbfdac659fc>> + * @generated SignedSource<<41ebcac0959dc7c1f568b21dae3e2874>> */ "use strict"; @@ -24,7 +24,7 @@ if (__DEV__) { ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } - var ReactVersion = "18.3.0-canary-f07ac1e26-20240206"; + var ReactVersion = "18.3.0-canary-91caa96e4-20240206"; // ATTENTION // When adding new symbols to this file, @@ -903,8 +903,13 @@ if (__DEV__) { for (propName in config) { if ( 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 !== "key" && // TODO: `ref` will no longer be reserved in the next major + propName !== "ref" && // ...and maybe these, too, though we currently rely on them for + // warnings and debug information in dev. Need to decide if we're OK + // with dropping them. In the jsx() runtime it's not an issue because + // the data gets passed as separate arguments instead of props, but + // it would be nice to stop relying on them entirely so we can drop + // them from the internal Fiber field. propName !== "__self" && propName !== "__source" ) { @@ -1036,8 +1041,13 @@ if (__DEV__) { for (propName in config) { if ( 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 !== "key" && // TODO: `ref` will no longer be reserved in the next major + propName !== "ref" && // ...and maybe these, too, though we currently rely on them for + // warnings and debug information in dev. Need to decide if we're OK + // with dropping them. In the jsx() runtime it's not an issue because + // the data gets passed as separate arguments instead of props, but + // it would be nice to stop relying on them entirely so we can drop + // them from the internal Fiber field. propName !== "__self" && propName !== "__source" ) { @@ -1583,10 +1593,8 @@ if (__DEV__) { for (propName in config) { if ( 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" + propName !== "key" && // TODO: `ref` will no longer be reserved in the next major + propName !== "ref" ) { props[propName] = config[propName]; } diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js index e250e57804..ec048415ac 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<1ef1b2a956caed553f31e9810e8c25be>> */ "use strict"; @@ -157,8 +157,6 @@ function jsx$1(type, config, maybeKey) { hasOwnProperty.call(config, propName) && "key" !== propName && "ref" !== propName && - "__self" !== propName && - "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) @@ -550,4 +548,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-f07ac1e26-20240206"; +exports.version = "18.3.0-canary-91caa96e4-20240206"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js index e87c14fd0b..a98251fcca 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<094b3884e2648a1b05433f5d2d2084cc>> + * @generated SignedSource<> */ "use strict"; @@ -125,8 +125,6 @@ function jsx$1(type, config, maybeKey) { hasOwnProperty.call(config, propName) && "key" !== propName && "ref" !== propName && - "__self" !== propName && - "__source" !== propName && (props[propName] = config[propName]); if (type && type.defaultProps) for (propName in ((config = type.defaultProps), config)) @@ -546,7 +544,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-f07ac1e26-20240206"; +exports.version = "18.3.0-canary-91caa96e4-20240206"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index d50332e38b..b9cd37f344 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -f07ac1e2680a26c5b3bf9c651d62c792de71d46d +91caa96e4261704d42333f5e02ba32d870379fc4