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.
This commit is contained in:
acdlite
2024-02-07 01:07:36 +00:00
parent 1cff685212
commit fcad6372e2
11 changed files with 36 additions and 40 deletions
@@ -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.
@@ -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__;
@@ -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__;
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b24db7b649efc008c0c89e90dba4877a>>
* @generated SignedSource<<f1fec494d1bdfb72e5edd3dbbb0e62a3>>
*/
"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];
}
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4e6cfb0b86828f5be0c6c8e34f4fdb7a>>
* @generated SignedSource<<af1d2eacbefd00d9c1bfd4c752fee8c4>>
*/
"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];
}
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d95535f2595d28064d67106ad7fa3c58>>
* @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))
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d95535f2595d28064d67106ad7fa3c58>>
* @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))
@@ -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];
}
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<ba8018b7d9a5dbed3051133347c5987d>>
* @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";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<094b3884e2648a1b05433f5d2d2084cc>>
* @generated SignedSource<<c4b81159126f46299b7693c7415c0aec>>
*/
"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 &&
@@ -1 +1 @@
f07ac1e2680a26c5b3bf9c651d62c792de71d46d
91caa96e4261704d42333f5e02ba32d870379fc4