@angular/router
Advanced tools
Changelog
18.0.0-next.0 (2024-03-14)
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.ComponentFixture
autoDetect
feature will no
longer refresh the component's host view when the component is OnPush
and not marked dirty. This exposes existing issues in components which
claim to be OnPush
but do not correctly call markForCheck
when they
need to be refreshed. If this change causes test failures, the easiest
fix is to change the component to ChangeDetectionStrategy.Default
.ApplicationRef
that are still marked for
check after one round completes. In rare cases, this can result in infinite
loops when certain patterns continue to mark views for check using
ChangeDetectorRef.detectChanges
. This will be surfaced as a runtime
error with the NG0103
code.ComponentFixture.autoDetect
feature now executes
change detection for the fixture within ApplicationRef.tick
. This more
closely matches the behavior of how a component would refresh in
production. The order of component refresh in tests may be slightly
affected as a result, especially when dealing with additional components
attached to the application, such as dialogs. Tests sensitive to this
type of change (such as screenshot tests) may need to be updated.
Concretely, this change means that the component will refresh before
additional views attached to ApplicationRef
(i.e. dialog components).
Prior to this change, the fixture component would refresh after other
views attached to the application.NgZone
is now the first of either
setTimeout
or requestAnimationFrame
. Code which relies on this
timing (usually by accident) will need to be adjusted. If a callback
needs to execute after change detection, we recommend afterNextRender
instead of something like setTimeout
.ExpressionChangedAfterItHasBeenCheckedError
or not be refreshed until
some future round of change detection. In rare circumstances, this
correction can cause issues. We identified one instance that relied on
the previous behavior by reading a value on initialization which was
queued to be updated in a microtask instead of being available in the
current change detection round. The component only read this value during
initialization and did not read it again after the microtask updated it.RedirectCommand
for redirects
in addition to UrlTree
. Code which expects only boolean
or UrlTree
values in Route
types will need to be adjusted.| Commit | Type | Description | | -- | -- | -- | | 9b424d7224 | fix | preserve original reference to non-deferrable dependency (#54759) |
| Commit | Type | Description |
| -- | -- | -- |
| 64f870c12b | fix | ApplicationRef.tick
should respect OnPush for host bindings (#53718) (#53718) |
| 8cad4e8cbe | fix | ComponentFixture
autoDetect
respects OnPush
flag of host view (#54824) |
| ba8e465974 | fix | Change Detection will continue to refresh views while marked for check (#54734) |
| 24bc0ed4f2 | fix | ComponentFixture autodetect should detect changes within ApplicationRef.tick (#54733) |
| 10c5cdb49c | fix | ensure change detection runs in a reasonable timeframe with zone coalescing (#54578) |
| ad045efd4b | fix | Ensure views marked for check are refreshed during change detection (#54735) |
| 700c0520bb | fix | Update ApplicationRef.tick loop to only throw in dev mode (#54848) |
| Commit | Type | Description |
| -- | -- | -- |
| 8735af08b9 | feat | Add ability to return UrlTree
with NavigationBehaviorOptions
from guards (#45023) |
<a name="17.3.0"></a>
Changelog
17.3.0 (2024-03-13)
| Commit | Type | Description | | -- | -- | -- | | 1a6beae8a2 | feat | Enable template pipeline by default. (#54571) | | f386a04c9d | fix | handle two-way bindings to signal-based template variables in instruction generation (#54714) | | 1f129f114e | fix | not catching for loop empty tracking expressions (#54772) |
| Commit | Type | Description |
| -- | -- | -- |
| 12dc4d074e | fix | account for as expression in docs extraction (#54414) |
| da7fbb40f0 | fix | detect when the linker is working in unpublished angular and widen supported versions (#54439) |
| 492e03f699 | fix | flag two-way bindings to non-signal values in templates (#54714) |
| 5afa4f0ec1 | fix | support ModuleWithProviders
literal detection with typeof
(#54650) |
| Commit | Type | Description |
| -- | -- | -- |
| 331b16efd2 | feat | add API to inject attributes on the host node (#54604) |
| fb540e169a | feat | add migration for invalid two-way bindings (#54630) |
| c687b8f453 | feat | expose new output()
API (#54650) |
| c809069f21 | feat | introduce outputFromObservable()
interop function (#54650) |
| aff65fd1f4 | feat | introduce outputToObservable
interop helper (#54650) |
| 974958913c | feat | support TypeScript 5.4 (#54414) |
| 39a50f9a8d | fix | ensure all initializer functions run in an injection context (#54761) |
| 243ccce624 | fix | exclude class attribute intended for projection matching from directive matching (#54800) |
| 2909e9817d | fix | prevent infinite loops in clobbered elements check (#54425) |
| 7243c704cf | fix | return a readonly signal on asReadonly
. (#54706) |
| bb35414a38 | perf | speed up retrieval of DestroyRef
in EventEmitter
(#54748) |
| Commit | Type | Description | | -- | -- | -- | | 8d37ed035c | fix | exclude caching for authenticated HTTP requests (#54746) |
| Commit | Type | Description | | -- | -- | -- | | c1c7384e02 | feat | Add reusable types for router guards (#54580) | | 7225485311 | fix | Navigations triggered by cancellation events should cancel previous navigation (#54710) |
<!-- CHANGELOG SPLIT MARKER --><a name="17.2.4"></a>
Changelog
17.2.4 (2024-03-06)
| Commit | Type | Description | | -- | -- | -- | | 917b9bdd2e | fix | unwrap expressions with type parameters in query read property (#54647) |
| Commit | Type | Description |
| -- | -- | -- |
| 586cc24a10 | fix | apply TestBed provider overrides to @defer
dependencies (#54667) |
| b558a01c84 | fix | generic inference for signal inputs may break with --strictFunctionTypes
(#54652) |
| 443e5f1591 | fix | return a readonly signal on asReadonly
. (#54719) |
| ffbafc7d4a | fix | untrack various core operations (#54614) |
<a name="17.2.3"></a>
Changelog
17.2.3 (2024-02-27)
| Commit | Type | Description |
| -- | -- | -- |
| 1a526f2881 | perf | AsyncPipe
should not call markForCheck
on subscription (#54554) |
| Commit | Type | Description | | -- | -- | -- | | 2aefed8763 | fix | catch function instance properties in interpolated signal diagnostic (#54325) | | 48aec63ee4 | fix | identify aliased initializer functions (#54480) | | daf7c611b2 | fix | identify aliased initializer functions (#54609) |
| Commit | Type | Description |
| -- | -- | -- |
| 57123524a2 | fix | collect providers from NgModules while rendering @defer
block (#52881) |
| 79a32816dc | fix | fix typo in injectors.svg file (#54596) |
| Commit | Type | Description | | -- | -- | -- | | dbe673b027 | fix | resolve infinite loop for a single line element with a long tag name and angle bracket on a new line (#54588) |
<!-- CHANGELOG SPLIT MARKER --><a name="17.2.2"></a>
Changelog
17.2.2 (2024-02-21)
| Commit | Type | Description | | -- | -- | -- | | d34e3298db | fix | image placeholder not removed in OnPush component (#54515) |
| Commit | Type | Description | | -- | -- | -- | | 6447c0eecc | fix | adding the inert property to the "SCHEMA" array (#53148) |
| Commit | Type | Description | | -- | -- | -- | | 0a3edfb543 | fix | correctly detect deferred dependencies across scoped nodes (#54499) | | 790f4f7c26 | fix | use correct symbol name for default imported symbols in defer blocks (#54495) |
| Commit | Type | Description | | -- | -- | -- | | 3bd5860c74 | fix | properly execute content queries for root components (#54457) |
| Commit | Type | Description | | -- | -- | -- | | bb57d34110 | fix | Fix cf migration regular expression to include underscores (#54533) |
| Commit | Type | Description | | -- | -- | -- | | 3e31f1a34e | fix | Clear internal transition when navigation finalizes (#54261) |
<!-- CHANGELOG SPLIT MARKER --><a name="17.2.1"></a>
Changelog
17.2.1 (2024-02-14)
| Commit | Type | Description | | -- | -- | -- | | 7234824228 | fix | fix broken version detection condition (#54443) |
<!-- CHANGELOG SPLIT MARKER --><a name="17.2.0"></a>
Changelog
17.2.0 (2024-02-14)
| Commit | Type | Description | | -- | -- | -- | | 03c3b3eb79 | feat | add Netlify image loader (#54311) | | f5c520b836 | feat | add placeholder to NgOptimizedImage (#53783) |
| Commit | Type | Description |
| -- | -- | -- |
| 47e6e84101 | feat | Add a TSConfig option useTemplatePipeline
(#54057) |
| 66e940aebf | feat | scope selectors in @starting-style (#53943) |
| 7b4d275f49 | fix | Fix the template pipeline option (#54148) |
| Commit | Type | Description |
| -- | -- | -- |
| 7e861c640e | feat | generate extra imports for component local dependencies in local mode (#53543) |
| 3263df23f2 | feat | generate global imports in local compilation mode (#53543) |
| b774e22d8e | feat | make it configurable to generate alias reexports (#53937) |
| 3e1384048e | feat | support host directives for local compilation mode (#53877) |
| a592904c69 | fix | allow custom/duplicate decorators for @Injectable
classes in local compilation mode (#54139) |
| 4b1d948b36 | fix | consider the case of duplicate Angular decorators in local compilation diagnostics (#54139) |
| 96bcf4fb12 | fix | forbid custom/duplicate decorator when option forbidOrphanComponents
is set (#54139) |
| 64fa5715c6 | fix | generating extra imports in local compilation mode when cycle is introduced (#53543) |
| 6c8b09468a | fix | highlight the unresolved element in the @Component.styles array for the error LOCAL_COMPILATION_UNRESOLVED_CONST (#54230) |
| 0970129e20 | fix | show proper error for custom decorators in local compilation mode (#53983) |
| f39cb06418 | fix | show specific error for unresolved @Directive.exportAs in local compilation mode (#54230) |
| f3851b5945 | fix | show specific error for unresolved @HostBinding's argument in local compilation mode (#54230) |
| 39ddd884e8 | fix | show specific error for unresolved @HostListener's event name in local compilation mode (#54230) |
| 5d633240fd | fix | show the correct message for the error LOCAL_COMPILATION_UNRESOLVED_CONST when an unresolved symbol used for @Component.styles (#54230) |
| 58b8a232d6 | fix | support jumping to definitions of signal-based inputs (#54053) |
| Commit | Type | Description | | -- | -- | -- | | 702ab28b4c | feat | add support for model inputs (#54252) | | e95ef2cbc6 | feat | expose queries as signals (#54283) | | 656bc282e3 | fix | add toString implementation to signals (#54002) | | 62b87b4551 | fix | do not crash for signal query that does not have any matches (#54353) | | 4b96f370ee | fix | expose model signal subcribe for type checking purposes (#54357) | | 744cb1e561 | fix | return the same children query results if there are no changes (#54392) | | 6d00115bf4 | fix | show placeholder block on the server with immediate trigger (#54394) |
| Commit | Type | Description | | -- | -- | -- | | 1c536250b6 | fix | Use string body to generate transfer cache key. (#54379) |
<!-- CHANGELOG SPLIT MARKER --><a name="17.1.3"></a>