angular/packages/core
Andrew Scott 06be8034bb fix(core): Microtask scheduling should be used after any application synchronization
Previously, Angular would switch from the macrotask to a microtask
scheduler _only_ when the scheduler was the trigger for the
synchronization. This microtask scheduling is to ensure patterns such as
`Promise.resolve().then(() => updateAppStateAgain())` _during_
synchronization are caught and synchronized again within the same event
loop (guaranteeing that they aren't split across multiple browser paints).

The microtask scheduler should be used after any tick, not just from
those than run within the scheduler to always account for the promises
within synchronization. This is encountered most frequently during
bootstrap, which triggers the tick directly.

In this change we exempt `TestBed.tick` and
`ComponentFixture.detectChanges` from this behavior. Doing so would affect
the timing of stability and tests are quite sensitive to this (e.g.
`fixture.whenStable`). It is somewhat unfortunate that we have "special" test-only
behavior. However, it is important to acknowledge that this only affects
the test-only APIs as well. Any code in the application under test that
triggers `ApplicationRef.tick` directly would still use the microtask
scheduling behavior.

fixes #65444
2025-12-16 13:34:48 -08:00
..
global build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
primitives refactor(core): Add transition.to property to FakeNavigation 2025-12-10 10:18:08 -08:00
resources docs(core): remove outdated regex template restriction in best-practices.md 2025-11-20 16:42:52 -05:00
rxjs-interop refactor(core): Support Error like object for on resource errors. 2025-12-10 08:18:17 -08:00
schematics refactor(migrations): don't migration the server bootstrapApplicaiton on zoneless apps. 2025-11-26 15:58:53 -05:00
src fix(core): Microtask scheduling should be used after any application synchronization 2025-12-16 13:34:48 -08:00
test fix(core): Microtask scheduling should be used after any application synchronization 2025-12-16 13:34:48 -08:00
testing fix(core): Microtask scheduling should be used after any application synchronization 2025-12-16 13:34:48 -08:00
BUILD.bazel refactor(core): export profile event as enum and move profile_types.ts and framework to shared devtools folder 2025-11-19 15:22:49 -08:00
index.ts refactor: update packages/core:{core,src} to ts_project (#61275) 2025-05-14 12:01:51 +00:00
package.json build: bump core zone.js version 2025-11-19 13:22:14 -08:00
PACKAGE.md build: format md files 2025-11-06 10:03:05 -08:00
public_api.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
tsconfig-build.json build: migrate more targets of @angular/core to ts_project (#61370) 2025-05-16 11:02:07 +00:00
tsconfig-test.json build: migrate more targets of @angular/core to ts_project (#61370) 2025-05-16 11:02:07 +00:00