Skip to content

Commit

Permalink
[flags] remove enableRemoveConsolePatches (#32425)
Browse files Browse the repository at this point in the history
wait to merge until we sync
#32376, since that enables it in
some testing builds that might break

DiffTrain build for [2567726](2567726)
  • Loading branch information
rickhanlonii committed Feb 24, 2025
1 parent 4c1a6b4 commit 6d9586c
Show file tree
Hide file tree
Showing 41 changed files with 4,453 additions and 5,610 deletions.
66 changes: 20 additions & 46 deletions compiled/facebook-www/JSXDEVRuntime-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,6 @@
"use strict";
__DEV__ &&
(function () {
function error(format) {
for (
var _len2 = arguments.length,
args = Array(1 < _len2 ? _len2 - 1 : 0),
_key2 = 1;
_key2 < _len2;
_key2++
)
args[_key2 - 1] = arguments[_key2];
if (enableRemoveConsolePatches) {
var _console2;
(_console2 = console).error.apply(_console2, [format].concat(args));
} else
(_len2 = format),
enableRemoveConsolePatches ||
((_key2 =
require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE),
null != _key2 &&
_key2.getCurrentStack &&
((_key2 = _key2.getCurrentStack()),
"" !== _key2 && ((_len2 += "%s"), args.push(_key2))),
args.unshift(_len2),
args.unshift(!1),
warningWWW.apply(null, args));
}
function getComponentNameFromType(type) {
if (null == type) return null;
if ("function" === typeof type)
Expand Down Expand Up @@ -66,7 +41,7 @@ __DEV__ &&
if ("object" === typeof type)
switch (
("number" === typeof type.tag &&
error(
console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
),
type.$$typeof)
Expand Down Expand Up @@ -115,20 +90,22 @@ __DEV__ &&
} catch (e) {
JSCompiler_inline_result = !0;
}
if (JSCompiler_inline_result)
return (
(JSCompiler_inline_result =
("function" === typeof Symbol &&
Symbol.toStringTag &&
value[Symbol.toStringTag]) ||
value.constructor.name ||
"Object"),
error(
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
JSCompiler_inline_result
),
testStringCoercion(value)
if (JSCompiler_inline_result) {
JSCompiler_inline_result = console;
var JSCompiler_temp_const = JSCompiler_inline_result.error;
var JSCompiler_inline_result$jscomp$0 =
("function" === typeof Symbol &&
Symbol.toStringTag &&
value[Symbol.toStringTag]) ||
value.constructor.name ||
"Object";
JSCompiler_temp_const.call(
JSCompiler_inline_result,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
JSCompiler_inline_result$jscomp$0
);
return testStringCoercion(value);
}
}
function getTaskName(type) {
if (type === REACT_FRAGMENT_TYPE) return "<>";
Expand Down Expand Up @@ -160,7 +137,7 @@ __DEV__ &&
function warnAboutAccessingKey() {
specialPropKeyWarningShown ||
((specialPropKeyWarningShown = !0),
error(
console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
displayName
));
Expand All @@ -175,7 +152,7 @@ __DEV__ &&
var componentName = getComponentNameFromType(this.type);
didWarnAboutElementRef[componentName] ||
((didWarnAboutElementRef[componentName] = !0),
error(
console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
));
componentName = this.props.ref;
Expand Down Expand Up @@ -255,7 +232,7 @@ __DEV__ &&
validateChildKeys(children[isStaticChildren]);
Object.freeze && Object.freeze(children);
} else
error(
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else validateChildKeys(children);
Expand All @@ -271,7 +248,7 @@ __DEV__ &&
didWarnAboutKeySpread[children + isStaticChildren] ||
((keys =
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
error(
console.error(
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
isStaticChildren,
children,
Expand Down Expand Up @@ -347,9 +324,6 @@ __DEV__ &&
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"),
REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
enableRemoveConsolePatches =
require("ReactFeatureFlags").enableRemoveConsolePatches,
warningWWW = require("warning"),
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
Expand Down
66 changes: 20 additions & 46 deletions compiled/facebook-www/JSXDEVRuntime-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,6 @@
"use strict";
__DEV__ &&
(function () {
function error(format) {
for (
var _len2 = arguments.length,
args = Array(1 < _len2 ? _len2 - 1 : 0),
_key2 = 1;
_key2 < _len2;
_key2++
)
args[_key2 - 1] = arguments[_key2];
if (enableRemoveConsolePatches) {
var _console2;
(_console2 = console).error.apply(_console2, [format].concat(args));
} else
(_len2 = format),
enableRemoveConsolePatches ||
((_key2 =
require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE),
null != _key2 &&
_key2.getCurrentStack &&
((_key2 = _key2.getCurrentStack()),
"" !== _key2 && ((_len2 += "%s"), args.push(_key2))),
args.unshift(_len2),
args.unshift(!1),
warningWWW.apply(null, args));
}
function getComponentNameFromType(type) {
if (null == type) return null;
if ("function" === typeof type)
Expand Down Expand Up @@ -66,7 +41,7 @@ __DEV__ &&
if ("object" === typeof type)
switch (
("number" === typeof type.tag &&
error(
console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
),
type.$$typeof)
Expand Down Expand Up @@ -115,20 +90,22 @@ __DEV__ &&
} catch (e) {
JSCompiler_inline_result = !0;
}
if (JSCompiler_inline_result)
return (
(JSCompiler_inline_result =
("function" === typeof Symbol &&
Symbol.toStringTag &&
value[Symbol.toStringTag]) ||
value.constructor.name ||
"Object"),
error(
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
JSCompiler_inline_result
),
testStringCoercion(value)
if (JSCompiler_inline_result) {
JSCompiler_inline_result = console;
var JSCompiler_temp_const = JSCompiler_inline_result.error;
var JSCompiler_inline_result$jscomp$0 =
("function" === typeof Symbol &&
Symbol.toStringTag &&
value[Symbol.toStringTag]) ||
value.constructor.name ||
"Object";
JSCompiler_temp_const.call(
JSCompiler_inline_result,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
JSCompiler_inline_result$jscomp$0
);
return testStringCoercion(value);
}
}
function getTaskName(type) {
if (type === REACT_FRAGMENT_TYPE) return "<>";
Expand Down Expand Up @@ -160,7 +137,7 @@ __DEV__ &&
function warnAboutAccessingKey() {
specialPropKeyWarningShown ||
((specialPropKeyWarningShown = !0),
error(
console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
displayName
));
Expand All @@ -175,7 +152,7 @@ __DEV__ &&
var componentName = getComponentNameFromType(this.type);
didWarnAboutElementRef[componentName] ||
((didWarnAboutElementRef[componentName] = !0),
error(
console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
));
componentName = this.props.ref;
Expand Down Expand Up @@ -255,7 +232,7 @@ __DEV__ &&
validateChildKeys(children[isStaticChildren]);
Object.freeze && Object.freeze(children);
} else
error(
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else validateChildKeys(children);
Expand All @@ -271,7 +248,7 @@ __DEV__ &&
didWarnAboutKeySpread[children + isStaticChildren] ||
((keys =
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
error(
console.error(
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
isStaticChildren,
children,
Expand Down Expand Up @@ -347,9 +324,6 @@ __DEV__ &&
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"),
REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
enableRemoveConsolePatches =
require("ReactFeatureFlags").enableRemoveConsolePatches,
warningWWW = require("warning"),
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9b042f9d593f965d8c7a42f8f5fce322f403381b
25677265038b89c1ee3000e0669339ed160d9d75
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9b042f9d593f965d8c7a42f8f5fce322f403381b
25677265038b89c1ee3000e0669339ed160d9d75
Loading

0 comments on commit 6d9586c

Please sign in to comment.