DEV Community

Cover image for Ng-News 25/12: Nx Angular Week, Deprecation PR *ngIf/For/Switch
ng-news for This is Angular

Posted on

6

Ng-News 25/12: Nx Angular Week, Deprecation PR *ngIf/For/Switch

Nx showcased their Angular support during the "Angular Week" including testing tools, architectural rules, and official Rspack integration. Meanwhile, a new PR proposes deprecating *ngIf, *ngFor, and *ngSwitch in favor of @if, @for, and @switch—with automatic migration planned for Angular 20.

AMA with Minko Gechev

Minko Gechev, Angular product lead, did an Ask-Me-Anything session on LinkedIn. Here’s a quick selection of his statements

  • Zone.js will likely never go away.
  • The plan to make RxJS optional is still on.
  • Angular won’t switch to Rspack. They see Vite with esbuild performing just as well. Also, they’re discouraging the use of custom Webpack plugins.

#angular #typescript #programming #webdev | Minko Gechev | 222 comments

Angular Ask me Anything in the comments 👇 #angular #typescript #programming #webdev | 222 comments on LinkedIn

favicon linkedin.com

"Angular Week" at Nx

Nx, an alternative to the Angular CLI, did an "Angular Week" and published several articles highlighting their contributions to the Angular ecosystem.

One article covered how Nx integrates modern testing tools like Playwright and Vitest. Especially for Vitest there has been a strong support from community members like Brandon Roberts and Younes Jaaidi.

Modern Angular Testing with Nx | Nx Blog

Learn how Nx enhances Angular testing by integrating modern tools like Playwright and Vitest, improving test speed, reliability, and CI scalability.

favicon nx.dev

Another post was a re-publication of a classic: Enterprise Monorepo Patterns. A book, originally released in 2018, and is still one of the most cited resources when it comes to large-scale architecture.

Enterprise Angular Monorepo Patterns | Nx Blog

Get the latest version of the Enterprise Angular Monorepo patterns book.

favicon nx.dev

There was also an article about Rspack. While Angular moved to esbuild, most users didn't even notice it, because the Angular CLI acs as the public API.

In larger application, though, custom webpack configs are common. Rspack offers webpack compatibility with esbuild-like speed, making it easier to reuse existing setups.
While the Angular team doesn’t plan to support Rspack, Nx stepped in and officially took over Angular integration, with Colum Ferry having laid the groundwork.

Using Rspack with Angular | Nx Blog

Learn about how and why to use Rspack with Angular thanks to Nx's efforts for supporting Rspack for Angular.

favicon nx.dev

Lastly, Nx also covered their ESLint rules to enforce architecture constraints, like encapsulation and module boundaries.

Angular Architecture Guide To Building Maintainable Applications at Scale | Nx Blog

Learn how to build scalable Angular applications using domain-driven design, clear boundaries, and Nx tooling for better maintainability and team collaboration.

favicon nx.dev

Deprecation PR for *ngIf/For/Switch

The days of the three structural directives *ngIf, *ngFor, and *ngSwitch might be numbered.

Matthieu Riegler, from the Angular team, published a PR proposing their deprecation in favor of the new control flow syntax: @if, @for, and @switch.

Why? Not just because it looks nicer—there are real reasons. The old syntax increases bundle size, the new one is faster, and *ngFor has a subtle memory leak.

Deprecation doesn’t mean removal—these directives would still work. But if the PR is accepted, ng update in Angular 20 would apply the migration automatically.

refactor(core): Deprecate the `ngIf`/`ngFor`/`ngSwitch` structural directives #60492

The control flow @-blocks have been introduced in v17. As an effort to unify & streamline template authoring, we are deprecating in v20 the structural directives ngIf/ngFor/ngSwitch.

The control flow schematics becomes a migration that is executed during ng update

Note: This is not a deprecation of structural directives, this only about ngIf/ngFor/ngSwitch.

DEPRECATION: ngIf/ngFor/ngSwitch are deprecated. Use the control flow blocks instead (@for/@if/@switch).


If you're looking for argument for not keeping both control flow:

  • Applications that use both structural directives and control flow blocks end up shipping both implementations, impacting bundle sizes.
  • The new control flow block ships a new reconciliation algorithm that improved performance (as this was made evident in these benchmark https://krausest.github.io/js-framework-benchmark/current.html)
  • ngFor has a known subtle memory leak (#36878), which has been addressed in the new @for implementation.

Although Matthieu Riegler has been one of the most active Angular contributors for a while, he was doing it in his free time. Last week, he announced he’s now officially working full-time on Angular as a contractor. A true win-win.

I’m thrilled to share that I’ll be working full-time as a contractor on… | Matthieu Riegler | 69 comments

I’m thrilled to share that I’ll be working full-time as a contractor on Angular w/ Google, focusing on its tooling and documentation! A huge thank you to… | 69 comments on LinkedIn

favicon linkedin.com

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

If this article connected with you, consider tapping ❤️ or leaving a brief comment to share your thoughts!

Okay