Skip to content

Commit 126187e

Browse files
committed
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 [91caa96](91caa96)
1 parent 7a01513 commit 126187e

13 files changed

+65
-55
lines changed

compiled/facebook-www/JSXDEVRuntime-dev.classic.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,10 +1129,8 @@ if (__DEV__) {
11291129
for (propName in config) {
11301130
if (
11311131
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
1132-
propName !== "key" && // TODO: These will no longer be reserved in the next major
1133-
propName !== "ref" &&
1134-
propName !== "__self" &&
1135-
propName !== "__source"
1132+
propName !== "key" && // TODO: `ref` will no longer be reserved in the next major
1133+
propName !== "ref"
11361134
) {
11371135
props[propName] = config[propName];
11381136
}

compiled/facebook-www/JSXDEVRuntime-dev.modern.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,10 +1129,8 @@ if (__DEV__) {
11291129
for (propName in config) {
11301130
if (
11311131
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
1132-
propName !== "key" && // TODO: These will no longer be reserved in the next major
1133-
propName !== "ref" &&
1134-
propName !== "__self" &&
1135-
propName !== "__source"
1132+
propName !== "key" && // TODO: `ref` will no longer be reserved in the next major
1133+
propName !== "ref"
11361134
) {
11371135
props[propName] = config[propName];
11381136
}

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f07ac1e2680a26c5b3bf9c651d62c792de71d46d
1+
91caa96e4261704d42333f5e02ba32d870379fc4

compiled/facebook-www/React-dev.classic.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-classic-715010bd";
27+
var ReactVersion = "18.3.0-www-classic-87aadbfe";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -834,8 +834,13 @@ if (__DEV__) {
834834
for (propName in config) {
835835
if (
836836
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
837-
propName !== "key" && // TODO: These will no longer be reserved in the next major
838-
propName !== "ref" &&
837+
propName !== "key" && // TODO: `ref` will no longer be reserved in the next major
838+
propName !== "ref" && // ...and maybe these, too, though we currently rely on them for
839+
// warnings and debug information in dev. Need to decide if we're OK
840+
// with dropping them. In the jsx() runtime it's not an issue because
841+
// the data gets passed as separate arguments instead of props, but
842+
// it would be nice to stop relying on them entirely so we can drop
843+
// them from the internal Fiber field.
839844
propName !== "__self" &&
840845
propName !== "__source"
841846
) {
@@ -967,8 +972,13 @@ if (__DEV__) {
967972
for (propName in config) {
968973
if (
969974
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
970-
propName !== "key" && // TODO: These will no longer be reserved in the next major
971-
propName !== "ref" &&
975+
propName !== "key" && // TODO: `ref` will no longer be reserved in the next major
976+
propName !== "ref" && // ...and maybe these, too, though we currently rely on them for
977+
// warnings and debug information in dev. Need to decide if we're OK
978+
// with dropping them. In the jsx() runtime it's not an issue because
979+
// the data gets passed as separate arguments instead of props, but
980+
// it would be nice to stop relying on them entirely so we can drop
981+
// them from the internal Fiber field.
972982
propName !== "__self" &&
973983
propName !== "__source"
974984
) {
@@ -1909,10 +1919,8 @@ if (__DEV__) {
19091919
for (propName in config) {
19101920
if (
19111921
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
1912-
propName !== "key" && // TODO: These will no longer be reserved in the next major
1913-
propName !== "ref" &&
1914-
propName !== "__self" &&
1915-
propName !== "__source"
1922+
propName !== "key" && // TODO: `ref` will no longer be reserved in the next major
1923+
propName !== "ref"
19161924
) {
19171925
props[propName] = config[propName];
19181926
}

compiled/facebook-www/React-dev.modern.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-modern-20a278f7";
27+
var ReactVersion = "18.3.0-www-modern-fe0a8b28";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -834,8 +834,13 @@ if (__DEV__) {
834834
for (propName in config) {
835835
if (
836836
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
837-
propName !== "key" && // TODO: These will no longer be reserved in the next major
838-
propName !== "ref" &&
837+
propName !== "key" && // TODO: `ref` will no longer be reserved in the next major
838+
propName !== "ref" && // ...and maybe these, too, though we currently rely on them for
839+
// warnings and debug information in dev. Need to decide if we're OK
840+
// with dropping them. In the jsx() runtime it's not an issue because
841+
// the data gets passed as separate arguments instead of props, but
842+
// it would be nice to stop relying on them entirely so we can drop
843+
// them from the internal Fiber field.
839844
propName !== "__self" &&
840845
propName !== "__source"
841846
) {
@@ -967,8 +972,13 @@ if (__DEV__) {
967972
for (propName in config) {
968973
if (
969974
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
970-
propName !== "key" && // TODO: These will no longer be reserved in the next major
971-
propName !== "ref" &&
975+
propName !== "key" && // TODO: `ref` will no longer be reserved in the next major
976+
propName !== "ref" && // ...and maybe these, too, though we currently rely on them for
977+
// warnings and debug information in dev. Need to decide if we're OK
978+
// with dropping them. In the jsx() runtime it's not an issue because
979+
// the data gets passed as separate arguments instead of props, but
980+
// it would be nice to stop relying on them entirely so we can drop
981+
// them from the internal Fiber field.
972982
propName !== "__self" &&
973983
propName !== "__source"
974984
) {
@@ -1909,10 +1919,8 @@ if (__DEV__) {
19091919
for (propName in config) {
19101920
if (
19111921
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
1912-
propName !== "key" && // TODO: These will no longer be reserved in the next major
1913-
propName !== "ref" &&
1914-
propName !== "__self" &&
1915-
propName !== "__source"
1922+
propName !== "key" && // TODO: `ref` will no longer be reserved in the next major
1923+
propName !== "ref"
19161924
) {
19171925
props[propName] = config[propName];
19181926
}

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ function jsx$1(type, config, maybeKey) {
160160
hasOwnProperty.call(config, propName) &&
161161
"key" !== propName &&
162162
"ref" !== propName &&
163-
"__self" !== propName &&
164-
"__source" !== propName &&
165163
(props[propName] = config[propName]);
166164
if (type && type.defaultProps)
167165
for (propName in ((config = type.defaultProps), config))
@@ -577,4 +575,4 @@ exports.useSyncExternalStore = function (
577575
exports.useTransition = function () {
578576
return ReactCurrentDispatcher.current.useTransition();
579577
};
580-
exports.version = "18.3.0-www-classic-a3f180e9";
578+
exports.version = "18.3.0-www-classic-88f429a3";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ function jsx$1(type, config, maybeKey) {
124124
hasOwnProperty.call(config, propName) &&
125125
"key" !== propName &&
126126
"ref" !== propName &&
127-
"__self" !== propName &&
128-
"__source" !== propName &&
129127
(props[propName] = config[propName]);
130128
if (type && type.defaultProps)
131129
for (propName in ((config = type.defaultProps), config))
@@ -569,4 +567,4 @@ exports.useSyncExternalStore = function (
569567
exports.useTransition = function () {
570568
return ReactCurrentDispatcher.current.useTransition();
571569
};
572-
exports.version = "18.3.0-www-modern-97ff7924";
570+
exports.version = "18.3.0-www-modern-8e8077b5";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ function jsx$1(type, config, maybeKey) {
164164
hasOwnProperty.call(config, propName) &&
165165
"key" !== propName &&
166166
"ref" !== propName &&
167-
"__self" !== propName &&
168-
"__source" !== propName &&
169167
(props[propName] = config[propName]);
170168
if (type && type.defaultProps)
171169
for (propName in ((config = type.defaultProps), config))
@@ -581,7 +579,7 @@ exports.useSyncExternalStore = function (
581579
exports.useTransition = function () {
582580
return ReactCurrentDispatcher.current.useTransition();
583581
};
584-
exports.version = "18.3.0-www-classic-a4e84017";
582+
exports.version = "18.3.0-www-classic-5f5e8f54";
585583
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
586584
"function" ===
587585
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ function jsx$1(type, config, maybeKey) {
128128
hasOwnProperty.call(config, propName) &&
129129
"key" !== propName &&
130130
"ref" !== propName &&
131-
"__self" !== propName &&
132-
"__source" !== propName &&
133131
(props[propName] = config[propName]);
134132
if (type && type.defaultProps)
135133
for (propName in ((config = type.defaultProps), config))
@@ -573,7 +571,7 @@ exports.useSyncExternalStore = function (
573571
exports.useTransition = function () {
574572
return ReactCurrentDispatcher.current.useTransition();
575573
};
576-
exports.version = "18.3.0-www-modern-4076c0c0";
574+
exports.version = "18.3.0-www-modern-cc698d7e";
577575
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
578576
"function" ===
579577
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactDOMTesting-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36374,7 +36374,7 @@ if (__DEV__) {
3637436374
return root;
3637536375
}
3637636376

36377-
var ReactVersion = "18.3.0-www-classic-a3f180e9";
36377+
var ReactVersion = "18.3.0-www-classic-88f429a3";
3637836378

3637936379
function createPortal$1(
3638036380
children,

0 commit comments

Comments
 (0)