Skip to content

Commit bcc8b46

Browse files
committed
[internal] fix console patch, add RN (facebook#32075)
The forking for `shared/ReactFeatureFlags` doesn't work in the console patches. Since they're already forked, we can import the internal ReactFeatureFlags files directly. Would have caught this in testing a PR sync, but the PR syncs are broken right now. DiffTrain build for [43d18bc](facebook@43d18bc)
1 parent c4af03f commit bcc8b46

26 files changed

+339
-267
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.1.0-native-fb-b3a95caf-20250113
1+
19.1.0-native-fb-43d18bc2-20250115

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<240089cce633c540a77902535a822455>>
10+
* @generated SignedSource<<df47e386bf1fe5abe7501a1937cbb301>>
1111
*/
1212

1313
"use strict";
@@ -23,12 +23,17 @@ __DEV__ &&
2323
_key2++
2424
)
2525
args[_key2 - 1] = arguments[_key2];
26-
_len2 = format;
27-
ReactSharedInternals.getCurrentStack &&
28-
((_key2 = ReactSharedInternals.getCurrentStack()),
29-
"" !== _key2 && ((_len2 += "%s"), (args = args.concat([_key2]))));
30-
args.unshift(_len2);
31-
Function.prototype.apply.call(console.error, console, args);
26+
if (enableRemoveConsolePatches) {
27+
var _console2;
28+
(_console2 = console).error.apply(_console2, [format].concat(args));
29+
} else
30+
(_len2 = format),
31+
enableRemoveConsolePatches ||
32+
(ReactSharedInternals.getCurrentStack &&
33+
((_key2 = ReactSharedInternals.getCurrentStack()),
34+
"" !== _key2 && ((_len2 += "%s"), (args = args.concat([_key2])))),
35+
args.unshift(_len2),
36+
Function.prototype.apply.call(console.error, console, args));
3237
}
3338
function testStringCoercion(value) {
3439
return "" + value;
@@ -96,6 +101,7 @@ __DEV__ &&
96101
return dispatcher;
97102
}
98103
var React = require("react"),
104+
dynamicFlagsUntyped = require("ReactNativeInternalFeatureFlags"),
99105
Internals = {
100106
d: {
101107
f: noop,
@@ -117,6 +123,8 @@ __DEV__ &&
117123
},
118124
ReactSharedInternals =
119125
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
126+
enableRemoveConsolePatches =
127+
dynamicFlagsUntyped && dynamicFlagsUntyped.enableRemoveConsolePatches,
120128
REACT_PORTAL_TYPE = Symbol.for("react.portal");
121129
("function" === typeof Map &&
122130
null != Map.prototype &&
@@ -420,5 +428,5 @@ __DEV__ &&
420428
exports.useFormStatus = function () {
421429
return resolveDispatcher().useHostTransitionStatus();
422430
};
423-
exports.version = "19.1.0-native-fb-b3a95caf-20250113";
431+
exports.version = "19.1.0-native-fb-43d18bc2-20250115";
424432
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<9eddcd5aedcc1cd9c6670e6463916988>>
10+
* @generated SignedSource<<cdea6e896a523397ca5640b0abd0d114>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.1.0-native-fb-b3a95caf-20250113";
206+
exports.version = "19.1.0-native-fb-43d18bc2-20250115";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<9eddcd5aedcc1cd9c6670e6463916988>>
10+
* @generated SignedSource<<cdea6e896a523397ca5640b0abd0d114>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.1.0-native-fb-b3a95caf-20250113";
206+
exports.version = "19.1.0-native-fb-43d18bc2-20250115";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<180f512d052d35c3916e509323b8438c>>
10+
* @generated SignedSource<<95576c45965431f7898adb25c6f79666>>
1111
*/
1212

1313
/*
@@ -115,38 +115,42 @@ __DEV__ &&
115115
resolveFamily = handler;
116116
}
117117
function warn(format) {
118-
if (!suppressWarning) {
119-
for (
120-
var _len = arguments.length,
121-
args = Array(1 < _len ? _len - 1 : 0),
122-
_key = 1;
123-
_key < _len;
124-
_key++
125-
)
126-
args[_key - 1] = arguments[_key];
127-
printWarning("warn", format, args);
128-
}
118+
for (
119+
var _len = arguments.length,
120+
args = Array(1 < _len ? _len - 1 : 0),
121+
_key = 1;
122+
_key < _len;
123+
_key++
124+
)
125+
args[_key - 1] = arguments[_key];
126+
if (enableRemoveConsolePatches) {
127+
var _console;
128+
(_console = console).warn.apply(_console, [format].concat(args));
129+
} else suppressWarning || printWarning("warn", format, args);
129130
}
130131
function error$jscomp$0(format) {
131-
if (!suppressWarning) {
132-
for (
133-
var _len2 = arguments.length,
134-
args = Array(1 < _len2 ? _len2 - 1 : 0),
135-
_key2 = 1;
136-
_key2 < _len2;
137-
_key2++
138-
)
139-
args[_key2 - 1] = arguments[_key2];
140-
printWarning("error", format, args);
141-
}
132+
for (
133+
var _len2 = arguments.length,
134+
args = Array(1 < _len2 ? _len2 - 1 : 0),
135+
_key2 = 1;
136+
_key2 < _len2;
137+
_key2++
138+
)
139+
args[_key2 - 1] = arguments[_key2];
140+
if (enableRemoveConsolePatches) {
141+
var _console2;
142+
(_console2 = console).error.apply(_console2, [format].concat(args));
143+
} else suppressWarning || printWarning("error", format, args);
142144
}
143145
function printWarning(level, format, args) {
144-
if (ReactSharedInternals.getCurrentStack) {
145-
var stack = ReactSharedInternals.getCurrentStack();
146-
"" !== stack && ((format += "%s"), (args = args.concat([stack])));
146+
if (!enableRemoveConsolePatches) {
147+
if (ReactSharedInternals.getCurrentStack) {
148+
var stack = ReactSharedInternals.getCurrentStack();
149+
"" !== stack && ((format += "%s"), (args = args.concat([stack])));
150+
}
151+
args.unshift(format);
152+
Function.prototype.apply.call(console[level], console, args);
147153
}
148-
args.unshift(format);
149-
Function.prototype.apply.call(console[level], console, args);
150154
}
151155
function isValidContainer(node) {
152156
return !(
@@ -582,7 +586,7 @@ __DEV__ &&
582586
function setIsStrictModeForDevtools(newIsStrictMode) {
583587
"function" === typeof log$1 &&
584588
(unstable_setDisableYieldValue(newIsStrictMode),
585-
(suppressWarning = newIsStrictMode));
589+
enableRemoveConsolePatches || (suppressWarning = newIsStrictMode));
586590
if (injectedHook && "function" === typeof injectedHook.setStrictMode)
587591
try {
588592
injectedHook.setStrictMode(rendererID, newIsStrictMode);
@@ -22196,6 +22200,8 @@ __DEV__ &&
2219622200
ReactDOM = require("react-dom"),
2219722201
ReactSharedInternals =
2219822202
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
22203+
enableRemoveConsolePatches =
22204+
dynamicFlagsUntyped && dynamicFlagsUntyped.enableRemoveConsolePatches,
2219922205
suppressWarning = !1,
2220022206
alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries,
2220122207
enableHiddenSubtreeInsertionEffectCleanup =
@@ -25951,11 +25957,11 @@ __DEV__ &&
2595125957
};
2595225958
(function () {
2595325959
var isomorphicReactPackageVersion = React.version;
25954-
if ("19.1.0-native-fb-b3a95caf-20250113" !== isomorphicReactPackageVersion)
25960+
if ("19.1.0-native-fb-43d18bc2-20250115" !== isomorphicReactPackageVersion)
2595525961
throw Error(
2595625962
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2595725963
(isomorphicReactPackageVersion +
25958-
"\n - react-dom: 19.1.0-native-fb-b3a95caf-20250113\nLearn more: https://react.dev/warnings/version-mismatch")
25964+
"\n - react-dom: 19.1.0-native-fb-43d18bc2-20250115\nLearn more: https://react.dev/warnings/version-mismatch")
2595925965
);
2596025966
})();
2596125967
("function" === typeof Map &&
@@ -25992,10 +25998,10 @@ __DEV__ &&
2599225998
!(function () {
2599325999
var internals = {
2599426000
bundleType: 1,
25995-
version: "19.1.0-native-fb-b3a95caf-20250113",
26001+
version: "19.1.0-native-fb-43d18bc2-20250115",
2599626002
rendererPackageName: "react-dom",
2599726003
currentDispatcherRef: ReactSharedInternals,
25998-
reconcilerVersion: "19.1.0-native-fb-b3a95caf-20250113"
26004+
reconcilerVersion: "19.1.0-native-fb-43d18bc2-20250115"
2599926005
};
2600026006
internals.overrideHookState = overrideHookState;
2600126007
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -26141,5 +26147,5 @@ __DEV__ &&
2614126147
listenToAllSupportedEvents(container);
2614226148
return new ReactDOMHydrationRoot(initialChildren);
2614326149
};
26144-
exports.version = "19.1.0-native-fb-b3a95caf-20250113";
26150+
exports.version = "19.1.0-native-fb-43d18bc2-20250115";
2614526151
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b23dba4ec2272d38219ea3998e7237bf>>
10+
* @generated SignedSource<<4177fd9db345986e60e9ca1ca25f76e5>>
1111
*/
1212

1313
/*
@@ -15968,14 +15968,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1596815968
};
1596915969
var isomorphicReactPackageVersion$jscomp$inline_1785 = React.version;
1597015970
if (
15971-
"19.1.0-native-fb-b3a95caf-20250113" !==
15971+
"19.1.0-native-fb-43d18bc2-20250115" !==
1597215972
isomorphicReactPackageVersion$jscomp$inline_1785
1597315973
)
1597415974
throw Error(
1597515975
formatProdErrorMessage(
1597615976
527,
1597715977
isomorphicReactPackageVersion$jscomp$inline_1785,
15978-
"19.1.0-native-fb-b3a95caf-20250113"
15978+
"19.1.0-native-fb-43d18bc2-20250115"
1597915979
)
1598015980
);
1598115981
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -15997,10 +15997,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1599715997
};
1599815998
var internals$jscomp$inline_2241 = {
1599915999
bundleType: 0,
16000-
version: "19.1.0-native-fb-b3a95caf-20250113",
16000+
version: "19.1.0-native-fb-43d18bc2-20250115",
1600116001
rendererPackageName: "react-dom",
1600216002
currentDispatcherRef: ReactSharedInternals,
16003-
reconcilerVersion: "19.1.0-native-fb-b3a95caf-20250113"
16003+
reconcilerVersion: "19.1.0-native-fb-43d18bc2-20250115"
1600416004
};
1600516005
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1600616006
var hook$jscomp$inline_2242 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16106,4 +16106,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1610616106
listenToAllSupportedEvents(container);
1610716107
return new ReactDOMHydrationRoot(initialChildren);
1610816108
};
16109-
exports.version = "19.1.0-native-fb-b3a95caf-20250113";
16109+
exports.version = "19.1.0-native-fb-43d18bc2-20250115";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<db4ad4d66e452da32d19e41b73aea217>>
10+
* @generated SignedSource<<bd521e4a43b2ab4756c72d452819a616>>
1111
*/
1212

1313
/*
@@ -16617,14 +16617,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1661716617
};
1661816618
var isomorphicReactPackageVersion$jscomp$inline_1880 = React.version;
1661916619
if (
16620-
"19.1.0-native-fb-b3a95caf-20250113" !==
16620+
"19.1.0-native-fb-43d18bc2-20250115" !==
1662116621
isomorphicReactPackageVersion$jscomp$inline_1880
1662216622
)
1662316623
throw Error(
1662416624
formatProdErrorMessage(
1662516625
527,
1662616626
isomorphicReactPackageVersion$jscomp$inline_1880,
16627-
"19.1.0-native-fb-b3a95caf-20250113"
16627+
"19.1.0-native-fb-43d18bc2-20250115"
1662816628
)
1662916629
);
1663016630
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16646,10 +16646,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1664616646
};
1664716647
var internals$jscomp$inline_1887 = {
1664816648
bundleType: 0,
16649-
version: "19.1.0-native-fb-b3a95caf-20250113",
16649+
version: "19.1.0-native-fb-43d18bc2-20250115",
1665016650
rendererPackageName: "react-dom",
1665116651
currentDispatcherRef: ReactSharedInternals,
16652-
reconcilerVersion: "19.1.0-native-fb-b3a95caf-20250113",
16652+
reconcilerVersion: "19.1.0-native-fb-43d18bc2-20250115",
1665316653
getLaneLabelMap: function () {
1665416654
for (
1665516655
var map = new Map(), lane = 1, index$292 = 0;
@@ -16770,4 +16770,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1677016770
listenToAllSupportedEvents(container);
1677116771
return new ReactDOMHydrationRoot(initialChildren);
1677216772
};
16773-
exports.version = "19.1.0-native-fb-b3a95caf-20250113";
16773+
exports.version = "19.1.0-native-fb-43d18bc2-20250115";

0 commit comments

Comments
 (0)