Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core):
ApplicationRef.tick
should respect OnPush for host bindi…
…ngs (#53718) (#53718) This commit updates `ApplicationRef.tick` to use `detectChangesInternal` for root views rather than go through the `ChangeDetectorRef.detectChanges` API which refreshes the host view without first looking at whether the view is `OnPush` and not dirty. The current behavior would hide errors in `OnPush` components that do not correctly get marked for check and would break when migrating to zoneless change detection because `markForCheck` was never called so change detection was never scheduled. The error would be surprising and blamed on switching to zoneless when in reality the issue already exists and is a problem with the component not calling `markForCheck`. However, this error is hidden today because `ApplicationRef.tick` refresh host bindings unconditionally. BREAKING CHANGE: `OnPush` views at the root of the application need to be marked dirty for their host bindings to refresh. Previously, the host bindings were refreshed for all root views without respecting the `OnPush` change detection strategy. PR Close #53718 PR Close #53718
- Loading branch information
Showing
4 changed files
with
47 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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