[compiler] rebase #32285 (#34102)

Redo of #32285 which was created with ghstack and is tedious to rebase
with sapling.

DiffTrain build for [d3b26b2953](https://github.com/facebook/react/commit/d3b26b2953c7e780abaa49f422c53fd4cda08e47)
This commit is contained in:
josephsavona
2025-08-04 12:11:18 -07:00
parent a6b6ccf3c0
commit 313c51425e
26 changed files with 419 additions and 89 deletions
+1 -1
View File
@@ -1 +1 @@
19.2.0-native-fb-1d163962-20250802
19.2.0-native-fb-d3b26b29-20250804
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<8ae4fd7266b163aea9892d5ca4037ecd>>
* @generated SignedSource<<98274d0c5e07e896c92618930d3f525f>>
*/
"use strict";
@@ -404,5 +404,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b7245c6e68c0a382c27e3cf90423c993>>
* @generated SignedSource<<fabe59dd5de1e00d658b66342a577e9f>>
*/
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b7245c6e68c0a382c27e3cf90423c993>>
* @generated SignedSource<<fabe59dd5de1e00d658b66342a577e9f>>
*/
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2b79a4f464c6279508fa4006e402aaa7>>
* @generated SignedSource<<8525ad18f88b91625c6f74798178ca33>>
*/
/*
@@ -29025,11 +29025,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-1d163962-20250802" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-d3b26b29-20250804" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.2.0-native-fb-1d163962-20250802\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-native-fb-d3b26b29-20250804\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -29066,10 +29066,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -29207,5 +29207,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b7877b706d1e1c9144daca4f67f5bb63>>
* @generated SignedSource<<f34e0d4128a8764184d6fd7a0b70d671>>
*/
/*
@@ -17128,14 +17128,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2002 = React.version;
if (
"19.2.0-native-fb-1d163962-20250802" !==
"19.2.0-native-fb-d3b26b29-20250804" !==
isomorphicReactPackageVersion$jscomp$inline_2002
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2002,
"19.2.0-native-fb-1d163962-20250802"
"19.2.0-native-fb-d3b26b29-20250804"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17157,10 +17157,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2521 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2522 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17258,4 +17258,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<bb8586225c4c9ae4d2f4c68530c83adc>>
* @generated SignedSource<<148ab4a939817b3178316d90027c9690>>
*/
/*
@@ -19086,14 +19086,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2242 = React.version;
if (
"19.2.0-native-fb-1d163962-20250802" !==
"19.2.0-native-fb-d3b26b29-20250804" !==
isomorphicReactPackageVersion$jscomp$inline_2242
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2242,
"19.2.0-native-fb-1d163962-20250802"
"19.2.0-native-fb-d3b26b29-20250804"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19115,10 +19115,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2249 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802",
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$319 = 0;
@@ -19231,4 +19231,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e10e404a1a7af93f1fc0d89e5224335a>>
* @generated SignedSource<<ce0a415ff4090204856d724df47f2bd1>>
*/
/*
@@ -29081,11 +29081,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-1d163962-20250802" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-d3b26b29-20250804" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.2.0-native-fb-1d163962-20250802\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-native-fb-d3b26b29-20250804\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -29122,10 +29122,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -29579,7 +29579,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5df270fd0dbe80893a6639d7021df875>>
* @generated SignedSource<<7d3c27718cca7ab582231c98ecd94ce2>>
*/
/*
@@ -17139,14 +17139,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2003 = React.version;
if (
"19.2.0-native-fb-1d163962-20250802" !==
"19.2.0-native-fb-d3b26b29-20250804" !==
isomorphicReactPackageVersion$jscomp$inline_2003
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2003,
"19.2.0-native-fb-1d163962-20250802"
"19.2.0-native-fb-d3b26b29-20250804"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17168,10 +17168,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2524 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2525 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17422,4 +17422,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<39bb45866b742ac6c5a4aef0aaf2f38a>>
* @generated SignedSource<<12b4fe45b268036a270c136f6d04d585>>
*/
/*
@@ -19101,14 +19101,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2243 = React.version;
if (
"19.2.0-native-fb-1d163962-20250802" !==
"19.2.0-native-fb-d3b26b29-20250804" !==
isomorphicReactPackageVersion$jscomp$inline_2243
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2243,
"19.2.0-native-fb-1d163962-20250802"
"19.2.0-native-fb-d3b26b29-20250804"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19130,10 +19130,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2250 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802",
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$319 = 0;
@@ -19399,7 +19399,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c150d95849d916bafa1a50d738d9b312>>
* @generated SignedSource<<0a69ac1907ba12b9879595e0f1ec6d89>>
*/
"use strict";
@@ -15739,10 +15739,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -15887,5 +15887,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e94c45b1559c56fc09805ed05a8dfd80>>
* @generated SignedSource<<3805192e0733e94ebef3a709d667e4ca>>
*/
"use strict";
@@ -9912,10 +9912,10 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1432 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1433 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10051,4 +10051,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<af68b11cd558b9d93317b5babdd19da1>>
* @generated SignedSource<<66efd123094574afb2a87a8bf50c2912>>
*/
"use strict";
@@ -10532,10 +10532,10 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1239 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802",
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$143 = 0;
@@ -10686,4 +10686,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<392161f5ed75673233b096b277c68f96>>
* @generated SignedSource<<c6945560dcd8a71abc6a972bc39d5c07>>
*/
"use strict";
@@ -1413,7 +1413,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2a77214e3536976587aee41d599c9878>>
* @generated SignedSource<<fb48f7a7626a97bd813d04ac6411ac62>>
*/
"use strict";
@@ -589,4 +589,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2f752bf4bad2fb397376284ceae92444>>
* @generated SignedSource<<7ff083cecfd744e5def29bd5124b86ed>>
*/
"use strict";
@@ -593,7 +593,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.2.0-native-fb-1d163962-20250802";
exports.version = "19.2.0-native-fb-d3b26b29-20250804";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -1 +1 @@
1d163962b21f9396d26930e31719bd8b10d9e107
d3b26b2953c7e780abaa49f422c53fd4cda08e47
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<6fcf3f77ff8e6a6f10ef79707ab50201>>
* @generated SignedSource<<bf3eb3416f945929a4af38d650597197>>
*/
"use strict";
@@ -19244,10 +19244,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<793216b119e5dcc4dca835298100a17d>>
* @generated SignedSource<<84287a6bbd50f0c3890a2eb73151e7c4>>
*/
"use strict";
@@ -11016,10 +11016,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1235 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1235.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<dde35bb4879bb43491bc96e6cf2cda02>>
* @generated SignedSource<<c8c30844a26f74645be68f16e00fba90>>
*/
"use strict";
@@ -12945,10 +12945,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1470 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1470.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<db42a8a26a2c36e837e8c5f568bd4e1d>>
* @generated SignedSource<<2765bae7b74f0d381326e6ae3a8fc7f0>>
*/
"use strict";
@@ -19602,11 +19602,11 @@ __DEV__ &&
shouldSuspendImpl = newShouldSuspendImpl;
};
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-1d163962-20250802" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-d3b26b29-20250804" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.2.0-native-fb-1d163962-20250802\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-d3b26b29-20250804\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -19632,10 +19632,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5e5215c85b98c8329332a6289ce5b513>>
* @generated SignedSource<<03d634c412fde76107f253626b4b405e>>
*/
"use strict";
@@ -11242,11 +11242,11 @@ function updateContainer(element, container, parentComponent, callback) {
return lane;
}
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-1d163962-20250802" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-d3b26b29-20250804" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.2.0-native-fb-1d163962-20250802\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-d3b26b29-20250804\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -11296,10 +11296,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1293 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1293.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<9464d603dcac0a12864778870377d27d>>
* @generated SignedSource<<7f3b4d69cc1295616bcf6a34c925abf7>>
*/
"use strict";
@@ -13160,11 +13160,11 @@ function updateContainer(element, container, parentComponent, callback) {
return lane;
}
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-1d163962-20250802" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-d3b26b29-20250804" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.2.0-native-fb-1d163962-20250802\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-d3b26b29-20250804\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -13214,10 +13214,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1528 = {
bundleType: 0,
version: "19.2.0-native-fb-1d163962-20250802",
version: "19.2.0-native-fb-d3b26b29-20250804",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-1d163962-20250802"
reconcilerVersion: "19.2.0-native-fb-d3b26b29-20250804"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1528.rendererConfig = extraDevToolsConfig);
@@ -12,7 +12,7 @@
* @lightSyntaxTransform
* @preventMunge
* @oncall react_core
* @generated SignedSource<<34c18c334bdeb44700e0ea0de8913de7>>
* @generated SignedSource<<4e37e896f362a0c21f96d8e6c65897ba>>
*/
'use strict';
@@ -30872,6 +30872,7 @@ const EnvironmentConfigSchema = zod.z.object({
validateRefAccessDuringRender: zod.z.boolean().default(true),
validateNoSetStateInRender: zod.z.boolean().default(true),
validateNoSetStateInEffects: zod.z.boolean().default(false),
validateNoDerivedComputationsInEffects: zod.z.boolean().default(false),
validateNoJSXInTryStatements: zod.z.boolean().default(false),
validateStaticComponents: zod.z.boolean().default(false),
validateMemoizedEffectDependencies: zod.z.boolean().default(false),
@@ -51051,6 +51052,167 @@ function validateNoFreezingKnownMutableFunctions(fn) {
return errors.asResult();
}
function validateNoDerivedComputationsInEffects(fn) {
const candidateDependencies = new Map();
const functions = new Map();
const locals = new Map();
const errors = new CompilerError();
for (const block of fn.body.blocks.values()) {
for (const instr of block.instructions) {
const { lvalue, value } = instr;
if (value.kind === 'LoadLocal') {
locals.set(lvalue.identifier.id, value.place.identifier.id);
}
else if (value.kind === 'ArrayExpression') {
candidateDependencies.set(lvalue.identifier.id, value);
}
else if (value.kind === 'FunctionExpression') {
functions.set(lvalue.identifier.id, value);
}
else if (value.kind === 'CallExpression' ||
value.kind === 'MethodCall') {
const callee = value.kind === 'CallExpression' ? value.callee : value.property;
if (isUseEffectHookType(callee.identifier) &&
value.args.length === 2 &&
value.args[0].kind === 'Identifier' &&
value.args[1].kind === 'Identifier') {
const effectFunction = functions.get(value.args[0].identifier.id);
const deps = candidateDependencies.get(value.args[1].identifier.id);
if (effectFunction != null &&
deps != null &&
deps.elements.length !== 0 &&
deps.elements.every(element => element.kind === 'Identifier')) {
const dependencies = deps.elements.map(dep => {
var _a;
CompilerError.invariant(dep.kind === 'Identifier', {
reason: `Dependency is checked as a place above`,
loc: value.loc,
});
return (_a = locals.get(dep.identifier.id)) !== null && _a !== void 0 ? _a : dep.identifier.id;
});
validateEffect(effectFunction.loweredFunc.func, dependencies, errors);
}
}
}
}
}
if (errors.hasErrors()) {
throw errors;
}
}
function validateEffect(effectFunction, effectDeps, errors) {
for (const operand of effectFunction.context) {
if (isSetStateType(operand.identifier)) {
continue;
}
else if (effectDeps.find(dep => dep === operand.identifier.id) != null) {
continue;
}
else {
return;
}
}
for (const dep of effectDeps) {
if (effectFunction.context.find(operand => operand.identifier.id === dep) ==
null) {
return;
}
}
const seenBlocks = new Set();
const values = new Map();
for (const dep of effectDeps) {
values.set(dep, [dep]);
}
const setStateLocations = [];
for (const block of effectFunction.body.blocks.values()) {
for (const pred of block.preds) {
if (!seenBlocks.has(pred)) {
return;
}
}
for (const phi of block.phis) {
const aggregateDeps = new Set();
for (const operand of phi.operands.values()) {
const deps = values.get(operand.identifier.id);
if (deps != null) {
for (const dep of deps) {
aggregateDeps.add(dep);
}
}
}
if (aggregateDeps.size !== 0) {
values.set(phi.place.identifier.id, Array.from(aggregateDeps));
}
}
for (const instr of block.instructions) {
switch (instr.value.kind) {
case 'Primitive':
case 'JSXText':
case 'LoadGlobal': {
break;
}
case 'LoadLocal': {
const deps = values.get(instr.value.place.identifier.id);
if (deps != null) {
values.set(instr.lvalue.identifier.id, deps);
}
break;
}
case 'ComputedLoad':
case 'PropertyLoad':
case 'BinaryExpression':
case 'TemplateLiteral':
case 'CallExpression':
case 'MethodCall': {
const aggregateDeps = new Set();
for (const operand of eachInstructionValueOperand(instr.value)) {
const deps = values.get(operand.identifier.id);
if (deps != null) {
for (const dep of deps) {
aggregateDeps.add(dep);
}
}
}
if (aggregateDeps.size !== 0) {
values.set(instr.lvalue.identifier.id, Array.from(aggregateDeps));
}
if (instr.value.kind === 'CallExpression' &&
isSetStateType(instr.value.callee.identifier) &&
instr.value.args.length === 1 &&
instr.value.args[0].kind === 'Identifier') {
const deps = values.get(instr.value.args[0].identifier.id);
if (deps != null && new Set(deps).size === effectDeps.length) {
setStateLocations.push(instr.value.callee.loc);
}
else {
return;
}
}
break;
}
default: {
return;
}
}
}
for (const operand of eachTerminalOperand(block.terminal)) {
if (values.has(operand.identifier.id)) {
return;
}
}
seenBlocks.add(block.id);
}
for (const loc of setStateLocations) {
errors.push({
reason: 'Values derived from props and state should be calculated during render, not in an effect. (https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state)',
description: null,
severity: ErrorSeverity.InvalidReact,
loc,
suggestions: null,
});
}
}
function run(func, config, fnType, mode, programContext, logger, filename, code) {
var _a, _b;
const contextIdentifiers = findContextIdentifiers(func);
@@ -51173,6 +51335,9 @@ function runWithEnvironment(func, env) {
if (env.config.validateNoSetStateInRender) {
validateNoSetStateInRender(hir).unwrap();
}
if (env.config.validateNoDerivedComputationsInEffects) {
validateNoDerivedComputationsInEffects(hir);
}
if (env.config.validateNoSetStateInEffects) {
env.logErrors(validateNoSetStateInEffects(hir));
}
@@ -6,7 +6,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @generated SignedSource<<8b1b8f2145063e8c59277e8766b3c225>>
* @generated SignedSource<<b10c4f3a1d9f07318577eb58ae4b8549>>
*/
'use strict';
@@ -30651,6 +30651,7 @@ const EnvironmentConfigSchema = zod.z.object({
validateRefAccessDuringRender: zod.z.boolean().default(true),
validateNoSetStateInRender: zod.z.boolean().default(true),
validateNoSetStateInEffects: zod.z.boolean().default(false),
validateNoDerivedComputationsInEffects: zod.z.boolean().default(false),
validateNoJSXInTryStatements: zod.z.boolean().default(false),
validateStaticComponents: zod.z.boolean().default(false),
validateMemoizedEffectDependencies: zod.z.boolean().default(false),
@@ -50830,6 +50831,167 @@ function validateNoFreezingKnownMutableFunctions(fn) {
return errors.asResult();
}
function validateNoDerivedComputationsInEffects(fn) {
const candidateDependencies = new Map();
const functions = new Map();
const locals = new Map();
const errors = new CompilerError();
for (const block of fn.body.blocks.values()) {
for (const instr of block.instructions) {
const { lvalue, value } = instr;
if (value.kind === 'LoadLocal') {
locals.set(lvalue.identifier.id, value.place.identifier.id);
}
else if (value.kind === 'ArrayExpression') {
candidateDependencies.set(lvalue.identifier.id, value);
}
else if (value.kind === 'FunctionExpression') {
functions.set(lvalue.identifier.id, value);
}
else if (value.kind === 'CallExpression' ||
value.kind === 'MethodCall') {
const callee = value.kind === 'CallExpression' ? value.callee : value.property;
if (isUseEffectHookType(callee.identifier) &&
value.args.length === 2 &&
value.args[0].kind === 'Identifier' &&
value.args[1].kind === 'Identifier') {
const effectFunction = functions.get(value.args[0].identifier.id);
const deps = candidateDependencies.get(value.args[1].identifier.id);
if (effectFunction != null &&
deps != null &&
deps.elements.length !== 0 &&
deps.elements.every(element => element.kind === 'Identifier')) {
const dependencies = deps.elements.map(dep => {
var _a;
CompilerError.invariant(dep.kind === 'Identifier', {
reason: `Dependency is checked as a place above`,
loc: value.loc,
});
return (_a = locals.get(dep.identifier.id)) !== null && _a !== void 0 ? _a : dep.identifier.id;
});
validateEffect(effectFunction.loweredFunc.func, dependencies, errors);
}
}
}
}
}
if (errors.hasErrors()) {
throw errors;
}
}
function validateEffect(effectFunction, effectDeps, errors) {
for (const operand of effectFunction.context) {
if (isSetStateType(operand.identifier)) {
continue;
}
else if (effectDeps.find(dep => dep === operand.identifier.id) != null) {
continue;
}
else {
return;
}
}
for (const dep of effectDeps) {
if (effectFunction.context.find(operand => operand.identifier.id === dep) ==
null) {
return;
}
}
const seenBlocks = new Set();
const values = new Map();
for (const dep of effectDeps) {
values.set(dep, [dep]);
}
const setStateLocations = [];
for (const block of effectFunction.body.blocks.values()) {
for (const pred of block.preds) {
if (!seenBlocks.has(pred)) {
return;
}
}
for (const phi of block.phis) {
const aggregateDeps = new Set();
for (const operand of phi.operands.values()) {
const deps = values.get(operand.identifier.id);
if (deps != null) {
for (const dep of deps) {
aggregateDeps.add(dep);
}
}
}
if (aggregateDeps.size !== 0) {
values.set(phi.place.identifier.id, Array.from(aggregateDeps));
}
}
for (const instr of block.instructions) {
switch (instr.value.kind) {
case 'Primitive':
case 'JSXText':
case 'LoadGlobal': {
break;
}
case 'LoadLocal': {
const deps = values.get(instr.value.place.identifier.id);
if (deps != null) {
values.set(instr.lvalue.identifier.id, deps);
}
break;
}
case 'ComputedLoad':
case 'PropertyLoad':
case 'BinaryExpression':
case 'TemplateLiteral':
case 'CallExpression':
case 'MethodCall': {
const aggregateDeps = new Set();
for (const operand of eachInstructionValueOperand(instr.value)) {
const deps = values.get(operand.identifier.id);
if (deps != null) {
for (const dep of deps) {
aggregateDeps.add(dep);
}
}
}
if (aggregateDeps.size !== 0) {
values.set(instr.lvalue.identifier.id, Array.from(aggregateDeps));
}
if (instr.value.kind === 'CallExpression' &&
isSetStateType(instr.value.callee.identifier) &&
instr.value.args.length === 1 &&
instr.value.args[0].kind === 'Identifier') {
const deps = values.get(instr.value.args[0].identifier.id);
if (deps != null && new Set(deps).size === effectDeps.length) {
setStateLocations.push(instr.value.callee.loc);
}
else {
return;
}
}
break;
}
default: {
return;
}
}
}
for (const operand of eachTerminalOperand(block.terminal)) {
if (values.has(operand.identifier.id)) {
return;
}
}
seenBlocks.add(block.id);
}
for (const loc of setStateLocations) {
errors.push({
reason: 'Values derived from props and state should be calculated during render, not in an effect. (https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state)',
description: null,
severity: ErrorSeverity.InvalidReact,
loc,
suggestions: null,
});
}
}
function run(func, config, fnType, mode, programContext, logger, filename, code) {
var _a, _b;
const contextIdentifiers = findContextIdentifiers(func);
@@ -50952,6 +51114,9 @@ function runWithEnvironment(func, env) {
if (env.config.validateNoSetStateInRender) {
validateNoSetStateInRender(hir).unwrap();
}
if (env.config.validateNoDerivedComputationsInEffects) {
validateNoDerivedComputationsInEffects(hir);
}
if (env.config.validateNoSetStateInEffects) {
env.logErrors(validateNoSetStateInEffects(hir));
}
@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-react-hooks",
"description": "ESLint rules for React Hooks",
"version": "0.0.0-experimental-1d163962-20250802",
"version": "0.0.0-experimental-d3b26b29-20250804",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",