angular/packages/core
Andrew Scott d888da4606 fix(core): ApplicationRef.tick should respect OnPush for host bindings (#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
2024-03-07 11:13:03 -08:00
..
global docs(docs-infra): Add missing API entries to ADEV (#54530) 2024-02-21 16:41:33 +00:00
primitives/signals refactor(core): rework runtime implementation to simplify and fix issues (#54103) 2024-02-06 15:04:36 +00:00
reference-manifests build: add target to generate api manifest (#52472) 2023-11-02 11:00:59 -07:00
rxjs-interop refactor(core): EventEmitter implements OutputRef. (#54650) 2024-03-06 12:34:39 +01:00
schematics feat(core): add migration for invalid two-way bindings (#54630) 2024-02-28 18:06:23 +01:00
src fix(core): ApplicationRef.tick should respect OnPush for host bindings (#53718) 2024-03-07 11:13:03 -08:00
test fix(core): ApplicationRef.tick should respect OnPush for host bindings (#53718) 2024-03-07 11:13:03 -08:00
testing fix(core): ComponentFixture autodetect should detect changes within ApplicationRef.tick (#54733) 2024-03-06 13:33:54 -08:00
BUILD.bazel test: replace fake_core with real @angular/core output (#54650) 2024-03-06 12:34:38 +01:00
index.ts refactor(core): made comment structure consistent in index.ts (#43684) 2021-10-21 18:39:58 +00:00
package.json build: update node.js engines version to be more explicate about v20 support (#52448) 2023-10-31 14:18:36 -07:00
PACKAGE.md
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00