From 31e777b1b6468f1893ecae486500758eefd30f27 Mon Sep 17 00:00:00 2001 From: josephsavona Date: Fri, 2 May 2025 17:15:46 -0700 Subject: [PATCH] [compiler] ValidatePreservedManualMemoization reports detailed errors This pass didn't previously report the precise difference btw inferred/manual dependencies unless a debug flag was set. But the error message is really good (nice job mofeiz): the only catch is that in theory the inferred dep could be a temporary that can't trivially be reported to the user. But the messages are really useful for quickly verifying why the compiler couldn't preserve memoization. So here we switch to outputting a detailed message about the discrepancy btw inferred/manual deps so long as the inferred dep root is a named variable. I also slightly adjusted the message to handle the case where there is no diagnostic, which can occur if there were no manual deps but the compiler inferred a dependency. ghstack-source-id: 534f6f1fec0855e05e85077eba050eb2ba254ef8 Pull Request resolved: https://github.com/facebook/react/pull/33095 DiffTrain build for [73d7e816b7746c700ab843964aaf11c17351fac1](https://github.com/facebook/react/commit/73d7e816b7746c700ab843964aaf11c17351fac1) --- 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 | 47 +++++++++++++++++-- .../eslint-plugin-react-hooks.production.js | 47 +++++++++++++++++-- .../eslint-plugin-react-hooks/package.json | 2 +- 26 files changed, 171 insertions(+), 97 deletions(-) diff --git a/compiled-rn/VERSION_NATIVE_FB b/compiled-rn/VERSION_NATIVE_FB index d6e28827bf..fcc56d11dd 100644 --- a/compiled-rn/VERSION_NATIVE_FB +++ b/compiled-rn/VERSION_NATIVE_FB @@ -1 +1 @@ -19.2.0-native-fb-ac2cae52-20250503 \ No newline at end of file +19.2.0-native-fb-73d7e816-20250503 \ 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 628577685d..3e8b16aa14 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<<3a8e713f412b3794cee2c3089ed3d3c2>> + * @generated SignedSource<> */ "use strict"; @@ -404,5 +404,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.2.0-native-fb-ac2cae52-20250503"; + exports.version = "19.2.0-native-fb-73d7e816-20250503"; })(); 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 2e41c30fe1..489acfad10 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<<6a8ce524bc621b2c0f8ab229a0f9eaf0>> + * @generated SignedSource<<1356d4b7847e2241f243d75788b823dc>> */ "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-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; 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 2e41c30fe1..489acfad10 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<<6a8ce524bc621b2c0f8ab229a0f9eaf0>> + * @generated SignedSource<<1356d4b7847e2241f243d75788b823dc>> */ "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-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; 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 3d3f75f17e..1761542de4 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<> + * @generated SignedSource<> */ /* @@ -26650,11 +26650,11 @@ __DEV__ && }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.2.0-native-fb-ac2cae52-20250503" !== isomorphicReactPackageVersion) + if ("19.2.0-native-fb-73d7e816-20250503" !== 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-ac2cae52-20250503\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.2.0-native-fb-73d7e816-20250503\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26691,10 +26691,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -26838,5 +26838,5 @@ __DEV__ && listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.2.0-native-fb-ac2cae52-20250503"; + exports.version = "19.2.0-native-fb-73d7e816-20250503"; })(); 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 23bededf18..093ca0b4bf 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<<6a7f6ee6e3e54d5c956e50d34914495a>> + * @generated SignedSource<<6d9d3190d467f241fb17f29ff0850020>> */ /* @@ -16748,14 +16748,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1904 = React.version; if ( - "19.2.0-native-fb-ac2cae52-20250503" !== + "19.2.0-native-fb-73d7e816-20250503" !== isomorphicReactPackageVersion$jscomp$inline_1904 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1904, - "19.2.0-native-fb-ac2cae52-20250503" + "19.2.0-native-fb-73d7e816-20250503" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16777,10 +16777,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2388 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2389 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16884,4 +16884,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.2.0-native-fb-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; 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 fb523d731b..af6e2690f8 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<> + * @generated SignedSource<> */ /* @@ -17457,14 +17457,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_2007 = React.version; if ( - "19.2.0-native-fb-ac2cae52-20250503" !== + "19.2.0-native-fb-73d7e816-20250503" !== isomorphicReactPackageVersion$jscomp$inline_2007 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_2007, - "19.2.0-native-fb-ac2cae52-20250503" + "19.2.0-native-fb-73d7e816-20250503" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -17486,10 +17486,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2014 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503", + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$305 = 0; @@ -17608,4 +17608,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.2.0-native-fb-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; 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 42f022aa57..6dde5cff4c 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<> + * @generated SignedSource<<8b4ad26c11c18be45d376afb6d7cf2d6>> */ /* @@ -26711,11 +26711,11 @@ __DEV__ && }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.2.0-native-fb-ac2cae52-20250503" !== isomorphicReactPackageVersion) + if ("19.2.0-native-fb-73d7e816-20250503" !== 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-ac2cae52-20250503\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.2.0-native-fb-73d7e816-20250503\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26752,10 +26752,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27215,7 +27215,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.2.0-native-fb-ac2cae52-20250503"; + exports.version = "19.2.0-native-fb-73d7e816-20250503"; "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 9b98a44d6f..a3d9378dc1 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<<184c3d14507009449d6281a2251dd50f>> + * @generated SignedSource<> */ /* @@ -16759,14 +16759,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_1905 = React.version; if ( - "19.2.0-native-fb-ac2cae52-20250503" !== + "19.2.0-native-fb-73d7e816-20250503" !== isomorphicReactPackageVersion$jscomp$inline_1905 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_1905, - "19.2.0-native-fb-ac2cae52-20250503" + "19.2.0-native-fb-73d7e816-20250503" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16788,10 +16788,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2391 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2392 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17049,4 +17049,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.2.0-native-fb-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; 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 47cf06a893..e3ddd0965b 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<<6bed75389bb636f888f94799d1e7e022>> + * @generated SignedSource<> */ /* @@ -17472,14 +17472,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { }; var isomorphicReactPackageVersion$jscomp$inline_2008 = React.version; if ( - "19.2.0-native-fb-ac2cae52-20250503" !== + "19.2.0-native-fb-73d7e816-20250503" !== isomorphicReactPackageVersion$jscomp$inline_2008 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_2008, - "19.2.0-native-fb-ac2cae52-20250503" + "19.2.0-native-fb-73d7e816-20250503" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -17501,10 +17501,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { }; var internals$jscomp$inline_2015 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503", + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$305 = 0; @@ -17777,7 +17777,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.2.0-native-fb-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; "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 0dcb4ab996..961b733a5b 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<<2d8c2ccd0c8b9504dc651fc1fc02fd73>> + * @generated SignedSource<<218a27c88420439d9243a0160c350659>> */ "use strict"; @@ -15630,10 +15630,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -15778,5 +15778,5 @@ __DEV__ && flushSyncWorkAcrossRoots_impl(0, !0)); } }; - exports.version = "19.2.0-native-fb-ac2cae52-20250503"; + exports.version = "19.2.0-native-fb-73d7e816-20250503"; })(); 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 0ecdad6578..672c99e7c6 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<> + * @generated SignedSource<> */ "use strict"; @@ -9885,10 +9885,10 @@ function wrapFiber(fiber) { } var internals$jscomp$inline_1439 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1440 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -10024,4 +10024,4 @@ exports.unstable_batchedUpdates = function (fn, a) { flushSyncWorkAcrossRoots_impl(0, !0)); } }; -exports.version = "19.2.0-native-fb-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; 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 d58fc220c9..a05bf05b5d 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<<3b0ba8c0b9fed96a41db1b427580e305>> + * @generated SignedSource<> */ "use strict"; @@ -10502,10 +10502,10 @@ function wrapFiber(fiber) { } var internals$jscomp$inline_1247 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503", + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$155 = 0; @@ -10656,4 +10656,4 @@ exports.unstable_batchedUpdates = function (fn, a) { flushSyncWorkAcrossRoots_impl(0, !0)); } }; -exports.version = "19.2.0-native-fb-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; 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 8c047f3426..507d484a21 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<<40b05f43a39445fc6bde13151a5a395a>> + * @generated SignedSource<<504484e273d1da549a13ed75a00fbcb1>> */ "use strict"; @@ -1412,7 +1412,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.2.0-native-fb-ac2cae52-20250503"; + exports.version = "19.2.0-native-fb-73d7e816-20250503"; "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 46f13ef140..01a5b323ae 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<<3dd6f3dc24d4b89bf026e341d634531a>> + * @generated SignedSource<<0e3c2be9f7cd5e3c3c24caf046f24430>> */ "use strict"; @@ -587,4 +587,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.2.0-native-fb-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; 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 ca41785788..e57342e136 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<<5d40ceda0635286a54100a4001cfa068>> */ "use strict"; @@ -591,7 +591,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.2.0-native-fb-ac2cae52-20250503"; +exports.version = "19.2.0-native-fb-73d7e816-20250503"; "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 4fedb4901c..9c3a55297c 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 @@ -ac2cae524576b8091a6d78d9ab05627053949df1 +73d7e816b7746c700ab843964aaf11c17351fac1 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 e8885c687d..68505ec16f 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<<1432ef8debf0338ec417b165da1596cd>> */ "use strict"; @@ -17469,10 +17469,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; 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 7191f1b558..931fef83ae 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<> + * @generated SignedSource<<73023b20a9732b247453c77f8fe08e63>> */ "use strict"; @@ -11210,10 +11210,10 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1251 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1251.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 d8f9f8cc2f..3d2faef2d6 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<<379595a5f286b9343623d2a926777951>> + * @generated SignedSource<> */ "use strict"; @@ -11911,10 +11911,10 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1352 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1352.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 b6d7ce6c91..ec11a856c9 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<<033aab756eac0a7f1dd9203c53b69aab>> + * @generated SignedSource<> */ "use strict"; @@ -17622,11 +17622,11 @@ __DEV__ && shouldSuspendImpl = newShouldSuspendImpl; }; var isomorphicReactPackageVersion = React.version; - if ("19.2.0-native-fb-ac2cae52-20250503" !== isomorphicReactPackageVersion) + if ("19.2.0-native-fb-73d7e816-20250503" !== 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-ac2cae52-20250503\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.2.0-native-fb-73d7e816-20250503\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -17652,10 +17652,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; 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 f464fd1898..4b68144732 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<<31a98c0952ee0b8c5644898aec3c1455>> + * @generated SignedSource<> */ "use strict"; @@ -11243,11 +11243,11 @@ function updateContainer(element, container, parentComponent, callback) { return lane; } var isomorphicReactPackageVersion = React.version; -if ("19.2.0-native-fb-ac2cae52-20250503" !== isomorphicReactPackageVersion) +if ("19.2.0-native-fb-73d7e816-20250503" !== 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-ac2cae52-20250503\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.2.0-native-fb-73d7e816-20250503\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_1299 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1299.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 9257b9f745..f1a5cf51a2 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<<2d05fcafa5382311e54e41a4f055f76d>> + * @generated SignedSource<<775d8bd1ee5333e8f984ee9021c2ece5>> */ "use strict"; @@ -11942,11 +11942,11 @@ function updateContainer(element, container, parentComponent, callback) { return lane; } var isomorphicReactPackageVersion = React.version; -if ("19.2.0-native-fb-ac2cae52-20250503" !== isomorphicReactPackageVersion) +if ("19.2.0-native-fb-73d7e816-20250503" !== 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-ac2cae52-20250503\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.2.0-native-fb-73d7e816-20250503\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11995,10 +11995,10 @@ batchedUpdatesImpl = function (fn, a) { var roots = new Map(), internals$jscomp$inline_1400 = { bundleType: 0, - version: "19.2.0-native-fb-ac2cae52-20250503", + version: "19.2.0-native-fb-73d7e816-20250503", rendererPackageName: "react-native-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.2.0-native-fb-ac2cae52-20250503" + reconcilerVersion: "19.2.0-native-fb-73d7e816-20250503" }; null !== extraDevToolsConfig && (internals$jscomp$inline_1400.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 491dd1c9a3..bbfa7f425f 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<<779cdaf32b30e64c4329b58f093932c0>> + * @generated SignedSource<<85ddb959da36c41b641d547b23d8c4d2>> */ 'use strict'; @@ -50011,7 +50011,7 @@ class ReactiveScopeDependencyTreeHIR { depCursor = nextDepCursor; hoistableCursor = nextHoistableCursor; } - depCursor.accessType = merge(depCursor.accessType, PropertyAccessType.OptionalDependency); + depCursor.accessType = merge$1(depCursor.accessType, PropertyAccessType.OptionalDependency); } deriveMinimalDependencies() { const results = new Set(); @@ -50069,7 +50069,7 @@ function isDependency(access) { return (access === PropertyAccessType.OptionalDependency || access === PropertyAccessType.UnconditionalDependency); } -function merge(access1, access2) { +function merge$1(access1, access2) { const resultIsUnconditional = !(isOptional(access1) && isOptional(access2)); const resultIsDependency = isDependency(access1) || isDependency(access2); if (resultIsUnconditional) { @@ -50126,7 +50126,7 @@ function makeOrMergeProperty(node, property, accessType) { node.properties.set(property, child); } else { - child.accessType = merge(child.accessType, accessType); + child.accessType = merge$1(child.accessType, accessType); } return child; } @@ -53320,6 +53320,17 @@ function validatePreservedManualMemoization(fn) { visitReactiveFunction(fn, new Visitor(), state); return state.errors.asResult(); } +function prettyPrintScopeDependency(val) { + var _a; + let rootStr; + if (((_a = val.identifier.name) === null || _a === void 0 ? void 0 : _a.kind) === 'named') { + rootStr = val.identifier.name.value; + } + else { + rootStr = '[unnamed]'; + } + return `${rootStr}${val.path.map(v => `${v.optional ? '?.' : '.'}${v.property}`).join('')}`; +} var CompareDependencyResult; (function (CompareDependencyResult) { CompareDependencyResult[CompareDependencyResult["Ok"] = 0] = "Ok"; @@ -53328,6 +53339,22 @@ var CompareDependencyResult; CompareDependencyResult[CompareDependencyResult["Subpath"] = 3] = "Subpath"; CompareDependencyResult[CompareDependencyResult["RefAccessDifference"] = 4] = "RefAccessDifference"; })(CompareDependencyResult || (CompareDependencyResult = {})); +function merge(a, b) { + return Math.max(a, b); +} +function getCompareDependencyResultDescription(result) { + switch (result) { + case CompareDependencyResult.Ok: + return 'Dependencies equal'; + case CompareDependencyResult.RootDifference: + case CompareDependencyResult.PathDifference: + return 'Inferred different dependency than source'; + case CompareDependencyResult.RefAccessDifference: + return 'Differences in ref.current access'; + case CompareDependencyResult.Subpath: + return 'Inferred less specific property than source'; + } +} function compareDeps(inferred, source) { const rootsEqual = (inferred.root.kind === 'Global' && source.root.kind === 'Global' && @@ -53405,16 +53432,26 @@ function validateInferredDep(dep, temporaries, declsWithinMemoBlock, validDepsIn return; } } + let errorDiagnostic = null; for (const originalDep of validDepsInMemoBlock) { const compareResult = compareDeps(normalizedDep, originalDep); if (compareResult === CompareDependencyResult.Ok) { return; } + else { + errorDiagnostic = merge(errorDiagnostic !== null && errorDiagnostic !== void 0 ? errorDiagnostic : compareResult, compareResult); + } } errorState.push({ severity: ErrorSeverity.CannotPreserveMemoization, reason: 'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected', - description: null, + description: (dep.identifier.name != null && dep.identifier.name.kind === 'named') + ? `The inferred dependency was \`${prettyPrintScopeDependency(dep)}\`, but the source dependencies were [${validDepsInMemoBlock + .map(dep => printManualMemoDependency(dep, true)) + .join(', ')}]. ${errorDiagnostic + ? getCompareDependencyResultDescription(errorDiagnostic) + : 'Inferred dependency not present in source'}` + : null, loc: memoLocation, suggestions: null, }); 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 f048a4fd21..368078c01f 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<<5876f8f9bad1e2aba5245215e0e99617>> */ 'use strict'; @@ -49790,7 +49790,7 @@ class ReactiveScopeDependencyTreeHIR { depCursor = nextDepCursor; hoistableCursor = nextHoistableCursor; } - depCursor.accessType = merge(depCursor.accessType, PropertyAccessType.OptionalDependency); + depCursor.accessType = merge$1(depCursor.accessType, PropertyAccessType.OptionalDependency); } deriveMinimalDependencies() { const results = new Set(); @@ -49848,7 +49848,7 @@ function isDependency(access) { return (access === PropertyAccessType.OptionalDependency || access === PropertyAccessType.UnconditionalDependency); } -function merge(access1, access2) { +function merge$1(access1, access2) { const resultIsUnconditional = !(isOptional(access1) && isOptional(access2)); const resultIsDependency = isDependency(access1) || isDependency(access2); if (resultIsUnconditional) { @@ -49905,7 +49905,7 @@ function makeOrMergeProperty(node, property, accessType) { node.properties.set(property, child); } else { - child.accessType = merge(child.accessType, accessType); + child.accessType = merge$1(child.accessType, accessType); } return child; } @@ -53099,6 +53099,17 @@ function validatePreservedManualMemoization(fn) { visitReactiveFunction(fn, new Visitor(), state); return state.errors.asResult(); } +function prettyPrintScopeDependency(val) { + var _a; + let rootStr; + if (((_a = val.identifier.name) === null || _a === void 0 ? void 0 : _a.kind) === 'named') { + rootStr = val.identifier.name.value; + } + else { + rootStr = '[unnamed]'; + } + return `${rootStr}${val.path.map(v => `${v.optional ? '?.' : '.'}${v.property}`).join('')}`; +} var CompareDependencyResult; (function (CompareDependencyResult) { CompareDependencyResult[CompareDependencyResult["Ok"] = 0] = "Ok"; @@ -53107,6 +53118,22 @@ var CompareDependencyResult; CompareDependencyResult[CompareDependencyResult["Subpath"] = 3] = "Subpath"; CompareDependencyResult[CompareDependencyResult["RefAccessDifference"] = 4] = "RefAccessDifference"; })(CompareDependencyResult || (CompareDependencyResult = {})); +function merge(a, b) { + return Math.max(a, b); +} +function getCompareDependencyResultDescription(result) { + switch (result) { + case CompareDependencyResult.Ok: + return 'Dependencies equal'; + case CompareDependencyResult.RootDifference: + case CompareDependencyResult.PathDifference: + return 'Inferred different dependency than source'; + case CompareDependencyResult.RefAccessDifference: + return 'Differences in ref.current access'; + case CompareDependencyResult.Subpath: + return 'Inferred less specific property than source'; + } +} function compareDeps(inferred, source) { const rootsEqual = (inferred.root.kind === 'Global' && source.root.kind === 'Global' && @@ -53184,16 +53211,26 @@ function validateInferredDep(dep, temporaries, declsWithinMemoBlock, validDepsIn return; } } + let errorDiagnostic = null; for (const originalDep of validDepsInMemoBlock) { const compareResult = compareDeps(normalizedDep, originalDep); if (compareResult === CompareDependencyResult.Ok) { return; } + else { + errorDiagnostic = merge(errorDiagnostic !== null && errorDiagnostic !== void 0 ? errorDiagnostic : compareResult, compareResult); + } } errorState.push({ severity: ErrorSeverity.CannotPreserveMemoization, reason: 'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected', - description: null, + description: (dep.identifier.name != null && dep.identifier.name.kind === 'named') + ? `The inferred dependency was \`${prettyPrintScopeDependency(dep)}\`, but the source dependencies were [${validDepsInMemoBlock + .map(dep => printManualMemoDependency(dep, true)) + .join(', ')}]. ${errorDiagnostic + ? getCompareDependencyResultDescription(errorDiagnostic) + : 'Inferred dependency not present in source'}` + : null, loc: memoLocation, suggestions: null, }); 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 a55424bfd7..fd42056efd 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-ac2cae52-20250503", + "version": "0.0.0-experimental-73d7e816-20250503", "repository": { "type": "git", "url": "https://github.com/facebook/react.git",