From 944b5ae63f65d77cfcb43eb74995b7aebcc2e56b Mon Sep 17 00:00:00 2001 From: Mike Vitousek Date: Fri, 26 Jul 2024 15:52:12 -0700 Subject: [PATCH] Update base for Update on "[compiler] When preserving user-level useMemos, don't memoize arguments" Summary: This work enhances the don't-drop-memoization mode to not memoize the arguments to useMemo and useCallback (or technically, to memoize them in the same block as the hook call -- but since hooks can't be memoized, this is equivalent to never memoizing them). The advantage here is that we preserve the source-level code structure around memoization callbacks more, and avoid the compiler bug of having function expression dependencies be unconditional when their actual semantics are conditional. This conceptually replaces some of the work of #30177: some of that was motivated by avoiding the deps bug, and the rest of the motivation was to better exercise the compiler's semantics, which was really happening as much as I'd hoped, as mofeiZ explained to me in that PR and offline! [ghstack-poisoned]