angular/packages/core/src
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
..
animation fix(core): run animation queue in environment injector context 2025-12-02 15:05:17 +01:00
application fix(core): Microtask scheduling should be used after any application synchronization 2025-12-16 13:34:48 -08:00
authoring docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
change_detection fix(core): Microtask scheduling should be used after any application synchronization 2025-12-16 13:34:48 -08:00
compiler refactor(core): rename ExperimentalIsolatedShadowDom to IsolatedShadowDom 2025-11-11 08:46:06 -08:00
debug refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
defer refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
di refactor(core): conditionally include debug names based on ngDevMode 2025-12-16 09:37:38 -08:00
hydration refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
i18n refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
interface refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
internal refactor(core): account for anonymous classes in internal utility (#58392) 2024-10-28 12:38:03 -07:00
linker refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
metadata docs: update forwardRef usage with signals and add HostListener note 2025-12-10 12:23:29 -08:00
platform fix(core): return StaticProvider for providePlatformInitializer 2025-12-15 15:16:37 -08:00
reflection build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
render fix(core): prevent animations renderer from impacting animate.leave (#63921) 2025-09-19 21:26:18 +00:00
render3 refactor(core): conditionally include debug names based on ngDevMode 2025-12-16 09:37:38 -08:00
resource refactor(core): Support Error like object for on resource errors. 2025-12-10 08:18:17 -08:00
sanitization fix(compiler): prevent XSS via SVG animation attributeName and MathML/SVG URLs 2025-12-01 10:26:56 +01:00
testability fix(core): cleanup testability subscriptions (#61261) 2025-05-21 12:06:23 +00:00
util docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
view refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
zone docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
authoring.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
cached_injector_service.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
change_detection.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
console.ts refactor: remove unnecessary TSLint rule flags (#59365) 2025-01-07 16:06:21 +00:00
core.externs.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core.ts refactor(core): remove NgProbeToken class (#63279) 2025-08-20 16:21:38 +00:00
core_private_export.ts refactor(router): Add handler to NavigationInterceptOptions 2025-11-07 13:32:49 -08:00
core_reactivity_export.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core_reactivity_export_internal.ts refactor(core): expose isWritableSignal to the publicApi 2025-10-29 20:31:41 +00:00
core_render3_private_export.ts perf(core): tree shake unused dynamic [field] binding instructions (#65599) 2025-12-03 15:10:49 +01:00
di.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
document.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
error_details_base_url.ts refactor(core): Error logs links point to the archived version of the docs (#63512) 2025-09-10 22:21:10 +00:00
error_handler.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
errors.ts docs: Adds documentation for the NG0919 error 2025-12-15 09:52:16 -08:00
event_delegation_utils.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
event_emitter.ts docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
image_performance_warning.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
linker.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
metadata.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
ng_reflect.ts refactor(core): remove redundant providedIn: 'root' from injection tokens 2025-11-04 00:31:52 +00:00
pending_tasks.ts docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
pending_tasks_internal.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
profiler.ts docs: update comment (#62482) 2025-07-07 16:52:15 +00:00
r3_symbols.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
render.ts feat(core): add event listener options to renderer (#59092) 2024-12-10 13:39:47 -08:00
transfer_state.ts refactor: replace getDocument() with inject(DOCUMENT) 2025-11-25 13:04:58 -05:00
type_checking.ts refactor(core): expose function to assert type of variables (#62648) 2025-07-16 12:40:25 +02:00
version.ts refactor(core): mark VERSION as @__PURE__ for better tree-shaking (#63400) 2025-08-27 11:39:06 -07:00
zone.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00