Skip to content

Commit

Permalink
Remove enableRefAsProp feature flag (#30346)
Browse files Browse the repository at this point in the history
The flag is fully rolled out.

DiffTrain build for [07aa494](07aa494)
  • Loading branch information
kassens committed Nov 4, 2024
1 parent effe6b5 commit eed58d4
Show file tree
Hide file tree
Showing 39 changed files with 1,520 additions and 1,779 deletions.
27 changes: 10 additions & 17 deletions compiled/facebook-www/JSXDEVRuntime-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,16 +509,16 @@ __DEV__ &&
componentName = this.props.ref;
return void 0 !== componentName ? componentName : null;
}
function ReactElement(type, key, _ref, self, source, owner, props) {
_ref = props.ref;
function ReactElement(type, key, self, source, owner, props) {
self = props.ref;
type = {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
props: props,
_owner: owner
};
null !== (void 0 !== _ref ? _ref : null)
null !== (void 0 !== self ? self : null)
? Object.defineProperty(type, "ref", {
enumerable: !1,
get: elementRefGetterWithDeprecationWarning
Expand Down Expand Up @@ -644,8 +644,8 @@ __DEV__ &&
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (children = "" + config.key));
hasValidRef(config) &&
(disableStringRefs ||
disableStringRefs ||
(hasValidRef(config) &&
warnIfStringRefCannotBeAutoConverted(config, self));
if (
(!enableFastJSXWithoutStringRefs && "ref" in config) ||
Expand All @@ -669,20 +669,13 @@ __DEV__ &&
(maybeKey[_propName2] = config[_propName2]);
}
children &&
((_propName2 =
defineKeyPropWarningGetter(
maybeKey,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type),
children && defineKeyPropWarningGetter(maybeKey, _propName2));
return ReactElement(
type,
children,
null,
self,
source,
getOwner(),
maybeKey
);
: type
);
return ReactElement(type, children, self, source, getOwner(), maybeKey);
}
function validateChildKeys(node, parentType) {
if (
Expand Down
27 changes: 10 additions & 17 deletions compiled/facebook-www/JSXDEVRuntime-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,16 @@ __DEV__ &&
componentName = this.props.ref;
return void 0 !== componentName ? componentName : null;
}
function ReactElement(type, key, _ref, self, source, owner, props) {
_ref = props.ref;
function ReactElement(type, key, self, source, owner, props) {
self = props.ref;
type = {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
props: props,
_owner: owner
};
null !== (void 0 !== _ref ? _ref : null)
null !== (void 0 !== self ? self : null)
? Object.defineProperty(type, "ref", {
enumerable: !1,
get: elementRefGetterWithDeprecationWarning
Expand Down Expand Up @@ -641,8 +641,8 @@ __DEV__ &&
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (children = "" + config.key));
hasValidRef(config) &&
(disableStringRefs ||
disableStringRefs ||
(hasValidRef(config) &&
warnIfStringRefCannotBeAutoConverted(config, self));
if (
(!enableFastJSXWithoutStringRefs && "ref" in config) ||
Expand All @@ -666,20 +666,13 @@ __DEV__ &&
(maybeKey[_propName2] = config[_propName2]);
}
children &&
((_propName2 =
defineKeyPropWarningGetter(
maybeKey,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type),
children && defineKeyPropWarningGetter(maybeKey, _propName2));
return ReactElement(
type,
children,
null,
self,
source,
getOwner(),
maybeKey
);
: type
);
return ReactElement(type, children, self, source, getOwner(), maybeKey);
}
function validateChildKeys(node, parentType) {
if (
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ea3ac586693014e882655728fc8396ecb1d6cf6e
07aa494432e97f63fca9faf2fad6f76fead31063
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ea3ac586693014e882655728fc8396ecb1d6cf6e
07aa494432e97f63fca9faf2fad6f76fead31063
65 changes: 21 additions & 44 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,16 +596,16 @@ __DEV__ &&
componentName = this.props.ref;
return void 0 !== componentName ? componentName : null;
}
function ReactElement(type, key, _ref, self, source, owner, props) {
_ref = props.ref;
function ReactElement(type, key, self, source, owner, props) {
self = props.ref;
type = {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
props: props,
_owner: owner
};
null !== (void 0 !== _ref ? _ref : null)
null !== (void 0 !== self ? self : null)
? Object.defineProperty(type, "ref", {
enumerable: !1,
get: elementRefGetterWithDeprecationWarning
Expand Down Expand Up @@ -706,8 +706,8 @@ __DEV__ &&
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (children = "" + config.key));
hasValidRef(config) &&
(disableStringRefs ||
disableStringRefs ||
(hasValidRef(config) &&
warnIfStringRefCannotBeAutoConverted(config, self));
if (
(!enableFastJSXWithoutStringRefs && "ref" in config) ||
Expand All @@ -731,26 +731,18 @@ __DEV__ &&
(maybeKey[_propName2] = config[_propName2]);
}
children &&
((_propName2 =
defineKeyPropWarningGetter(
maybeKey,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type),
children && defineKeyPropWarningGetter(maybeKey, _propName2));
return ReactElement(
type,
children,
null,
self,
source,
getOwner(),
maybeKey
);
: type
);
return ReactElement(type, children, self, source, getOwner(), maybeKey);
}
function cloneAndReplaceKey(oldElement, newKey) {
newKey = ReactElement(
oldElement.type,
newKey,
null,
void 0,
void 0,
oldElement._owner,
Expand Down Expand Up @@ -1601,15 +1593,7 @@ __DEV__ &&
for (var i = 0; i < propName; i++) defaultProps[i] = arguments[i + 2];
props.children = defaultProps;
}
props = ReactElement(
element.type,
key,
null,
void 0,
void 0,
owner,
props
);
props = ReactElement(element.type, key, void 0, void 0, owner, props);
for (key = 2; key < arguments.length; key++)
validateChildKeys(arguments[key], props.type);
return props;
Expand Down Expand Up @@ -1716,6 +1700,7 @@ __DEV__ &&
i
);
}
var propName;
i = {};
typeString = null;
if (null != config)
Expand All @@ -1726,8 +1711,8 @@ __DEV__ &&
warn(
"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"
)),
hasValidRef(config) &&
(disableStringRefs ||
disableStringRefs ||
(hasValidRef(config) &&
warnIfStringRefCannotBeAutoConverted(config, config.__self)),
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (typeString = "" + config.key)),
Expand All @@ -1754,22 +1739,14 @@ __DEV__ &&
if (type && type.defaultProps)
for (propName in ((childrenLength = type.defaultProps), childrenLength))
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
if (typeString) {
var propName =
typeString &&
defineKeyPropWarningGetter(
i,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type;
typeString && defineKeyPropWarningGetter(i, propName);
}
return ReactElement(
type,
typeString,
null,
void 0,
void 0,
getOwner(),
i
);
: type
);
return ReactElement(type, typeString, void 0, void 0, getOwner(), i);
};
exports.createRef = function () {
var refObject = { current: null };
Expand Down Expand Up @@ -2021,7 +1998,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-ea3ac586-20241031";
exports.version = "19.0.0-www-classic-07aa4944-20241104";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
65 changes: 21 additions & 44 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,16 +593,16 @@ __DEV__ &&
componentName = this.props.ref;
return void 0 !== componentName ? componentName : null;
}
function ReactElement(type, key, _ref, self, source, owner, props) {
_ref = props.ref;
function ReactElement(type, key, self, source, owner, props) {
self = props.ref;
type = {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
props: props,
_owner: owner
};
null !== (void 0 !== _ref ? _ref : null)
null !== (void 0 !== self ? self : null)
? Object.defineProperty(type, "ref", {
enumerable: !1,
get: elementRefGetterWithDeprecationWarning
Expand Down Expand Up @@ -703,8 +703,8 @@ __DEV__ &&
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (children = "" + config.key));
hasValidRef(config) &&
(disableStringRefs ||
disableStringRefs ||
(hasValidRef(config) &&
warnIfStringRefCannotBeAutoConverted(config, self));
if (
(!enableFastJSXWithoutStringRefs && "ref" in config) ||
Expand All @@ -728,26 +728,18 @@ __DEV__ &&
(maybeKey[_propName2] = config[_propName2]);
}
children &&
((_propName2 =
defineKeyPropWarningGetter(
maybeKey,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type),
children && defineKeyPropWarningGetter(maybeKey, _propName2));
return ReactElement(
type,
children,
null,
self,
source,
getOwner(),
maybeKey
);
: type
);
return ReactElement(type, children, self, source, getOwner(), maybeKey);
}
function cloneAndReplaceKey(oldElement, newKey) {
newKey = ReactElement(
oldElement.type,
newKey,
null,
void 0,
void 0,
oldElement._owner,
Expand Down Expand Up @@ -1581,15 +1573,7 @@ __DEV__ &&
for (var i = 0; i < propName; i++) defaultProps[i] = arguments[i + 2];
props.children = defaultProps;
}
props = ReactElement(
element.type,
key,
null,
void 0,
void 0,
owner,
props
);
props = ReactElement(element.type, key, void 0, void 0, owner, props);
for (key = 2; key < arguments.length; key++)
validateChildKeys(arguments[key], props.type);
return props;
Expand Down Expand Up @@ -1696,6 +1680,7 @@ __DEV__ &&
i
);
}
var propName;
i = {};
typeString = null;
if (null != config)
Expand All @@ -1706,8 +1691,8 @@ __DEV__ &&
warn(
"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"
)),
hasValidRef(config) &&
(disableStringRefs ||
disableStringRefs ||
(hasValidRef(config) &&
warnIfStringRefCannotBeAutoConverted(config, config.__self)),
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (typeString = "" + config.key)),
Expand All @@ -1734,22 +1719,14 @@ __DEV__ &&
if (type && type.defaultProps)
for (propName in ((childrenLength = type.defaultProps), childrenLength))
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
if (typeString) {
var propName =
typeString &&
defineKeyPropWarningGetter(
i,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type;
typeString && defineKeyPropWarningGetter(i, propName);
}
return ReactElement(
type,
typeString,
null,
void 0,
void 0,
getOwner(),
i
);
: type
);
return ReactElement(type, typeString, void 0, void 0, getOwner(), i);
};
exports.createRef = function () {
var refObject = { current: null };
Expand Down Expand Up @@ -2001,7 +1978,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-ea3ac586-20241031";
exports.version = "19.0.0-www-modern-07aa4944-20241104";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit eed58d4

Please sign in to comment.