[compiler] Fix false positive hook return mutation error (#34424)

This was fun. We previously added the MaybeAlias effect in #33984 in
order to describe the semantic that an unknown function call _may_ alias
its return value in its result, but that we don't know this for sure. We
record mutations through MaybeAlias edges when walking backward in the
data flow graph, but downgrade them to conditional mutations. See the
original PR for full context.

That change was sufficient for the original case like

```js
const frozen = useContext();
useEffect(() => {
  frozen.method().property = true;
}, [...]);
```

But it wasn't sufficient for cases where the aliasing occured between
operands:

```js
const dispatch = useDispatch();
<div onClick={(e) => {
  dispatch(...e.target.value)
  e.target.value = ...;
}} />
```

Here we would record a `Capture dispatch <- e.target` effect. Then
during processing of the `event.target.value = ...` assignment we'd
eventually _forward_ from `event` to `dispatch` (along a MaybeAlias
edge). But in #33984 I missed that this forward walk also has to
downgrade to conditional.

In addition to that change, we also have to be a bit more precise about
which set of effects we create for alias/capture/maybe-alias. The new
logic is a bit clearer, I think:

* If the value is frozen, it's an ImmutableCapture edge
* If the values are mutable, it's a Capture
* If it's a context->context, context->mutable, or mutable->context,
count it as MaybeAlias.

DiffTrain build for [acada3035f](https://github.com/facebook/react/commit/acada3035fe2a0dacfafc0ad78914e77d11fb823)
This commit is contained in:
josephsavona
2025-09-09 14:14:52 -07:00
parent abd4b80d40
commit 97ab71aa8a
26 changed files with 177 additions and 133 deletions
+1 -1
View File
@@ -1 +1 @@
19.2.0-native-fb-665de2ed-20250909
19.2.0-native-fb-acada303-20250909
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4eec5811e289a0cc9597753f42d814e6>>
* @generated SignedSource<<5574295a2fffcbdd7216f804329aefa3>>
*/
"use strict";
@@ -404,5 +404,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<114adfe24e5ff7db94c10c8751b8e702>>
* @generated SignedSource<<a7086e3488daef2b3d7a49d9da1c6e6c>>
*/
"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-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<114adfe24e5ff7db94c10c8751b8e702>>
* @generated SignedSource<<a7086e3488daef2b3d7a49d9da1c6e6c>>
*/
"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-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<8283f5909d9518bf936f9009ae20f199>>
* @generated SignedSource<<db999cfe502a424baf983d833cb52458>>
*/
/*
@@ -29580,11 +29580,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-665de2ed-20250909" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-acada303-20250909" !== 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-665de2ed-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-native-fb-acada303-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -29621,10 +29621,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -29773,5 +29773,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<47fe53605b0e750c7434d295233dd627>>
* @generated SignedSource<<24bfa27418a31e97d7f5d18c1d78ada9>>
*/
/*
@@ -17388,14 +17388,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2057 = React.version;
if (
"19.2.0-native-fb-665de2ed-20250909" !==
"19.2.0-native-fb-acada303-20250909" !==
isomorphicReactPackageVersion$jscomp$inline_2057
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2057,
"19.2.0-native-fb-665de2ed-20250909"
"19.2.0-native-fb-acada303-20250909"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17417,10 +17417,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2630 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2631 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17527,4 +17527,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<06ded55c7bf6ff384642a96c765ea32f>>
* @generated SignedSource<<410c9eb4005371eb2099ccf2ccd79036>>
*/
/*
@@ -19398,14 +19398,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2308 = React.version;
if (
"19.2.0-native-fb-665de2ed-20250909" !==
"19.2.0-native-fb-acada303-20250909" !==
isomorphicReactPackageVersion$jscomp$inline_2308
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2308,
"19.2.0-native-fb-665de2ed-20250909"
"19.2.0-native-fb-acada303-20250909"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19427,10 +19427,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2315 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909",
reconcilerVersion: "19.2.0-native-fb-acada303-20250909",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$324 = 0;
@@ -19553,4 +19553,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<45ee4505ee1b5773958a9b13551faa02>>
* @generated SignedSource<<0aa22a809d1bf5ee48537bd1f47d39b6>>
*/
/*
@@ -29636,11 +29636,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-665de2ed-20250909" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-acada303-20250909" !== 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-665de2ed-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-native-fb-acada303-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -29677,10 +29677,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30145,7 +30145,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2d6207a0e2841f0d8ecf263361edcdb4>>
* @generated SignedSource<<1c441878bcb6366039b2be6739fa9e9a>>
*/
/*
@@ -17399,14 +17399,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2058 = React.version;
if (
"19.2.0-native-fb-665de2ed-20250909" !==
"19.2.0-native-fb-acada303-20250909" !==
isomorphicReactPackageVersion$jscomp$inline_2058
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2058,
"19.2.0-native-fb-665de2ed-20250909"
"19.2.0-native-fb-acada303-20250909"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17428,10 +17428,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2633 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2634 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17691,4 +17691,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<1112946c2dda066c6cbcc5b9b953b1ba>>
* @generated SignedSource<<0d4ea1a53add816963156d530eff95a8>>
*/
/*
@@ -19413,14 +19413,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2309 = React.version;
if (
"19.2.0-native-fb-665de2ed-20250909" !==
"19.2.0-native-fb-acada303-20250909" !==
isomorphicReactPackageVersion$jscomp$inline_2309
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2309,
"19.2.0-native-fb-665de2ed-20250909"
"19.2.0-native-fb-acada303-20250909"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19442,10 +19442,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2316 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909",
reconcilerVersion: "19.2.0-native-fb-acada303-20250909",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$324 = 0;
@@ -19721,7 +19721,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b2109dbfe8a4be786224a1f431d2ba84>>
* @generated SignedSource<<c63be7ce3c0b49edbe6e932969f4be23>>
*/
"use strict";
@@ -15881,10 +15881,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16029,5 +16029,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<14668f2a88027c74e036af72f81cec51>>
* @generated SignedSource<<6025031dfbbde4eb834234dcea614c3d>>
*/
"use strict";
@@ -10045,10 +10045,10 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1469 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1470 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10184,4 +10184,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<dff03746eb9bcb7ab9bb04928fce704d>>
* @generated SignedSource<<3d64f0c5c793946b8bfa35f57fb62814>>
*/
"use strict";
@@ -10666,10 +10666,10 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1260 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909",
reconcilerVersion: "19.2.0-native-fb-acada303-20250909",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$145 = 0;
@@ -10820,4 +10820,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<937d95fd9642a70729b4fe29e8e4e5ba>>
* @generated SignedSource<<46aa73f9986563db3a3ec38bb2ea0c94>>
*/
"use strict";
@@ -1397,7 +1397,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<30acab9cc3593087f175e0f8bf7657f1>>
* @generated SignedSource<<7e1a50827d8c57dccdd0e26fa2363fe4>>
*/
"use strict";
@@ -579,4 +579,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<bda2e7de0c61150d6d87d4ebf3844334>>
* @generated SignedSource<<aa3ffa43acf0b7f157bee35b73f8e0cf>>
*/
"use strict";
@@ -583,7 +583,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.2.0-native-fb-665de2ed-20250909";
exports.version = "19.2.0-native-fb-acada303-20250909";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -1 +1 @@
665de2ed283205fccecda649ae2d66f62983f15f
acada3035fe2a0dacfafc0ad78914e77d11fb823
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<f9c2529fedcfde3a922f9e9efb7f904f>>
* @generated SignedSource<<dd4aefc182db4ed5aff5343b4d5573b6>>
*/
"use strict";
@@ -19705,10 +19705,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<91de8b0793c434edc1ca7d702cb7ba1a>>
* @generated SignedSource<<e751d22b76ced019d12b0deaf16d2f49>>
*/
"use strict";
@@ -11211,10 +11211,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1281 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1281.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e60f7701c70879c71054cad95087a686>>
* @generated SignedSource<<81a0c91c74a9851d37293e0e45f92570>>
*/
"use strict";
@@ -13162,10 +13162,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1525 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1525.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<3cc83dbec0b55ccaa36d7c1ba1bf27ce>>
* @generated SignedSource<<b15c0be08aa09092a957cc81f4cb8eb2>>
*/
"use strict";
@@ -19985,11 +19985,11 @@ __DEV__ &&
shouldSuspendImpl = newShouldSuspendImpl;
};
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-665de2ed-20250909" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-acada303-20250909" !== 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-665de2ed-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-acada303-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -20015,10 +20015,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4fb30a55685d773037015b4f3faf3665>>
* @generated SignedSource<<20ae2fb92edbed5348ff2f63c998aba1>>
*/
"use strict";
@@ -11370,11 +11370,11 @@ function updateContainer(element, container, parentComponent, callback) {
return lane;
}
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-665de2ed-20250909" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-acada303-20250909" !== 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-665de2ed-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-acada303-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -11424,10 +11424,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1312 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1312.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e4519b88ce07656ec0c1e9ded245b8d2>>
* @generated SignedSource<<2f17e647accea17be3d1a72a0145339f>>
*/
"use strict";
@@ -13311,11 +13311,11 @@ function updateContainer(element, container, parentComponent, callback) {
return lane;
}
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-665de2ed-20250909" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-acada303-20250909" !== 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-665de2ed-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-acada303-20250909\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -13365,10 +13365,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1556 = {
bundleType: 0,
version: "19.2.0-native-fb-665de2ed-20250909",
version: "19.2.0-native-fb-acada303-20250909",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-665de2ed-20250909"
reconcilerVersion: "19.2.0-native-fb-acada303-20250909"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1556.rendererConfig = extraDevToolsConfig);
@@ -12,7 +12,7 @@
* @lightSyntaxTransform
* @preventMunge
* @oncall react_core
* @generated SignedSource<<86801b386ac250b9135b01fcdf6eceba>>
* @generated SignedSource<<d1a4a4ca9738d7c1b3ac9a79a7d0b9a8>>
*/
'use strict';
@@ -40871,9 +40871,12 @@ function applyEffect(context, state, _effect, initialized, effects) {
case 'MaybeAlias':
case 'Alias':
case 'Capture': {
CompilerError.invariant(effect.kind === 'Capture' || initialized.has(effect.into.identifier.id), {
reason: `Expected destination value to already be initialized within this instruction for Alias effect`,
description: `Destination ${printPlace(effect.into)} is not initialized in this instruction`,
CompilerError.invariant(effect.kind === 'Capture' ||
effect.kind === 'MaybeAlias' ||
initialized.has(effect.into.identifier.id), {
reason: `Expected destination to already be initialized within this instruction`,
description: `Destination ${printPlace(effect.into)} is not initialized in this ` +
`instruction for effect ${printAliasingEffect(effect)}`,
details: [
{
kind: 'error',
@@ -40883,44 +40886,53 @@ function applyEffect(context, state, _effect, initialized, effects) {
],
});
const intoKind = state.kind(effect.into).kind;
let isMutableDesination;
let destinationType = null;
switch (intoKind) {
case ValueKind.Context:
case ValueKind.Mutable:
case ValueKind.MaybeFrozen: {
isMutableDesination = true;
case ValueKind.Context: {
destinationType = 'context';
break;
}
default: {
isMutableDesination = false;
case ValueKind.Mutable:
case ValueKind.MaybeFrozen: {
destinationType = 'mutable';
break;
}
}
const fromKind = state.kind(effect.from).kind;
let isMutableReferenceType;
let sourceType = null;
switch (fromKind) {
case ValueKind.Context: {
sourceType = 'context';
break;
}
case ValueKind.Global:
case ValueKind.Primitive: {
isMutableReferenceType = false;
break;
}
case ValueKind.Frozen: {
isMutableReferenceType = false;
applyEffect(context, state, {
kind: 'ImmutableCapture',
from: effect.from,
into: effect.into,
}, initialized, effects);
sourceType = 'frozen';
break;
}
default: {
isMutableReferenceType = true;
sourceType = 'mutable';
break;
}
}
if (isMutableDesination && isMutableReferenceType) {
if (sourceType === 'frozen') {
applyEffect(context, state, {
kind: 'ImmutableCapture',
from: effect.from,
into: effect.into,
}, initialized, effects);
}
else if ((sourceType === 'mutable' && destinationType === 'mutable') ||
effect.kind === 'MaybeAlias') {
effects.push(effect);
}
else if ((sourceType === 'context' && destinationType != null) ||
(sourceType === 'mutable' && destinationType === 'context')) {
applyEffect(context, state, { kind: 'MaybeAlias', from: effect.from, into: effect.into }, initialized, effects);
}
break;
}
case 'Assign': {
@@ -44120,7 +44132,12 @@ class AliasingState {
if (edge.index >= index) {
break;
}
queue.push({ place: edge.node, transitive, direction: 'forwards', kind });
queue.push({
place: edge.node,
transitive,
direction: 'forwards',
kind: edge.kind === 'maybeAlias' ? MutationKind.Conditional : kind,
});
}
for (const [alias, when] of node.createdFrom) {
if (when >= index) {
@@ -44138,7 +44155,12 @@ class AliasingState {
if (when >= index) {
continue;
}
queue.push({ place: alias, transitive, direction: 'backwards', kind });
queue.push({
place: alias,
transitive,
direction: 'backwards',
kind,
});
}
for (const [alias, when] of node.maybeAliases) {
if (when >= index) {
@@ -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<<f6737d36b6bb79d1b99ebe7f70fb14b8>>
* @generated SignedSource<<90a8f315ff9621e5c0c789808fc69b53>>
*/
'use strict';
@@ -40650,9 +40650,12 @@ function applyEffect(context, state, _effect, initialized, effects) {
case 'MaybeAlias':
case 'Alias':
case 'Capture': {
CompilerError.invariant(effect.kind === 'Capture' || initialized.has(effect.into.identifier.id), {
reason: `Expected destination value to already be initialized within this instruction for Alias effect`,
description: `Destination ${printPlace(effect.into)} is not initialized in this instruction`,
CompilerError.invariant(effect.kind === 'Capture' ||
effect.kind === 'MaybeAlias' ||
initialized.has(effect.into.identifier.id), {
reason: `Expected destination to already be initialized within this instruction`,
description: `Destination ${printPlace(effect.into)} is not initialized in this ` +
`instruction for effect ${printAliasingEffect(effect)}`,
details: [
{
kind: 'error',
@@ -40662,44 +40665,53 @@ function applyEffect(context, state, _effect, initialized, effects) {
],
});
const intoKind = state.kind(effect.into).kind;
let isMutableDesination;
let destinationType = null;
switch (intoKind) {
case ValueKind.Context:
case ValueKind.Mutable:
case ValueKind.MaybeFrozen: {
isMutableDesination = true;
case ValueKind.Context: {
destinationType = 'context';
break;
}
default: {
isMutableDesination = false;
case ValueKind.Mutable:
case ValueKind.MaybeFrozen: {
destinationType = 'mutable';
break;
}
}
const fromKind = state.kind(effect.from).kind;
let isMutableReferenceType;
let sourceType = null;
switch (fromKind) {
case ValueKind.Context: {
sourceType = 'context';
break;
}
case ValueKind.Global:
case ValueKind.Primitive: {
isMutableReferenceType = false;
break;
}
case ValueKind.Frozen: {
isMutableReferenceType = false;
applyEffect(context, state, {
kind: 'ImmutableCapture',
from: effect.from,
into: effect.into,
}, initialized, effects);
sourceType = 'frozen';
break;
}
default: {
isMutableReferenceType = true;
sourceType = 'mutable';
break;
}
}
if (isMutableDesination && isMutableReferenceType) {
if (sourceType === 'frozen') {
applyEffect(context, state, {
kind: 'ImmutableCapture',
from: effect.from,
into: effect.into,
}, initialized, effects);
}
else if ((sourceType === 'mutable' && destinationType === 'mutable') ||
effect.kind === 'MaybeAlias') {
effects.push(effect);
}
else if ((sourceType === 'context' && destinationType != null) ||
(sourceType === 'mutable' && destinationType === 'context')) {
applyEffect(context, state, { kind: 'MaybeAlias', from: effect.from, into: effect.into }, initialized, effects);
}
break;
}
case 'Assign': {
@@ -43899,7 +43911,12 @@ class AliasingState {
if (edge.index >= index) {
break;
}
queue.push({ place: edge.node, transitive, direction: 'forwards', kind });
queue.push({
place: edge.node,
transitive,
direction: 'forwards',
kind: edge.kind === 'maybeAlias' ? MutationKind.Conditional : kind,
});
}
for (const [alias, when] of node.createdFrom) {
if (when >= index) {
@@ -43917,7 +43934,12 @@ class AliasingState {
if (when >= index) {
continue;
}
queue.push({ place: alias, transitive, direction: 'backwards', kind });
queue.push({
place: alias,
transitive,
direction: 'backwards',
kind,
});
}
for (const [alias, when] of node.maybeAliases) {
if (when >= index) {
@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-react-hooks",
"description": "ESLint rules for React Hooks",
"version": "0.0.0-experimental-665de2ed-20250909",
"version": "0.0.0-experimental-acada303-20250909",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",