angular/packages/core/testing/src
Andrew Scott 64f870c12b fix(core): ApplicationRef.tick should respect OnPush for host bindings (#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
2024-03-11 13:46:11 -07:00
..
async.ts feat(core): drop support for zone.js 0.10.x (#40823) 2021-02-24 07:58:29 -08:00
component_fixture.ts fix(core): ApplicationRef.tick should respect OnPush for host bindings (#53718) (#53718) 2024-03-11 13:46:11 -07:00
defer.ts refactor(core): ignore after and minimum when transition between states in tests (#52314) 2023-10-24 09:25:13 -07:00
fake_async.ts docs: fix typo (#49669) 2023-04-03 19:18:40 -07:00
logger.ts refactor(core): cleanup type any (#48623) 2023-01-04 12:15:16 -08:00
metadata_override.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata_overrider.ts fix(core): support cyclic metadata in TestBed overrides (#44215) 2021-11-19 19:27:08 +00:00
resolvers.ts feat(core): support TypeScript 4.8 (#47038) 2022-08-16 16:02:47 +00:00
styling.ts refactor(core): drop IE workarounds (#49763) 2023-04-13 14:01:45 +00:00
test_bed.ts refactor(core): Update ComponentFixture behavior when using zoneless scheduler (#54024) 2024-01-29 20:21:47 +00:00
test_bed_common.ts refactor(core): Update ComponentFixture behavior when using zoneless scheduler (#54024) 2024-01-29 20:21:47 +00:00
test_bed_compiler.ts fix(core): apply TestBed provider overrides to @defer dependencies (#54667) 2024-03-05 09:21:22 +01:00
test_hooks.ts fix(core): guard the jasmine hooks (#51394) 2023-08-21 08:14:53 -07:00
testing.ts refactor(core): Update ComponentFixture behavior when using zoneless scheduler (#54024) 2024-01-29 20:21:47 +00:00
testing_internal.ts refactor(core): Remove ununsed Zone mock from testing internals. (#49873) 2023-04-18 14:00:15 +00:00