Angular 18.0: New features coming
ℹ️ Draft: The development of Angular 18.0 is just started, this is a work in progress collection of notes.
Release date: This release is planned in May 2024. We will follow the weekly changes.
Here a list of what can be useful in the daily activity of a developer.
Compiler improvement and bugfixes are not included.
If you want to test the new features you need the next version of Angular. For an existing project you can upgrade using ng update @angular/cli @angular/core --next
What's coming?
The version 17.3 as just been released, the fun just started ;-).
Latest version: 18.0.0-next.1 (2024-03-20)
Node version: no change (yet), ^18.13.0 || ^20.9.0
Typescript version: no change (yet), >=5.2 <=5.4
Yarn version: no change (yet), >=1.22.4 <2
Changes:
- Allow Route.redirectTo to be a function which returns a string or UrlTree (#52606)
- Guards can now return RedirectCommand for redirects in addition to UrlTree. From feat(router): Add ability to return UrlTree with NavigationBehaviorOptions from guards #45023
Breaking changes
A lot here, I've to still look into, mainly are Change Detection changes:
- OnPush views at the root of the application need to be marked dirty for their host bindings to refresh.
- The exact timing of change detection execution when
using event or run coalescing with NgZone is now the first of either setTimeout or requestAnimationFrame. Code which relies on this timing (usually by accident) will need to be adjusted. - Newly created and views marked for check and reattached during change detection are now guaranteed to be refreshed in that same change detection cycle. Previously, if they were attached at a location in the view tree that was already checked, they would either throw ExpressionChangedAfterItHasBeenCheckedError or not be refreshed until some future round of change detection
- Guards can now return RedirectCommand for redirects in addition to UrlTree. Code which expects only boolean or UrlTree values in Route types will need to be adjusted.
What's new in version 17.x
Angular 17.3 is the last official version, released on March 13th, 2024. The list of changes are here: https://marmo.dev/angular-17-2-features.
Angular 17.2 has been released on February 14th, 2024. Post about Angular 17.2: https://marmo.dev/angular-17-2-features
Angular 17.1 has been released on January 17th, 2024.
You can find a list of changes (more than 10) relevant for developers here: https://marmo.dev/angular-17-1-features