Angular 15.2 was released a few days ago. The main addition to this release is a new Angular CLI schematic to migrate your existing code to standalone components:
ng generate @angular/core:standalone
This schematic isn’t documented on the Angular website yet, as it’s still in its early stages. It looks like it has three options so far:
convert-to-standalone
: Default option. Converts all components to standalone ones except those declared in your mainAppModule
.prune-ng-modules
: Deletes all modules that aren’t necessary anymore because their features have been migrated to standalone components.standalone-bootstrap
: Bootstraps your application with thebootstrapApplication
function and migrates the components referenced in yourAppModule
.
I’ll post more information in the newsletter as this new schematic evolves.
Another update is that class-based guards are being deprecated, which means the Angular team is pushing for its new function-based router features.
Lastly, a new RouterTestingHarness
utility has been added to help with unit-testing components loaded by the router. The Angular team released a short guide to explain how to use it.