From 920b646138df0bf9e788eb60b2ec5e71eaadc8dc Mon Sep 17 00:00:00 2001 From: rickhanlonii <2440089+rickhanlonii@users.noreply.github.com> Date: Mon, 24 Feb 2025 07:08:48 -0800 Subject: [PATCH] [flags] remove enableRemoveConsolePatches (#32425) wait to merge until we sync https://github.com/facebook/react/pull/32376, since that enables it in some testing builds that might break DiffTrain build for [25677265038b89c1ee3000e0669339ed160d9d75](https://github.com/facebook/react/commit/25677265038b89c1ee3000e0669339ed160d9d75) --- compiled-rn/VERSION_NATIVE_FB | 2 +- .../react/react-dom/cjs/ReactDOM-dev.js | 64 +- .../react/react-dom/cjs/ReactDOM-prod.js | 4 +- .../react/react-dom/cjs/ReactDOM-profiling.js | 4 +- .../react/react-dom/cjs/ReactDOMClient-dev.js | 1205 ++++++++-------- .../react-dom/cjs/ReactDOMClient-prod.js | 12 +- .../react-dom/cjs/ReactDOMClient-profiling.js | 12 +- .../react-dom/cjs/ReactDOMProfiling-dev.js | 1237 ++++++++--------- .../react-dom/cjs/ReactDOMProfiling-prod.js | 12 +- .../cjs/ReactDOMProfiling-profiling.js | 12 +- .../react-dom/cjs/ReactDOMTestUtils-dev.js | 30 +- .../cjs/ReactTestRenderer-dev.js | 590 ++++---- .../cjs/ReactTestRenderer-prod.js | 8 +- .../cjs/ReactTestRenderer-profiling.js | 8 +- .../react/react/cjs/JSXDEVRuntime-dev.js | 66 +- .../vendor/react/react/cjs/JSXRuntime-dev.js | 66 +- .../vendor/react/react/cjs/React-dev.js | 200 ++- .../vendor/react/react/cjs/React-prod.js | 4 +- .../vendor/react/react/cjs/React-profiling.js | 4 +- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 575 ++++---- .../implementations/ReactFabric-prod.fb.js | 6 +- .../ReactFabric-profiling.fb.js | 6 +- .../ReactNativeRenderer-dev.fb.js | 609 ++++---- .../ReactNativeRenderer-prod.fb.js | 10 +- .../ReactNativeRenderer-profiling.fb.js | 10 +- 26 files changed, 2110 insertions(+), 2648 deletions(-) diff --git a/compiled-rn/VERSION_NATIVE_FB b/compiled-rn/VERSION_NATIVE_FB index 1d158cd26d..bef123c167 100644 --- a/compiled-rn/VERSION_NATIVE_FB +++ b/compiled-rn/VERSION_NATIVE_FB @@ -1 +1 @@ -19.1.0-native-fb-9dd378ff-20250224 \ No newline at end of file +19.1.0-native-fb-25677265-20250224 \ No newline at end of file diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js index 0c81d11f05..03eee6bcda 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js @@ -7,34 +7,13 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<9728716abd8fa7a6ba3e5f85b797037c>> + * @generated SignedSource<<51c03329699f31a3dc0e647b87137455>> */ "use strict"; __DEV__ && (function () { function noop() {} - 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 || - (ReactSharedInternals.getCurrentStack && - ((_key2 = ReactSharedInternals.getCurrentStack()), - "" !== _key2 && ((_len2 += "%s"), (args = args.concat([_key2])))), - args.unshift(_len2), - Function.prototype.apply.call(console.error, console, args)); - } function testStringCoercion(value) { return "" + value; } @@ -48,7 +27,7 @@ __DEV__ && JSCompiler_inline_result = !0; } JSCompiler_inline_result && - (error( + (console.error( "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", ("function" === typeof Symbol && Symbol.toStringTag && @@ -95,13 +74,12 @@ __DEV__ && function resolveDispatcher() { var dispatcher = ReactSharedInternals.H; null === dispatcher && - error( + console.error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." ); return dispatcher; } var React = require("react"), - dynamicFlagsUntyped = require("ReactNativeInternalFeatureFlags"), Internals = { d: { f: noop, @@ -121,11 +99,9 @@ __DEV__ && p: 0, findDOMNode: null }, + REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, - enableRemoveConsolePatches = - dynamicFlagsUntyped && dynamicFlagsUntyped.enableRemoveConsolePatches, - REACT_PORTAL_TYPE = Symbol.for("react.portal"); + React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; ("function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && @@ -133,7 +109,7 @@ __DEV__ && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach) || - error( + console.error( "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills" ); exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = @@ -158,17 +134,17 @@ __DEV__ && exports.preconnect = function (href, options) { "string" === typeof href && href ? null != options && "object" !== typeof options - ? error( + ? console.error( "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.", getValueDescriptorExpectingEnumForWarning(options) ) : null != options && "string" !== typeof options.crossOrigin && - error( + console.error( "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.", getValueDescriptorExpectingObjectForWarning(options.crossOrigin) ) - : error( + : console.error( "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href) ); @@ -186,18 +162,18 @@ __DEV__ && }; exports.prefetchDNS = function (href) { if ("string" !== typeof href || !href) - error( + console.error( "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href) ); else if (1 < arguments.length) { var options = arguments[1]; "object" === typeof options && options.hasOwnProperty("crossOrigin") - ? error( + ? console.error( "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options) ) - : error( + : console.error( "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options) ); @@ -207,17 +183,17 @@ __DEV__ && exports.preinit = function (href, options) { "string" === typeof href && href ? null == options || "object" !== typeof options - ? error( + ? console.error( "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.", getValueDescriptorExpectingEnumForWarning(options) ) : "style" !== options.as && "script" !== options.as && - error( + console.error( 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".', getValueDescriptorExpectingEnumForWarning(options.as) ) - : error( + : console.error( "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href) ); @@ -275,7 +251,7 @@ __DEV__ && getValueDescriptorExpectingEnumForWarning(options.as) + "."); if (encountered) - error( + console.error( "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s", encountered ); @@ -290,7 +266,7 @@ __DEV__ && default: (encountered = getValueDescriptorExpectingEnumForWarning(encountered)), - error( + console.error( 'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)', encountered, href @@ -332,7 +308,7 @@ __DEV__ && getValueDescriptorExpectingObjectForWarning(options.as) + "."); encountered && - error( + console.error( 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `` tag.%s', encountered ); @@ -393,7 +369,7 @@ __DEV__ && getValueDescriptorExpectingObjectForWarning(options.as) + "."); encountered && - error( + console.error( 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `` tag.%s', encountered ); @@ -428,5 +404,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-native-fb-9dd378ff-20250224"; + exports.version = "19.1.0-native-fb-25677265-20250224"; })(); diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js index ed6a9e6be5..9ad0da711b 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-native-fb-9dd378ff-20250224"; +exports.version = "19.1.0-native-fb-25677265-20250224"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js index ed6a9e6be5..9ad0da711b 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-native-fb-9dd378ff-20250224"; +exports.version = "19.1.0-native-fb-25677265-20250224"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js index a4e90fcada..9327be4005 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<1bfdabbd828a9bc24d21d9b93dbb6ae5>> + * @generated SignedSource<> */ /* @@ -30,11 +30,11 @@ __DEV__ && } function copyWithRename(obj, oldPath, newPath) { if (oldPath.length !== newPath.length) - warn("copyWithRename() expects paths of the same length"); + console.warn("copyWithRename() expects paths of the same length"); else { for (var i = 0; i < newPath.length - 1; i++) if (oldPath[i] !== newPath[i]) { - warn( + console.warn( "copyWithRename() expects paths to be the same except for the deepest key" ); return; @@ -77,12 +77,12 @@ __DEV__ && } function warnForMissingKey() {} function warnInvalidHookAccess() { - error$jscomp$0( + console.error( "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks" ); } function warnInvalidContextAccess() { - error$jscomp$0( + console.error( "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); } @@ -114,44 +114,6 @@ __DEV__ && function setRefreshHandler(handler) { resolveFamily = handler; } - function warn(format) { - for ( - var _len = arguments.length, - args = Array(1 < _len ? _len - 1 : 0), - _key = 1; - _key < _len; - _key++ - ) - args[_key - 1] = arguments[_key]; - if (enableRemoveConsolePatches) { - var _console; - (_console = console).warn.apply(_console, [format].concat(args)); - } else suppressWarning || printWarning("warn", format, args); - } - function error$jscomp$0(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 suppressWarning || printWarning("error", format, args); - } - function printWarning(level, format, args) { - if (!enableRemoveConsolePatches) { - if (ReactSharedInternals.getCurrentStack) { - var stack = ReactSharedInternals.getCurrentStack(); - "" !== stack && ((format += "%s"), (args = args.concat([stack]))); - } - args.unshift(format); - Function.prototype.apply.call(console[level], console, args); - } - } function isValidContainer(node) { return !( !node || @@ -304,7 +266,7 @@ __DEV__ && if ("object" === typeof type) switch ( ("number" === typeof type.tag && - error$jscomp$0( + console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), type.$$typeof) @@ -415,9 +377,9 @@ __DEV__ && } function pop(cursor, fiber) { 0 > index$jscomp$0 - ? error$jscomp$0("Unexpected pop.") + ? console.error("Unexpected pop.") : (fiber !== fiberStack[index$jscomp$0] && - error$jscomp$0("Unexpected Fiber popped."), + console.error("Unexpected Fiber popped."), (cursor.current = valueStack[index$jscomp$0]), (valueStack[index$jscomp$0] = null), (fiberStack[index$jscomp$0] = null), @@ -431,7 +393,7 @@ __DEV__ && } function requiredContext(c) { null === c && - error$jscomp$0( + console.error( "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." ); return c; @@ -532,7 +494,7 @@ __DEV__ && function checkAttributeStringCoercion(value, attributeName) { if (willCoercionThrow(value)) return ( - error$jscomp$0( + console.error( "The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.", attributeName, typeName(value) @@ -543,7 +505,7 @@ __DEV__ && function checkCSSPropertyStringCoercion(value, propName) { if (willCoercionThrow(value)) return ( - error$jscomp$0( + console.error( "The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.", propName, typeName(value) @@ -554,7 +516,7 @@ __DEV__ && function checkFormFieldValueStringCoercion(value) { if (willCoercionThrow(value)) return ( - error$jscomp$0( + console.error( "Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.", typeName(value) ), @@ -567,7 +529,7 @@ __DEV__ && if (hook.isDisabled) return !0; if (!hook.supportsFiber) return ( - error$jscomp$0( + console.error( "The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools" ), !0 @@ -575,21 +537,20 @@ __DEV__ && try { (rendererID = hook.inject(internals)), (injectedHook = hook); } catch (err) { - error$jscomp$0("React instrumentation encountered an error: %s.", err); + console.error("React instrumentation encountered an error: %s.", err); } return hook.checkDCE ? !0 : !1; } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && - (unstable_setDisableYieldValue(newIsStrictMode), - enableRemoveConsolePatches || (suppressWarning = newIsStrictMode)); + unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) try { injectedHook.setStrictMode(rendererID, newIsStrictMode); } catch (err) { hasLoggedError || ((hasLoggedError = !0), - error$jscomp$0( + console.error( "React instrumentation encountered an error: %s", err )); @@ -702,7 +663,7 @@ __DEV__ && return 0; default: return ( - error$jscomp$0( + console.error( "Should have found matching lanes. This is a bug in React." ), lanes @@ -799,7 +760,7 @@ __DEV__ && return -1; default: return ( - error$jscomp$0( + console.error( "Should have found matching lanes. This is a bug in React." ), -1 @@ -1068,7 +1029,7 @@ __DEV__ && } function registerDirectEvent(registrationName, dependencies) { registrationNameDependencies[registrationName] && - error$jscomp$0( + console.error( "EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName ); @@ -1092,17 +1053,17 @@ __DEV__ && props.disabled || null == props.value || ("select" === tagName - ? error$jscomp$0( + ? console.error( "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`." ) - : error$jscomp$0( + : console.error( "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`." )); props.onChange || props.readOnly || props.disabled || null == props.checked || - error$jscomp$0( + console.error( "You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`." ); } @@ -1114,7 +1075,7 @@ __DEV__ && if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) return (validatedAttributeNameCache[attributeName] = !0); illegalAttributeNameCache[attributeName] = !0; - error$jscomp$0("Invalid attribute name: `%s`", attributeName); + console.error("Invalid attribute name: `%s`", attributeName); return !1; } function getValueForAttributeOnCustomComponent(node, name, expected) { @@ -1231,7 +1192,7 @@ __DEV__ && }); } 0 > disabledDepth && - error$jscomp$0( + console.error( "disabledDepth fell below zero. This is a bug in React. Please file an issue." ); } @@ -1672,7 +1633,7 @@ __DEV__ && void 0 === props.checked || void 0 === props.defaultChecked || didWarnCheckedDefaultChecked || - (error$jscomp$0( + (console.error( "%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type @@ -1681,7 +1642,7 @@ __DEV__ && void 0 === props.value || void 0 === props.defaultValue || didWarnValueDefaultValue$1 || - (error$jscomp$0( + (console.error( "%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type @@ -1793,19 +1754,19 @@ __DEV__ && "bigint" === typeof child || didWarnInvalidChild || ((didWarnInvalidChild = !0), - error$jscomp$0( + console.error( "Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to