Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(core): Update LView consumer to only mark component for check #52302

Closed
wants to merge 1 commit into from

Commits on Oct 31, 2023

  1. perf(core): Update LView consumer to only mark component for check

    This commit updates the reactive template and host binding consumers to
    only mark their declaration components for refresh, but not parents/ancestors.
    
    This also updates the `AfterViewChecked` hook to run when a component is
    refreshed during change detection but its host is not. It is reasonable
    to expect that the `ngAfterViewChecked` lifecycle hook will run when a
    signal updates and the component is refreshed. The hooks are typically
    run when the host is refreshed so without this change, the update to
    not mark ancestors dirty would have caused `ngAfterViewChecked` to not
    run.
    
    resolves angular#14628
    resolves angular#22646
    
    resolves angular#34347 - this is not the direct request of the issue but
    generally forcing change detection to run is necessary only because a
    value was updated that needs to be synced to the DOM. Values that use
    signals will mark the component for check automatically so accessing the
    `ChangeDetectorRef` of a child is not necessary. The other part of this
    request was to avoid the need to "mark all views for checking since
    it wouldn't affect anything but itself". This is directly addressed by
    this commit - updating a signal that's read in the view's template
    will not cause ancestors/"all views" to be refreshed.
    atscott committed Oct 31, 2023
    Copy the full SHA
    a1ba76d View commit details
    Browse the repository at this point in the history