Skip to content

Commit

Permalink
Update base for Update on "[compiler] When preserving user-level useM…
Browse files Browse the repository at this point in the history
…emos, 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]
  • Loading branch information
mvitousek committed Jul 18, 2024
1 parent 82be840 commit ce58ab1
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit ce58ab1

Please sign in to comment.