@angular/core
Advanced tools
Changelog
18.0.0-next.3 (2024-04-03)
RouterOutlet
. This means that providers available only to the
component that defines the RouterOutlet
will no longer be available to
route components in any circumstances. This was already the case
whenever routes defined providers, either through lazy loading an
NgModule
or through explicit providers
on the route config.| Commit | Type | Description |
| -- | -- | -- |
| f824911510 | fix | For FatalDiagnosticError
, hide the message
field without affecting the emit (#55160) |
| Commit | Type | Description | | -- | -- | -- | | c04ffb1fa6 | fix | use switch statements to narrow Angular switch blocks (#55168) |
| Commit | Type | Description |
| -- | -- | -- |
| 666d646575 | feat | Add event delegation library to queue up events and replay them when the application is ready (#55121) |
| 146306a141 | feat | add support for i18n hydration (#54823) |
| 840c375255 | fix | do not save point-in-time setTimeout
and rAF
references (#55124) |
| 231e0a3528 | fix | handle ChainedInjector
s in injector debug utils (#55144) |
| a5fa279b6e | fix | prevent i18n hydration from cleaning projected nodes (#54823) |
| f44a5e4604 | fix | support content projection and VCRs in i18n (#54823) |
| 914e4530b0 | fix | test cleanup should not throw if Zone is not present (#55096) |
| a99cb7ce5b | fix | zoneless scheduler should check if Zone is defined before accessing it (#55118) |
| Commit | Type | Description | | -- | -- | -- | | 1c736dc3b2 | feat | Unified Control State Change Events (#54579) |
| Commit | Type | Description | | -- | -- | -- | | a48afe0d94 | fix | avoid generating TS syntactic diagnostics for templates (#55091) |
| Commit | Type | Description | | -- | -- | -- | | 0c20c4075a | fix | avoid conflicts with some greek letters in control flow migration (#55113) |
| Commit | Type | Description | | -- | -- | -- | | 45ae7a6b60 | feat | add withI18nSupport() in developer preview (#55130) |
| Commit | Type | Description |
| -- | -- | -- |
| 87f3f27f90 | feat | Allow resolvers to return RedirectCommand
(#54556) |
| 3839cfbb18 | fix | Routed components never inherit RouterOutlet
EnvironmentInjector
(#54265) |
<a name="18.0.0-next.2"></a>
Changelog
18.0.0-next.2 (2024-03-28)
ComponentFixture.whenStable
now matches the
ApplicationRef.isStable
observable. Prior to this change, stability
of the fixture did not include everything that was considered in
ApplicationRef
. whenStable
of the fixture will now include unfinished
router navigations and unfinished HttpClient
requests. This will cause
tests that await
the whenStable
promise to time out when there are
incomplete requests. To fix this, remove the whenStable
,
instead wait for another condition, or ensure HttpTestingController
mocks responses for all requests. Try adding HttpTestingController.verify()
before your await fixture.whenStable
to identify the open requests.
Also, make sure your tests wait for the stability promise. We found many
examples of tests that did not, meaning the expectations did not execute
within the test body.
In addition, ComponentFixture.isStable
would synchronously switch to
true in some scenarios but will now always be asynchronous.
UrlTree
as a redirect, the
redirecting navigation will now use replaceUrl
if the initial
navigation was also using the replaceUrl
option. If this is not
desirable, the redirect can configure new NavigationBehaviorOptions
by
returning a RedirectCommand
with the desired options instead of UrlTree
.| Commit | Type | Description | | -- | -- | -- | | 7fc7f3f05f | fix | capture all control flow branches for content projection in if blocks (#54921) | | a369f43fbd | fix | capture switch block cases for content projection (#54921) | | eb625d3783 | fix | declare for loop aliases in addition to new name (#54942) | | bfd0bd574e | fix | invoke method-based tracking function with context (#54960) | | e1650e3b13 | fix | throw error if item name and context variables conflict (#55045) |
| Commit | Type | Description | | -- | -- | -- | | 5bd188a394 | feat | add partial compilation support for deferred blocks (#54908) | | b02b31a915 | feat | drop support for TypeScript older than 5.4 (#54961) | | 78188e877a | fix | add diagnostic if initializer API is used outside of an initializer (#54993) | | 694ba79cbf | fix | report cases where initializer APIs are used in a non-directive class (#54993) | | 6219341d26 | fix | report errors when initializer APIs are used on private fields (#54981) |
| Commit | Type | Description |
| -- | -- | -- |
| a600a39d0c | feat | add support for fallback content in ng-content (#54854) |
| 658cf8c384 | fix | ComponentFixture
stability should match ApplicationRef
(#54949) |
| 2fc11eae9e | fix | account for re-projected ng-content elements with fallback content (#54854) |
| 1c0ec56c46 | fix | correctly project single-root content inside control flow (#54921) |
| 86a359b399 | fix | establish proper injector resolution order for @defer
blocks (#55079) |
| e02bcf89cf | fix | Fix clearing of pending task in zoneless cleanup implementation (#55074) |
| Commit | Type | Description | | -- | -- | -- | | cf73983fdc | fix | include transferCache when cloning HttpRequest (#54939) | | 13554f9637 | fix | manage different body types for caching POST requests (#54980) |
| Commit | Type | Description | | -- | -- | -- | | 6d1b82df32 | fix | allow external projects to use provided compiler options (#55035) | | 4166dfc1b6 | fix | prevent underlying TS Service from handling template files (#55003) |
| Commit | Type | Description | | -- | -- | -- | | 63688714ae | fix | account for variables in imports initializer (#55081) |
| Commit | Type | Description | | -- | -- | -- | | 60f1d681e0 | fix | preserve replaceUrl when returning a urlTree from CanActivate (#54042) | | eae75ff3f9 | fix | RouterLinkActive will always remove active classes when links are not active (#54982) |
<!-- CHANGELOG SPLIT MARKER --><a name="17.3.2"></a>
Changelog
17.3.2 (2024-03-28)
| Commit | Type | Description | | -- | -- | -- | | 2b7bad5151 | fix | invoke method-based tracking function with context (#54960) |
| Commit | Type | Description | | -- | -- | -- | | b478dfbfda | fix | report errors when initializer APIs are used on private fields (#55070) |
| Commit | Type | Description |
| -- | -- | -- |
| 708ba8115f | fix | establish proper injector resolution order for @defer
blocks (#55079) |
| Commit | Type | Description | | -- | -- | -- | | cb433af0e1 | fix | include transferCache when cloning HttpRequest (#54939) | | 64f202cab9 | fix | manage different body types for caching POST requests (#54980) |
| Commit | Type | Description | | -- | -- | -- | | 2f9d94bc4a | fix | account for variables in imports initializer (#55081) |
| Commit | Type | Description | | -- | -- | -- | | 365fd50407 | fix | RouterLinkActive will always remove active classes when links are not active (#54982) |
<!-- CHANGELOG SPLIT MARKER --><a name="18.0.0-next.1"></a>
Changelog
18.0.0-next.1 (2024-03-20)
RESOURCE_CACHE_PROVIDER
APIs have been removed.deprecated platformDynamicServer
has been removed. Add an import @angular/compiler
and replace the usage with platformServer
deprecated ServerTransferStateModule
has been removed. TransferState
can be use without providing this module.
deprecated useAbsoluteUrl
and baseUrl
been removed from PlatformConfig
. Provide and absolute url
instead.
Legacy handling or Node.js URL parsing has been removed from ServerPlatformLocation
.
The main differences are;
pathname
is always suffixed with a /
.port
is empty when http:
protocol and port in url is 80
port
is empty when https:
protocol and port in url is 443
Route.redirectTo
to be a function
in addition to the previous string. Code which expects redirectTo
to
only be a string on Route
objects will need to be adjusted.| Commit | Type | Description | | -- | -- | -- | | 879bd80b57 | fix | capture data bindings for content projection purposes in blocks (#54876) |
| Commit | Type | Description | | -- | -- | -- | | 6aff144232 | fix | symbol feature detection for the compiler (#54711) |
| Commit | Type | Description |
| -- | -- | -- |
| 314112de99 | fix | Prevent markForCheck
during change detection from causing infinite loops (#54900) |
| Commit | Type | Description |
| -- | -- | -- |
| eb20c1a8b1 | refactor | unused RESOURCE_CACHE_PROVIDER
API has been removed (#54875) |
| Commit | Type | Description |
| -- | -- | -- |
| 07ac017731 | refactor | remove deprecated platformDynamicServer
API (#54874) |
| e8b588d8b7 | refactor | remove deprecated ServerTransferStateModule
API (#54874) |
| 3b1967ca64 | refactor | remove deprecated useAbsoluteUrl
and baseUrl
from PlatformConfig
(#54874) |
| 2357d3566c | refactor | remove legacy URL handling logic (#54874) |
| Commit | Type | Description | | -- | -- | -- | | 2b802587f2 | feat | Allow Route.redirectTo to be a function which returns a string or UrlTree (#52606) |
<!-- CHANGELOG SPLIT MARKER --><a name="17.3.1"></a>
Changelog
17.3.1 (2024-03-20)
| Commit | Type | Description | | -- | -- | -- | | c0788200e2 | fix | capture data bindings for content projection purposes in blocks (#54876) |
| Commit | Type | Description | | -- | -- | -- | | 99e9474aa2 | fix | symbol feature detection for the compiler (#54711) |
<!-- CHANGELOG SPLIT MARKER --><a name="18.0.0-next.0"></a>
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>