Skip to content

Commit

Permalink
Update base for Update on "[compiler] In change detection, assign rea…
Browse files Browse the repository at this point in the history
…ctive scopes to values that may have changed between renders"

Summary:
Change detection is desgined to determine whether rules of react have been violated, and to do so better we need to loosen Forgets assumptions about what kinds of values don't need to be memoized. For example, the compiler typically doesn't think of o.x as something that needs to be memoized, because it does not allocate. However, we want to compare o.x in the current render with o.x in a previous one, so we now insert a "memoization" (comparison, really) block around this value.

The structure of this work is that we now add a reactive scope for identifiers if they originate from any instruction that could read from state that could have mutated between renders. This means that `LoadProperty` is always going to get a reactive scope; `LoadGlobal` will get a scope if we're not reading from something mutable, and `PrefixUpdate` won't (because the variable being incremented would have already been loaded and checked).

Supersedes #30180.

[ghstack-poisoned]
  • Loading branch information
mvitousek committed Jul 26, 2024
1 parent f148e71 commit e13113a
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit e13113a

Please sign in to comment.