DEV Community

Cover image for Exploring Angular 17: A Glimpse into the Future of Web Development - Part 3
Ahmed Moustafa for This is Learning

Posted on

Exploring Angular 17: A Glimpse into the Future of Web Development - Part 3

In the third installment of our Angular 17 series, we delve into the transformative changes that shape the developer experience. Building on the groundbreaking Native Control Flow and Deferrable Views introduced in previous blogs, this post navigates through key evolutions in Angular CLI, moving to esbuild, and the powerful Signals mechanism.

Angular CLI Enhancement

Angular CLI undergoes notable changes in Angular 17, streamlining the development process. We explore how these changes enhance modularity, maintainability, and scalability, reflecting Angular's commitment to developer-friendly tools.

Angular 17's Simplifies SSR

With Angular 17, the process of integrating Angular Universal into your application has undergone a significant enhancement. Instead of the previous workflow that involved installing Angular Universal separately after creating a new application, Angular 17 streamlines the setup process.

Now, when you initiate a new Angular application using the ng new command, Angular 17 introduces a prompt during the application creation process. This prompt specifically asks whether you want to include Server-Side Rendering (SSR) in your application. This enhancement simplifies the integration of Angular Universal, allowing you to make this crucial architectural decision right at the beginning of the project setup.

Image description

Angular also introduced the new @angular/ssr package. This package serves as a replacement for the previous @nguniversal/express-engine package, offering equivalent functionality in a more streamlined manner. Notably, the @angular/ssr package stands out for its smaller size, enhanced speed, and improved usability. This evolution represents a commitment to refining and optimizing the Server-Side Rendering (SSR) capabilities within Angular, ensuring that developers can harness this powerful feature with greater efficiency and ease in their projects.

ng add@angular/ssr package
Enter fullscreen mode Exit fullscreen mode

By incorporating this streamlined approach, Angular 17 ensures that developers can seamlessly choose to leverage the benefits of SSR from the outset, aligning with best practices for building modern, performant web applications. This improvement not only enhances the developer experience but also reinforces Angular's commitment to providing efficient tools and workflows.

Standalone components by default

The Angular CLI has adapted its default behavior to align with a component-centric approach. Now, when developers use the ng generate command, the Angular CLI automatically generates standalone components by default. This shift indicates a strategic move towards emphasizing components as the fundamental building blocks, placing them at the forefront of Angular development.

Angular 17 Unleashes esbuild

Angular 17 marks a significant leap forward in its build system, introducing a cutting-edge, esbuild builder that brings substantial performance improvements. This revamped builder, now automatically activated for new applications, boasts an impressive speed boost—up to 87% faster for hybrid rendering and 67% faster for client-side rendering compared to its predecessor.

Among its key features, the new builder embraces a modern output format using ECMAScript Modules (ESM), leveraging dynamic import expressions to facilitate efficient lazy module loading. This advancement not only aligns with contemporary JavaScript standards but also enhances the development experience for Angular users.

For existing applications, adopting the esbuild-based builder is a straightforward process. Developers need to make a simple adjustment in the angular.json file, specifying the esbuild builder for the build architect. This ensures that older applications can take advantage of the enhanced performance and features brought by the new build system.

...
"architect": {
  "build": {
    "builder": "@angular-devkit/build-angular:browser-esbuild",
...

Enter fullscreen mode Exit fullscreen mode

In essence, Angular 17's revamped build system underscores the framework's commitment to staying at the forefront of web development technology. The introduction of the esbuild-based builder not only accelerates build times but also introduces a modernized development experience, setting the stage for more efficient and feature-rich Angular applications.

Signals are now stable

Indeed, the stability of Signals in Angular 17 marks a pivotal advancement in the framework's approach to tracking data changes. Initially introduced as a developer preview in Angular 16, Signals have now evolved into a stable feature, offering developers a more efficient alternative to traditional change detection mechanisms.

Signals represent a groundbreaking paradigm shift in the way Angular applications handle and track changes to data. Their efficiency lies in their ability to precisely detect and propagate changes, minimizing unnecessary checks and improving overall application performance.

By leveraging Signals, developers gain a powerful tool for optimizing the performance of their Angular applications. The stability of Signals in Angular 17 underscores the framework's commitment to providing cutting-edge features that not only enhance developer productivity but also contribute to the creation of high-performing and responsive web applications.

Changes in Signals Behavior Unveiled in Angular 17

The refined behavior of Signals in Angular 17 represents a significant advancement in change detection efficiency. Unlike the traditional approach, where changes to data-bound elements trigger marking of all parent components as dirty, Signals in Angular 17 take a more targeted approach. Specifically, when a change occurs in a data-bound Signal, only the directly affected components—those that explicitly bind to this Signal—are marked as dirty.

This departure from the conventional methodology results in more granular and focused change detection. Notably, this behavior aligns seamlessly with the OnPush change detection strategy, offering substantial performance improvements. By reducing the scope of marked components to only those impacted by the Signal, unnecessary checks and updates are avoided, resulting in a more efficient and responsive application.

Enhanced Diagnostics for Signal

Angular 17 introduces a diagnostic feature aimed at improving code quality and catch potential issues. Specifically, a new diagnostic has been implemented to issue a warning if a getter call is overlooked when reading Signals in templates. This enhancement is designed to bring attention to situations where the absence of a necessary getter call might lead to unintended behavior or incomplete data retrieval.

By providing a warning in such scenarios, Angular 17 promotes best practices and helps developers identify and rectify potential oversights early in the development process. This proactive approach not only aids in preventing runtime errors but also contributes to a more robust and reliable codebase.


As we conclude this exploration of Angular 17's evolution, stay tuned for our next and final post in the series. In the upcoming installment, we'll unravel the remaining features of Angular 17, providing a comprehensive overview of the framework's latest advancements. Join us as we continue to uncover the cutting-edge capabilities that Angular 17 brings to the forefront of web development.

Top comments (0)