From 97ab71aa8a21f1f71db4010bdfcee48ad4c36712 Mon Sep 17 00:00:00 2001 From: josephsavona Date: Tue, 9 Sep 2025 14:14:52 -0700 Subject: [PATCH] [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();
{ 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 [acada3035fe2a0dacfafc0ad78914e77d11fb823](https://github.com/facebook/react/commit/acada3035fe2a0dacfafc0ad78914e77d11fb823) --- compiled-rn/VERSION_NATIVE_FB | 2 +- .../react/react-dom/cjs/ReactDOM-dev.js | 4 +- .../react/react-dom/cjs/ReactDOM-prod.js | 4 +- .../react/react-dom/cjs/ReactDOM-profiling.js | 4 +- .../react/react-dom/cjs/ReactDOMClient-dev.js | 12 ++-- .../react-dom/cjs/ReactDOMClient-prod.js | 12 ++-- .../react-dom/cjs/ReactDOMClient-profiling.js | 12 ++-- .../react-dom/cjs/ReactDOMProfiling-dev.js | 12 ++-- .../react-dom/cjs/ReactDOMProfiling-prod.js | 12 ++-- .../cjs/ReactDOMProfiling-profiling.js | 12 ++-- .../cjs/ReactTestRenderer-dev.js | 8 +-- .../cjs/ReactTestRenderer-prod.js | 8 +-- .../cjs/ReactTestRenderer-profiling.js | 8 +-- .../vendor/react/react/cjs/React-dev.js | 4 +- .../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 | 6 +- .../implementations/ReactFabric-prod.fb.js | 6 +- .../ReactFabric-profiling.fb.js | 6 +- .../ReactNativeRenderer-dev.fb.js | 10 +-- .../ReactNativeRenderer-prod.fb.js | 10 +-- .../ReactNativeRenderer-profiling.fb.js | 10 +-- .../eslint-plugin-react-hooks.development.js | 68 ++++++++++++------- .../eslint-plugin-react-hooks.production.js | 68 ++++++++++++------- .../eslint-plugin-react-hooks/package.json | 2 +- 26 files changed, 177 insertions(+), 133 deletions(-) diff --git a/compiled-rn/VERSION_NATIVE_FB b/compiled-rn/VERSION_NATIVE_FB index 010ab194f9..350461443e 100644 --- a/compiled-rn/VERSION_NATIVE_FB +++ b/compiled-rn/VERSION_NATIVE_FB @@ -1 +1 @@ -19.2.0-native-fb-665de2ed-20250909 \ No newline at end of file +19.2.0-native-fb-acada303-20250909 \ 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 56c33e7657..cd08d5efb3 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,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"; })(); 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 75e82a7d01..587114dbc1 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<<114adfe24e5ff7db94c10c8751b8e702>> + * @generated SignedSource<> */ "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"; 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 75e82a7d01..587114dbc1 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<<114adfe24e5ff7db94c10c8751b8e702>> + * @generated SignedSource<> */ "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"; 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 ff65dcf849..13e2f8645e 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<<8283f5909d9518bf936f9009ae20f199>> + * @generated SignedSource<> */ /* @@ -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"; })(); diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js index e3b6e85b77..9eba35492a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js @@ -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"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js index 992e5e4457..7d812a0cc1 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js @@ -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"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js index 67d15d1588..c8c894eec5 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js @@ -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 && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js index 0c94d967e6..b4ff5d6570 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js @@ -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"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js index 742bd07fea..8e17ee97dd 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js @@ -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 && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js index 03168e5d60..2d2f9e00be 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "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"; })(); diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js index 4c6f5eeabe..c8004eabaf 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -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"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 0ff028b0f9..0af3561f61 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @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"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js index 04e9dfcfff..21e77dd69c 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js @@ -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 && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js index eb1cf1ff3b..5aacfe467d 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js @@ -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"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js index 1c54ab6bdb..ac75ede6fd 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "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 && diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index 8f5cc50709..7708ce585a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -665de2ed283205fccecda649ae2d66f62983f15f +acada3035fe2a0dacfafc0ad78914e77d11fb823 diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index a1c08decd9..eaa5d4c69c 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "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); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 72760edf20..0cf02a012a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<91de8b0793c434edc1ca7d702cb7ba1a>> + * @generated SignedSource<> */ "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); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index 3c85b47c92..62524ec77a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @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); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 2b6f1c2f50..f81377a1af 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<3cc83dbec0b55ccaa36d7c1ba1bf27ce>> + * @generated SignedSource<> */ "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); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index eee2476ce2..de80901eed 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -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); diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index 185ec8374c..d9be02a4a1 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @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); diff --git a/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js b/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js index 6da4b04aee..2d564f8fed 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +++ b/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js @@ -12,7 +12,7 @@ * @lightSyntaxTransform * @preventMunge * @oncall react_core - * @generated SignedSource<<86801b386ac250b9135b01fcdf6eceba>> + * @generated SignedSource<> */ '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) { diff --git a/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js b/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js index 5e65d6304e..8dc489a369 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +++ b/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js @@ -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<> + * @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) { diff --git a/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/package.json b/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/package.json index b4d9504de9..3bea70d960 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/package.json +++ b/compiled-rn/facebook-fbsource/xplat/js/tools/eslint-plugin-react-hooks/package.json @@ -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",