Skip to content

Commit eed58d4

Browse files
committed
Remove enableRefAsProp feature flag (#30346)
The flag is fully rolled out. DiffTrain build for [07aa494](07aa494)
1 parent effe6b5 commit eed58d4

39 files changed

+1520
-1779
lines changed

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

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -509,16 +509,16 @@ __DEV__ &&
509509
componentName = this.props.ref;
510510
return void 0 !== componentName ? componentName : null;
511511
}
512-
function ReactElement(type, key, _ref, self, source, owner, props) {
513-
_ref = props.ref;
512+
function ReactElement(type, key, self, source, owner, props) {
513+
self = props.ref;
514514
type = {
515515
$$typeof: REACT_ELEMENT_TYPE,
516516
type: type,
517517
key: key,
518518
props: props,
519519
_owner: owner
520520
};
521-
null !== (void 0 !== _ref ? _ref : null)
521+
null !== (void 0 !== self ? self : null)
522522
? Object.defineProperty(type, "ref", {
523523
enumerable: !1,
524524
get: elementRefGetterWithDeprecationWarning
@@ -644,8 +644,8 @@ __DEV__ &&
644644
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
645645
hasValidKey(config) &&
646646
(checkKeyStringCoercion(config.key), (children = "" + config.key));
647-
hasValidRef(config) &&
648-
(disableStringRefs ||
647+
disableStringRefs ||
648+
(hasValidRef(config) &&
649649
warnIfStringRefCannotBeAutoConverted(config, self));
650650
if (
651651
(!enableFastJSXWithoutStringRefs && "ref" in config) ||
@@ -669,20 +669,13 @@ __DEV__ &&
669669
(maybeKey[_propName2] = config[_propName2]);
670670
}
671671
children &&
672-
((_propName2 =
672+
defineKeyPropWarningGetter(
673+
maybeKey,
673674
"function" === typeof type
674675
? type.displayName || type.name || "Unknown"
675-
: type),
676-
children && defineKeyPropWarningGetter(maybeKey, _propName2));
677-
return ReactElement(
678-
type,
679-
children,
680-
null,
681-
self,
682-
source,
683-
getOwner(),
684-
maybeKey
685-
);
676+
: type
677+
);
678+
return ReactElement(type, children, self, source, getOwner(), maybeKey);
686679
}
687680
function validateChildKeys(node, parentType) {
688681
if (

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

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -506,16 +506,16 @@ __DEV__ &&
506506
componentName = this.props.ref;
507507
return void 0 !== componentName ? componentName : null;
508508
}
509-
function ReactElement(type, key, _ref, self, source, owner, props) {
510-
_ref = props.ref;
509+
function ReactElement(type, key, self, source, owner, props) {
510+
self = props.ref;
511511
type = {
512512
$$typeof: REACT_ELEMENT_TYPE,
513513
type: type,
514514
key: key,
515515
props: props,
516516
_owner: owner
517517
};
518-
null !== (void 0 !== _ref ? _ref : null)
518+
null !== (void 0 !== self ? self : null)
519519
? Object.defineProperty(type, "ref", {
520520
enumerable: !1,
521521
get: elementRefGetterWithDeprecationWarning
@@ -641,8 +641,8 @@ __DEV__ &&
641641
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
642642
hasValidKey(config) &&
643643
(checkKeyStringCoercion(config.key), (children = "" + config.key));
644-
hasValidRef(config) &&
645-
(disableStringRefs ||
644+
disableStringRefs ||
645+
(hasValidRef(config) &&
646646
warnIfStringRefCannotBeAutoConverted(config, self));
647647
if (
648648
(!enableFastJSXWithoutStringRefs && "ref" in config) ||
@@ -666,20 +666,13 @@ __DEV__ &&
666666
(maybeKey[_propName2] = config[_propName2]);
667667
}
668668
children &&
669-
((_propName2 =
669+
defineKeyPropWarningGetter(
670+
maybeKey,
670671
"function" === typeof type
671672
? type.displayName || type.name || "Unknown"
672-
: type),
673-
children && defineKeyPropWarningGetter(maybeKey, _propName2));
674-
return ReactElement(
675-
type,
676-
children,
677-
null,
678-
self,
679-
source,
680-
getOwner(),
681-
maybeKey
682-
);
673+
: type
674+
);
675+
return ReactElement(type, children, self, source, getOwner(), maybeKey);
683676
}
684677
function validateChildKeys(node, parentType) {
685678
if (

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ea3ac586693014e882655728fc8396ecb1d6cf6e
1+
07aa494432e97f63fca9faf2fad6f76fead31063
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ea3ac586693014e882655728fc8396ecb1d6cf6e
1+
07aa494432e97f63fca9faf2fad6f76fead31063

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

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -596,16 +596,16 @@ __DEV__ &&
596596
componentName = this.props.ref;
597597
return void 0 !== componentName ? componentName : null;
598598
}
599-
function ReactElement(type, key, _ref, self, source, owner, props) {
600-
_ref = props.ref;
599+
function ReactElement(type, key, self, source, owner, props) {
600+
self = props.ref;
601601
type = {
602602
$$typeof: REACT_ELEMENT_TYPE,
603603
type: type,
604604
key: key,
605605
props: props,
606606
_owner: owner
607607
};
608-
null !== (void 0 !== _ref ? _ref : null)
608+
null !== (void 0 !== self ? self : null)
609609
? Object.defineProperty(type, "ref", {
610610
enumerable: !1,
611611
get: elementRefGetterWithDeprecationWarning
@@ -706,8 +706,8 @@ __DEV__ &&
706706
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
707707
hasValidKey(config) &&
708708
(checkKeyStringCoercion(config.key), (children = "" + config.key));
709-
hasValidRef(config) &&
710-
(disableStringRefs ||
709+
disableStringRefs ||
710+
(hasValidRef(config) &&
711711
warnIfStringRefCannotBeAutoConverted(config, self));
712712
if (
713713
(!enableFastJSXWithoutStringRefs && "ref" in config) ||
@@ -731,26 +731,18 @@ __DEV__ &&
731731
(maybeKey[_propName2] = config[_propName2]);
732732
}
733733
children &&
734-
((_propName2 =
734+
defineKeyPropWarningGetter(
735+
maybeKey,
735736
"function" === typeof type
736737
? type.displayName || type.name || "Unknown"
737-
: type),
738-
children && defineKeyPropWarningGetter(maybeKey, _propName2));
739-
return ReactElement(
740-
type,
741-
children,
742-
null,
743-
self,
744-
source,
745-
getOwner(),
746-
maybeKey
747-
);
738+
: type
739+
);
740+
return ReactElement(type, children, self, source, getOwner(), maybeKey);
748741
}
749742
function cloneAndReplaceKey(oldElement, newKey) {
750743
newKey = ReactElement(
751744
oldElement.type,
752745
newKey,
753-
null,
754746
void 0,
755747
void 0,
756748
oldElement._owner,
@@ -1601,15 +1593,7 @@ __DEV__ &&
16011593
for (var i = 0; i < propName; i++) defaultProps[i] = arguments[i + 2];
16021594
props.children = defaultProps;
16031595
}
1604-
props = ReactElement(
1605-
element.type,
1606-
key,
1607-
null,
1608-
void 0,
1609-
void 0,
1610-
owner,
1611-
props
1612-
);
1596+
props = ReactElement(element.type, key, void 0, void 0, owner, props);
16131597
for (key = 2; key < arguments.length; key++)
16141598
validateChildKeys(arguments[key], props.type);
16151599
return props;
@@ -1716,6 +1700,7 @@ __DEV__ &&
17161700
i
17171701
);
17181702
}
1703+
var propName;
17191704
i = {};
17201705
typeString = null;
17211706
if (null != config)
@@ -1726,8 +1711,8 @@ __DEV__ &&
17261711
warn(
17271712
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
17281713
)),
1729-
hasValidRef(config) &&
1730-
(disableStringRefs ||
1714+
disableStringRefs ||
1715+
(hasValidRef(config) &&
17311716
warnIfStringRefCannotBeAutoConverted(config, config.__self)),
17321717
hasValidKey(config) &&
17331718
(checkKeyStringCoercion(config.key), (typeString = "" + config.key)),
@@ -1754,22 +1739,14 @@ __DEV__ &&
17541739
if (type && type.defaultProps)
17551740
for (propName in ((childrenLength = type.defaultProps), childrenLength))
17561741
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1757-
if (typeString) {
1758-
var propName =
1742+
typeString &&
1743+
defineKeyPropWarningGetter(
1744+
i,
17591745
"function" === typeof type
17601746
? type.displayName || type.name || "Unknown"
1761-
: type;
1762-
typeString && defineKeyPropWarningGetter(i, propName);
1763-
}
1764-
return ReactElement(
1765-
type,
1766-
typeString,
1767-
null,
1768-
void 0,
1769-
void 0,
1770-
getOwner(),
1771-
i
1772-
);
1747+
: type
1748+
);
1749+
return ReactElement(type, typeString, void 0, void 0, getOwner(), i);
17731750
};
17741751
exports.createRef = function () {
17751752
var refObject = { current: null };
@@ -2021,7 +1998,7 @@ __DEV__ &&
20211998
exports.useTransition = function () {
20221999
return resolveDispatcher().useTransition();
20232000
};
2024-
exports.version = "19.0.0-www-classic-ea3ac586-20241031";
2001+
exports.version = "19.0.0-www-classic-07aa4944-20241104";
20252002
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20262003
"function" ===
20272004
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -593,16 +593,16 @@ __DEV__ &&
593593
componentName = this.props.ref;
594594
return void 0 !== componentName ? componentName : null;
595595
}
596-
function ReactElement(type, key, _ref, self, source, owner, props) {
597-
_ref = props.ref;
596+
function ReactElement(type, key, self, source, owner, props) {
597+
self = props.ref;
598598
type = {
599599
$$typeof: REACT_ELEMENT_TYPE,
600600
type: type,
601601
key: key,
602602
props: props,
603603
_owner: owner
604604
};
605-
null !== (void 0 !== _ref ? _ref : null)
605+
null !== (void 0 !== self ? self : null)
606606
? Object.defineProperty(type, "ref", {
607607
enumerable: !1,
608608
get: elementRefGetterWithDeprecationWarning
@@ -703,8 +703,8 @@ __DEV__ &&
703703
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
704704
hasValidKey(config) &&
705705
(checkKeyStringCoercion(config.key), (children = "" + config.key));
706-
hasValidRef(config) &&
707-
(disableStringRefs ||
706+
disableStringRefs ||
707+
(hasValidRef(config) &&
708708
warnIfStringRefCannotBeAutoConverted(config, self));
709709
if (
710710
(!enableFastJSXWithoutStringRefs && "ref" in config) ||
@@ -728,26 +728,18 @@ __DEV__ &&
728728
(maybeKey[_propName2] = config[_propName2]);
729729
}
730730
children &&
731-
((_propName2 =
731+
defineKeyPropWarningGetter(
732+
maybeKey,
732733
"function" === typeof type
733734
? type.displayName || type.name || "Unknown"
734-
: type),
735-
children && defineKeyPropWarningGetter(maybeKey, _propName2));
736-
return ReactElement(
737-
type,
738-
children,
739-
null,
740-
self,
741-
source,
742-
getOwner(),
743-
maybeKey
744-
);
735+
: type
736+
);
737+
return ReactElement(type, children, self, source, getOwner(), maybeKey);
745738
}
746739
function cloneAndReplaceKey(oldElement, newKey) {
747740
newKey = ReactElement(
748741
oldElement.type,
749742
newKey,
750-
null,
751743
void 0,
752744
void 0,
753745
oldElement._owner,
@@ -1581,15 +1573,7 @@ __DEV__ &&
15811573
for (var i = 0; i < propName; i++) defaultProps[i] = arguments[i + 2];
15821574
props.children = defaultProps;
15831575
}
1584-
props = ReactElement(
1585-
element.type,
1586-
key,
1587-
null,
1588-
void 0,
1589-
void 0,
1590-
owner,
1591-
props
1592-
);
1576+
props = ReactElement(element.type, key, void 0, void 0, owner, props);
15931577
for (key = 2; key < arguments.length; key++)
15941578
validateChildKeys(arguments[key], props.type);
15951579
return props;
@@ -1696,6 +1680,7 @@ __DEV__ &&
16961680
i
16971681
);
16981682
}
1683+
var propName;
16991684
i = {};
17001685
typeString = null;
17011686
if (null != config)
@@ -1706,8 +1691,8 @@ __DEV__ &&
17061691
warn(
17071692
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
17081693
)),
1709-
hasValidRef(config) &&
1710-
(disableStringRefs ||
1694+
disableStringRefs ||
1695+
(hasValidRef(config) &&
17111696
warnIfStringRefCannotBeAutoConverted(config, config.__self)),
17121697
hasValidKey(config) &&
17131698
(checkKeyStringCoercion(config.key), (typeString = "" + config.key)),
@@ -1734,22 +1719,14 @@ __DEV__ &&
17341719
if (type && type.defaultProps)
17351720
for (propName in ((childrenLength = type.defaultProps), childrenLength))
17361721
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1737-
if (typeString) {
1738-
var propName =
1722+
typeString &&
1723+
defineKeyPropWarningGetter(
1724+
i,
17391725
"function" === typeof type
17401726
? type.displayName || type.name || "Unknown"
1741-
: type;
1742-
typeString && defineKeyPropWarningGetter(i, propName);
1743-
}
1744-
return ReactElement(
1745-
type,
1746-
typeString,
1747-
null,
1748-
void 0,
1749-
void 0,
1750-
getOwner(),
1751-
i
1752-
);
1727+
: type
1728+
);
1729+
return ReactElement(type, typeString, void 0, void 0, getOwner(), i);
17531730
};
17541731
exports.createRef = function () {
17551732
var refObject = { current: null };
@@ -2001,7 +1978,7 @@ __DEV__ &&
20011978
exports.useTransition = function () {
20021979
return resolveDispatcher().useTransition();
20031980
};
2004-
exports.version = "19.0.0-www-modern-ea3ac586-20241031";
1981+
exports.version = "19.0.0-www-modern-07aa4944-20241104";
20051982
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20061983
"function" ===
20071984
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)