From 9ff96ed94465b7275647f18221171c6670a22e29 Mon Sep 17 00:00:00 2001 From: Mike Vitousek Date: Tue, 2 Jul 2024 00:41:24 -0700 Subject: [PATCH] Update base for Update on "[compiler] Use dependencies from source for useMemo scopes" Summary: This modified the behavior of the compiler when preserving source-level useMemos as reactive scopes to use the depencies from the source as well. This accounts for the possibility that the useMemo in the source is more general than is required by local code, but is necessary due to rules of react violations. The most complex bit here has to do with explicit dependencies that are globals. As currently written, there's no LoadGlobal that corresponds to a Global dependency of a useMemo, so whenever we convert a useMemo into StartMemoize/FinishMemoize instructions, if we plan to use the useMemo's dependencies we also have to synthesize a LoadGlobal instruction for any globals in the dependencies. With this change, ideally the disableMemoization mode will behave exactly like the uncompiled code. [ghstack-poisoned]