Use consumer dirtiness to drive whether a view should refresh#52476
Closed
atscott wants to merge 3 commits intoangular:mainfrom
Closed
Use consumer dirtiness to drive whether a view should refresh#52476atscott wants to merge 3 commits intoangular:mainfrom
atscott wants to merge 3 commits intoangular:mainfrom
Conversation
alxhub
approved these changes
Oct 31, 2023
13f9a67 to
7ba4481
Compare
…tion The significance of the combination of angular#51854 and angular#52302 went mostly unnoticed. The first removed a unidirectional data flow constraint for transplanted views and the second updated the signal implementation to share transplanted view logic. The result is that we automatically get behavior that (mostly) removes `ExpressionChangedAfterItWasCheckedError` when signals are used to drive application state to DOM synchronization. fixes angular#50320
…mponent This commit updates the reactive consumer used for `LView`s to be shared between a component and its embedded views. This allows us to use the consumer flag directly for a dirty indicator rather than needing to find a component view for updating its flags. In the future, this will also allow us to effectively poll producers to see if they really changed before refreshing a view.
Producers represent values which can deliver change notifications. When a producer value is changed, a change notification is propagated through the graph, notifying live consumers which depend on the producer of the potential update. Note here that this is a _potential_ update. A producer may not have actually "changed" based on its equality function. With this commit, before refreshing a view that is only marked for refresh because its consumer is dirty, we poll producers for change to see if they really have. If not, we can skip the refresh. The example test in this commit shows that a `computed` which depends on a `signal` that is updated but produces a value that is the same as before will _not_ cause the component's template to refresh. fixes angular#51797
alxhub
approved these changes
Nov 2, 2023
7ba4481 to
7bd221f
Compare
alxhub
approved these changes
Nov 2, 2023
Member
alxhub
left a comment
There was a problem hiding this comment.
Reviewed-for: global-approvers
Contributor
Author
|
caretaker note: presubmits green other than one test failing at HEAD already. |
Member
|
This PR was merged into the repository by commit 83a3b85. |
alxhub
pushed a commit
that referenced
this pull request
Nov 2, 2023
…mponent (#52476) This commit updates the reactive consumer used for `LView`s to be shared between a component and its embedded views. This allows us to use the consumer flag directly for a dirty indicator rather than needing to find a component view for updating its flags. In the future, this will also allow us to effectively poll producers to see if they really changed before refreshing a view. PR Close #52476
alxhub
pushed a commit
that referenced
this pull request
Nov 2, 2023
…nge (#52476) Producers represent values which can deliver change notifications. When a producer value is changed, a change notification is propagated through the graph, notifying live consumers which depend on the producer of the potential update. Note here that this is a _potential_ update. A producer may not have actually "changed" based on its equality function. With this commit, before refreshing a view that is only marked for refresh because its consumer is dirty, we poll producers for change to see if they really have. If not, we can skip the refresh. The example test in this commit shows that a `computed` which depends on a `signal` that is updated but produces a value that is the same as before will _not_ cause the component's template to refresh. fixes #51797 PR Close #52476
alxhub
pushed a commit
that referenced
this pull request
Nov 2, 2023
…tion (#52476) The significance of the combination of #51854 and #52302 went mostly unnoticed. The first removed a unidirectional data flow constraint for transplanted views and the second updated the signal implementation to share transplanted view logic. The result is that we automatically get behavior that (mostly) removes `ExpressionChangedAfterItWasCheckedError` when signals are used to drive application state to DOM synchronization. fixes #50320 PR Close #52476
alxhub
pushed a commit
that referenced
this pull request
Nov 2, 2023
…mponent (#52476) This commit updates the reactive consumer used for `LView`s to be shared between a component and its embedded views. This allows us to use the consumer flag directly for a dirty indicator rather than needing to find a component view for updating its flags. In the future, this will also allow us to effectively poll producers to see if they really changed before refreshing a view. PR Close #52476
alxhub
pushed a commit
that referenced
this pull request
Nov 2, 2023
…nge (#52476) Producers represent values which can deliver change notifications. When a producer value is changed, a change notification is propagated through the graph, notifying live consumers which depend on the producer of the potential update. Note here that this is a _potential_ update. A producer may not have actually "changed" based on its equality function. With this commit, before refreshing a view that is only marked for refresh because its consumer is dirty, we poll producers for change to see if they really have. If not, we can skip the refresh. The example test in this commit shows that a `computed` which depends on a `signal` that is updated but produces a value that is the same as before will _not_ cause the component's template to refresh. fixes #51797 PR Close #52476
Abseil-byte
pushed a commit
to Abseil-byte/angular
that referenced
this pull request
Nov 5, 2023
…tion (angular#52476) The significance of the combination of angular#51854 and angular#52302 went mostly unnoticed. The first removed a unidirectional data flow constraint for transplanted views and the second updated the signal implementation to share transplanted view logic. The result is that we automatically get behavior that (mostly) removes `ExpressionChangedAfterItWasCheckedError` when signals are used to drive application state to DOM synchronization. fixes angular#50320 PR Close angular#52476
Abseil-byte
pushed a commit
to Abseil-byte/angular
that referenced
this pull request
Nov 5, 2023
…mponent (angular#52476) This commit updates the reactive consumer used for `LView`s to be shared between a component and its embedded views. This allows us to use the consumer flag directly for a dirty indicator rather than needing to find a component view for updating its flags. In the future, this will also allow us to effectively poll producers to see if they really changed before refreshing a view. PR Close angular#52476
Abseil-byte
pushed a commit
to Abseil-byte/angular
that referenced
this pull request
Nov 5, 2023
…nge (angular#52476) Producers represent values which can deliver change notifications. When a producer value is changed, a change notification is propagated through the graph, notifying live consumers which depend on the producer of the potential update. Note here that this is a _potential_ update. A producer may not have actually "changed" based on its equality function. With this commit, before refreshing a view that is only marked for refresh because its consumer is dirty, we poll producers for change to see if they really have. If not, we can skip the refresh. The example test in this commit shows that a `computed` which depends on a `signal` that is updated but produces a value that is the same as before will _not_ cause the component's template to refresh. fixes angular#51797 PR Close angular#52476
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…tion (angular#52476) The significance of the combination of angular#51854 and angular#52302 went mostly unnoticed. The first removed a unidirectional data flow constraint for transplanted views and the second updated the signal implementation to share transplanted view logic. The result is that we automatically get behavior that (mostly) removes `ExpressionChangedAfterItWasCheckedError` when signals are used to drive application state to DOM synchronization. fixes angular#50320 PR Close angular#52476
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…mponent (angular#52476) This commit updates the reactive consumer used for `LView`s to be shared between a component and its embedded views. This allows us to use the consumer flag directly for a dirty indicator rather than needing to find a component view for updating its flags. In the future, this will also allow us to effectively poll producers to see if they really changed before refreshing a view. PR Close angular#52476
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…nge (angular#52476) Producers represent values which can deliver change notifications. When a producer value is changed, a change notification is propagated through the graph, notifying live consumers which depend on the producer of the potential update. Note here that this is a _potential_ update. A producer may not have actually "changed" based on its equality function. With this commit, before refreshing a view that is only marked for refresh because its consumer is dirty, we poll producers for change to see if they really have. If not, we can skip the refresh. The example test in this commit shows that a `computed` which depends on a `signal` that is updated but produces a value that is the same as before will _not_ cause the component's template to refresh. fixes angular#51797 PR Close angular#52476
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First commit is from #52475
commit 2:
refactor(core): Update LView consumer to use only 1 consumer for a component
This commit updates the reactive consumer used for
LViews to be sharedbetween a component and its embedded views. This allows us to use the
consumer flag directly for a dirty indicator rather than needing to
find a component view for updating its flags.
In the future, this will also allow us to effectively poll producers to see if
they really changed before refreshing a view.
commit 3
refactor(core): Do not refresh view if producers did not actually change
Producers represent values which can deliver change notifications.
When a producer value is changed, a change notification is propagated through the graph,
notifying live consumers which depend on the producer of the potential update.
Note here that this is a potential update.
A producer may not have actually "changed" based on its equality function. With
this commit, before refreshing a view that is only marked for refresh
because its consumer is dirty, we poll producers for change to see if
they really have. If not, we can skip the refresh. The example test in this commit
shows that a
computedwhich depends on asignalthat is updated butproduces a value that is the same as before will not cause the
component's template to refresh.
fixes #51797