Nx 21.2 is here! This release is focused on migrating to newer versions of some of our favorite technologies: Angular 20, Storybook 9, and NestJS 11.
What's new in Angular 20
We'll leave it to the Angular team for all the details, but we wanted to call out a few changes that may impact Nx workspaces.
Structural directives deprecated
It's time to part ways with structural directives like *ngIf
and *ngFor
and move on to control flow with @if
and @for
.
Your workspace will be migrated to control flow by default during migration to Nx 21.2. If you’d like to hang on to that syntax a little longer, see our docs on running migration in interactive mode to skip this migration. Or use the newly introduced Migrate UI in Nx Console to skip the migration.
If you choose not to migrate now, you’ll be able to re-run the migration later:
❯
nx g @angular/core control-flow
Experimental support for Vitest from the Angular team
Angular 20 introduces experimental support for vitest as a unit test runner. This is a fantastic addition to the core set of tools offered by the Angular team. Nx already offers vitest as an option when creating Angular apps and libraries, which is enabled by installing the Analog plugin. You can choose between vitest support via the Analog plugin or through the new experimental vitest support. Nx generators will continue to use the Analog plugin. See the Angular documentation on how to use the vitest builder.
New style guide changes
Last year, the Angular team opened an RFC for changes to the style guide, and Angular 20 implements the changes discussed. One of the bigger changes is that the Angular CLI has changed the format of filenames used when generating code. Generators provided by Nx will also follow the new style guide for new workspaces using Angular, but the previous behavior will be retained for existing workspaces. This is the same process the Angular CLI is following.
As part of migrating to Nx 21.2, generator and schematic defaults will be set for your workspace so that filename suffixes continue to be added. You can see what that change looks like in the migration documentation.
BREAKING CHANGE: Angular 17 support removed
Following our support schedule, Angular 17 is no longer supported in Nx 21.2. If you want to continue with Angular 17, you'll need to postpone upgrading to Nx 21.2 for now.
NestJS 11 is here!
Angular isn't the only framework getting attention with this release: we've also added support for NestJS 11! This release brings better logging, more flexible microservices, and faster application startup. Your workspace will automatically be migrated to this new version as part of migrating to Nx 21.2.
Storybook 9 makes testing components better than ever
Storybook 9 is here with faster, leaner component tests powered by vitest. By default, your workspace will be automatically migrated to Storybook 9 as part of Nx 21.2. If you choose to skip that migration, you can re-run it later using our Storybook 9 setup guide.
BREAKING CHANGE: Deprecated Storybook generators removed
Deprecated Storybook generators have been removed: @nx/storybook:cypress-project
, @nx/react-native:storybook-configuration
, @nx/react-native:stories
, @nx/react-native:component-story
. Use @nx/storybook:configuration
instead.
Migrating to latest version
As always, to migrate to the latest version of Nx, you can use the migrate
command:
❯
nx migrate latest
Or if you're using Nx Console, you can use the recently introduced Migrate UI.
Learn more: